|
| 1 | +Sign Hub Apps |
| 2 | +============= |
| 3 | + |
| 4 | +This guide explains how app signing works in Flower Hub and how to use it in practice. |
| 5 | + |
| 6 | +Before an app can be reviewed and signed, it must already be published to Flower Hub. |
| 7 | +The app does not need to be published by the same account that reviews and signs it. |
| 8 | + |
| 9 | +.. note:: |
| 10 | + |
| 11 | + App signing and app-page verification metadata are preview features. They may |
| 12 | + change over time. |
| 13 | + |
| 14 | + |
| 15 | +How App Signing Works |
| 16 | +--------------------- |
| 17 | + |
| 18 | +At a high level: |
| 19 | + |
| 20 | +1. An app exists on Flower Hub. |
| 21 | +2. The reviewer has an Ed25519 key pair and has registered the public key in |
| 22 | + their Flower account profile. |
| 23 | +3. The reviewer downloads the FAB and signs it with the matching Ed25519 |
| 24 | + private key via :code:`flwr app review`. |
| 25 | +4. The signature is attached to app verification metadata in Flower Hub. |
| 26 | +5. Users can inspect the app's verification metadata on the app page and decide |
| 27 | + which signers they trust. |
| 28 | + |
| 29 | + |
| 30 | +Prerequisites |
| 31 | +------------- |
| 32 | + |
| 33 | +- Ensure :code:`flwr` is installed |
| 34 | +- A Flower account and active login |
| 35 | +- An Ed25519 OpenSSH key pair for signing |
| 36 | +- The corresponding public key added to your Flower account profile |
| 37 | +- An app on Flower Hub to review and sign |
| 38 | + |
| 39 | +Log in to your Flower account on SuperGrid: |
| 40 | + |
| 41 | +.. code-block:: bash |
| 42 | +
|
| 43 | + flwr login supergrid |
| 44 | +
|
| 45 | +
|
| 46 | +Create a Signing Key |
| 47 | +-------------------- |
| 48 | + |
| 49 | +Generate an Ed25519 key pair in OpenSSH format: |
| 50 | + |
| 51 | +.. code-block:: bash |
| 52 | +
|
| 53 | + ssh-keygen -t ed25519 -f hub_signing_key -C "hub-review-key" |
| 54 | +
|
| 55 | +This creates: |
| 56 | + |
| 57 | +- :code:`hub_signing_key` (private key, keep secret) |
| 58 | +- :code:`hub_signing_key.pub` (public key) |
| 59 | + |
| 60 | +.. warning:: |
| 61 | + |
| 62 | + Keep private keys secure. Anyone with this private key can produce signatures |
| 63 | + attributed to that signer. |
| 64 | + |
| 65 | + |
| 66 | +Register Your Public Key in Your Flower Account |
| 67 | +----------------------------------------------- |
| 68 | + |
| 69 | +Add the public key to your Flower account profile: |
| 70 | + |
| 71 | +- Open :code:`https://flower.ai/profile/<account_username>/` |
| 72 | +- Add the content of :code:`hub_signing_key.pub` to your profile keys |
| 73 | + |
| 74 | +When signing, you must use the private key corresponding to a public key |
| 75 | +registered in the reviewer account. |
| 76 | + |
| 77 | + |
| 78 | +Choose an App to Sign |
| 79 | +--------------------- |
| 80 | + |
| 81 | +You can sign: |
| 82 | + |
| 83 | +- your own app, or |
| 84 | +- an app published by someone else. |
| 85 | + |
| 86 | +Supported app specs: |
| 87 | + |
| 88 | +- :code:`@account/app` (latest version) |
| 89 | +- :code:`@account/app==x.y.z` (specific version) |
| 90 | + |
| 91 | +Examples: |
| 92 | + |
| 93 | +.. code-block:: bash |
| 94 | +
|
| 95 | + # Sign latest version |
| 96 | + flwr app review @flwrlabs/quickstart-pytorch |
| 97 | +
|
| 98 | + # Sign a specific version |
| 99 | + flwr app review @flwrlabs/quickstart-pytorch==1.1.0 |
| 100 | +
|
| 101 | +
|
| 102 | +Review and Sign the App |
| 103 | +----------------------- |
| 104 | + |
| 105 | +Sign an app version: |
| 106 | + |
| 107 | +.. code-block:: bash |
| 108 | +
|
| 109 | + flwr app review @account/app==x.y.z |
| 110 | +
|
| 111 | +The CLI will: |
| 112 | + |
| 113 | +1. Download the FAB. |
| 114 | +2. Unpack it for manual inspection. |
| 115 | +3. Ask you to type :code:`SIGN`. |
| 116 | +4. Ask for the path to your Ed25519 OpenSSH private key. |
| 117 | +5. Submit the signature to Flower Hub. |
| 118 | + |
| 119 | +.. note:: |
| 120 | + |
| 121 | + :code:`flwr app review` signs the FAB digest plus timestamp. The resulting |
| 122 | + signature is submitted with the app ID and version. |
| 123 | + |
| 124 | + |
| 125 | +Check Verifications on the App Page |
| 126 | +----------------------------------- |
| 127 | + |
| 128 | +If you want to run an app and evaluate trust, open the app page on Flower Hub |
| 129 | +and check the :code:`Verifications` section. |
| 130 | +Use this section to see who signed the app and decide whether you trust those |
| 131 | +signers. |
| 132 | + |
| 133 | + |
| 134 | +Troubleshooting |
| 135 | +--------------- |
| 136 | + |
| 137 | +- **Private key errors during review** |
| 138 | + |
| 139 | + Ensure that your private key is an **Ed25519 OpenSSH** key. Other key types |
| 140 | + or formats are not supported. |
| 141 | + |
| 142 | +- **Signature not displayed on the app page** |
| 143 | + |
| 144 | + Verify that you: |
| 145 | + |
| 146 | + 1. Successfully completed :code:`flwr app review` |
| 147 | + 2. Signed the app using a private key that corresponds to a public key |
| 148 | + registered in your Flower account profile |
| 149 | + |
| 150 | + If the public key is not registered, or does not match the private key used |
| 151 | + for signing, the signature will not be displayed. |
| 152 | + |
| 153 | + |
| 154 | +See Also |
| 155 | +-------- |
| 156 | + |
| 157 | +- :doc:`how-to-publish-app-on-hub` |
| 158 | +- :doc:`how-to-use-app-from-hub` |
0 commit comments