diff options
| author | Nostr.Band <124499563+nostrband@users.noreply.github.com> | 2024-03-22 08:01:37 +0100 |
|---|---|---|
| committer | fiatjaf_ <fiatjaf@gmail.com> | 2024-03-22 09:08:22 -0300 |
| commit | 4b79bc67c471f77061d62704538e5fdd6ac28ae8 (patch) | |
| tree | c54bddc2e1c0ff8282474a4725828abc5d577751 | |
| parent | cf0e6e1567662a80ff8f4ed1500909b843d5162f (diff) | |
Add optional_requested_permissions
This is implemented in nsec.app, nostr.band, Coracle and Nostrudel, so maybe it's time to update the NIP.
| -rw-r--r-- | 46.md | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -120,7 +120,7 @@ Each of the following are methods that the client sends to the remote signer. | |||
| 120 | 120 | ||
| 121 | | Command | Params | Result | | 121 | | Command | Params | Result | |
| 122 | | ------------------------ | ------------------------------------------------- | ---------------------------------------------------------------------- | | 122 | | ------------------------ | ------------------------------------------------- | ---------------------------------------------------------------------- | |
| 123 | | `connect` | `[<remote_user_pubkey>, <optional_secret>]` | "ack" | | 123 | | `connect` | `[<remote_user_pubkey>, <optional_secret>, <optional_requested_permissions>]` | "ack" | |
| 124 | | `sign_event` | `[<json_stringified_event_to_sign>]` | `json_stringified(<signed_event>)` | | 124 | | `sign_event` | `[<json_stringified_event_to_sign>]` | `json_stringified(<signed_event>)` | |
| 125 | | `ping` | `[]` | "pong" | | 125 | | `ping` | `[]` | "pong" | |
| 126 | | `get_relays` | `[]` | `json_stringified({<relay_url>: {read: <boolean>, write: <boolean>}})` | | 126 | | `get_relays` | `[]` | `json_stringified({<relay_url>: {read: <boolean>, write: <boolean>}})` | |
| @@ -130,6 +130,10 @@ Each of the following are methods that the client sends to the remote signer. | |||
| 130 | | `nip44_encrypt` | `[<third_party_pubkey>, <plaintext_to_encrypt>]` | `<nip44_ciphertext>` | | 130 | | `nip44_encrypt` | `[<third_party_pubkey>, <plaintext_to_encrypt>]` | `<nip44_ciphertext>` | |
| 131 | | `nip44_decrypt` | `[<third_party_pubkey>, <nip44_ciphertext_to_decrypt>]` | `<plaintext>` | | 131 | | `nip44_decrypt` | `[<third_party_pubkey>, <nip44_ciphertext_to_decrypt>]` | `<plaintext>` | |
| 132 | 132 | ||
| 133 | ### Requested permissions | ||
| 134 | |||
| 135 | The `connect` method may be provided with `optional_requested_permissions` for user convenience. The permissions are a comma-separated list of `method[:params]`, i.e. `nip04_encrypt,sign_event:4` meaning permissions to call `nip04_encrypt` and to call `sign_event` with `kind:4`. Optional parameter for `sign_event` is the kind number, parameters for other methods are to be defined later. | ||
| 136 | |||
| 133 | ## Response Events `kind:24133` | 137 | ## Response Events `kind:24133` |
| 134 | 138 | ||
| 135 | ```json | 139 | ```json |
| @@ -185,7 +189,7 @@ Each of the following are methods that the client sends to the remote signer. | |||
| 185 | 189 | ||
| 186 | | Command | Params | Result | | 190 | | Command | Params | Result | |
| 187 | | ---------------- | ------------------------------------------ | ------------------------------------ | | 191 | | ---------------- | ------------------------------------------ | ------------------------------------ | |
| 188 | | `create_account` | `[<username>, <domain>, <optional_email>]` | `<newly_created_remote_user_pubkey>` | | 192 | | `create_account` | `[<username>, <domain>, <optional_email>, <optional_requested_permissions>]` | `<newly_created_remote_user_pubkey>` | |
| 189 | 193 | ||
| 190 | ## Appendix | 194 | ## Appendix |
| 191 | 195 | ||