pub struct GeneratedCredential {
pub data: Value,
pub lease: Lease,
pub scoped_to: Vec<String>,
pub shape: Option<CredentialShape>,
pub revoke_effect: Option<String>,
}Expand description
The result of minting a credential: what the caller gets, the lease that governs it, and what it was narrowed to.
Fields§
§data: Value§lease: Lease§scoped_to: Vec<String>Human-readable scope of this credential — e.g. ["repo:reports", "contents:read"]. Echoed into the response _doc so a consumer can
see what it was granted rather than inferring it.
shape: Option<CredentialShape>Overrides the engine’s shape for this one credential. Needed because a
single engine can offer mechanisms with different guarantees — the AWS
engine mints both un-revocable STS sessions and revocable per-lease IAM
users — and a _doc block that averaged over them would be a lie.
revoke_effect: Option<String>Overrides the engine’s revoke_effect for this one credential.
Implementations§
Source§impl GeneratedCredential
impl GeneratedCredential
Sourcepub fn new(data: Value, lease: Lease, scoped_to: Vec<String>) -> Self
pub fn new(data: Value, lease: Lease, scoped_to: Vec<String>) -> Self
The common case: this credential behaves exactly as the engine’s own
doc() describes.
Sourcepub fn with_shape(
self,
shape: CredentialShape,
revoke_effect: impl Into<String>,
) -> Self
pub fn with_shape( self, shape: CredentialShape, revoke_effect: impl Into<String>, ) -> Self
Declares that this credential’s guarantees differ from the engine’s headline shape.