GoodMemGoodMem
ReferenceSdkRustTypes

CreateApiKeyRequest

Rust struct goodmem::models::CreateApiKeyRequest: declaration, fields or variants, and implementations.

All types

Struct CreateApiKeyRequest

goodmem::models::CreateApiKeyRequest

Request parameters for creating a new API key.

pub struct CreateApiKeyRequest {
    pub labels: Option<BTreeMap<String, String>>,
    pub expires_at: Option<i64>,
    pub api_key_id: Option<String>,
    pub subject_principal_id: Option<String>,
    pub authority_mode: Option<ApiKeyAuthorityMode>,
    pub ceiling: Option<Vec<AccessPolicyRule>>,
    pub valid_from: Option<i64>,
}

Referenced types: AccessPolicyRule, ApiKeyAuthorityMode.

Fields

labels

pub labels: Option<BTreeMap<String, String>>

Key-value pairs of metadata associated with the API key. Used for organization and filtering. At most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-]. Wire name: labels.

expires_at

pub expires_at: Option<i64>

Exclusive expiration timestamp in milliseconds since epoch. It must be later than validFrom, which defaults to issuance time; if omitted, the key does not expire. Wire name: expiresAt.

api_key_id

pub api_key_id: Option<String>

Optional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use. Wire name: apiKeyId.

subject_principal_id

pub subject_principal_id: Option<String>

Principal authenticated by this key. Omit to use the authenticated principal. Wire name: subjectPrincipalId.

authority_mode

pub authority_mode: Option<ApiKeyAuthorityMode>

Authority mode. Omit to create a self-issued human key that inherits live authority. A scoped issuing credential may create only SCOPED children. Wire name: authorityMode.

ceiling

pub ceiling: Option<Vec<AccessPolicyRule>>

Immutable authorization ceiling. Required and nonempty for SCOPED; omitted for INHERIT_SUBJECT, with at most 1,000 rules. Every rule must be covered by both the subject's live authority and the issuing credential's effective authority. Wire name: ceiling.

valid_from

pub valid_from: Option<i64>

Inclusive activation time in epoch milliseconds. Omit to activate at issuance time. Wire name: validFrom.

Implementations

validate

pub fn validate(&self) -> crate::Result<()>

Validate the request before sending, without making an HTTP call.

Trait implementations

  • Clone (derived)
  • Default (derived)
  • PartialEq (derived)
  • Serialize (derived)
  • impl<'de> Deserialize<'de> for CreateApiKeyRequest
  • impl std::fmt::Debug for CreateApiKeyRequest

On this page