pub struct UpdateClientRequest {
pub client_pk: PublicKey,
pub new_label: Option<Option<String>>,
pub new_expires_at: Option<Option<TimestampMs>>,
pub new_scopes: Option<BTreeSet<Scope>>,
pub new_permissions: Option<BTreeSet<String>>,
}Expand description
A request to update the properties of an existing client.
Fields§
§client_pk: PublicKeyThe public key of the client to update.
new_label: Option<Option<String>>The updated label for the client.
None: leave the label unchanged.Some(None): clear the label.Some(Some(label)): set the label.
new_expires_at: Option<Option<TimestampMs>>The updated expiration for the client.
None: leave the expiration unchanged.Some(None): make the client never expire. Use carefully!Some(Some(expires_at)): set the expiration.
new_scopes: Option<BTreeSet<Scope>>The updated scopes for the client.
If either new_permissions or new_scopes is provided, together they
replace the client’s complete grant; an omitted set is treated as
empty. The resulting grant must contain at least one scope or
permission.
new_permissions: Option<BTreeSet<String>>The updated extra permissions for the client, by string id
(e.g. "create_invoice").
If either new_permissions or new_scopes is provided, together they
replace the client’s complete grant; an omitted set is treated as
empty. The resulting grant must contain at least one scope or
permission.
Unstable: permission ids are not part of the stable API and may be
renamed. Avoid matching on specific ids; prefer scopes instead.
Implementations§
Source§impl UpdateClientRequest
impl UpdateClientRequest
Sourcepub fn new(
client_pk: PublicKey,
label: Option<String>,
clear_label: bool,
expires_at: Option<TimestampMs>,
clear_expiration: bool,
new_scopes: Option<BTreeSet<Scope>>,
new_permissions: Option<BTreeSet<String>>,
) -> Result<Self>
pub fn new( client_pk: PublicKey, label: Option<String>, clear_label: bool, expires_at: Option<TimestampMs>, clear_expiration: bool, new_scopes: Option<BTreeSet<Scope>>, new_permissions: Option<BTreeSet<String>>, ) -> Result<Self>
Build a request from explicit set/clear flags, used by wrappers whose
serialization can’t express the Option<Option<_>> fields, such as the
Sidecar’s JSON API, UniFFI, and the CLI.
- At most one of
clear_labelorlabelcan be set. - At most one of
clear_expirationorexpires_atcan be set. new_scopesandnew_permissionsfollow the field semantics above.