pub struct SecurityTokenClient { /* private fields */ }Expand description
Calls SecurityTokenService.
The security token service: it turns a token from an identity provider
outside Origin Cloud, such as a CI job’s OIDC token, into the access token
of a WORKLOAD service account that trusts it through a federated
credential. It authenticates no caller: the token is the proof.
Implementations§
Source§impl SecurityTokenClient
impl SecurityTokenClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of SecurityTokenService that sends its calls through client.
Sourcepub fn service(&self) -> &Service
pub fn service(&self) -> &Service
The endpoint the client sends its calls to, which also serves the operations its methods answer with.
Sourcepub fn with_options(&self, options: CallOptions) -> Self
pub fn with_options(&self, options: CallOptions) -> Self
The same client, whose calls are sent as options says instead of as the Client’s settings do, such as a mutation that must not be sent twice: .with_options(CallOptions::new().max_attempts(1)). See CallOptions.
Sourcepub async fn assume_service_account(
&self,
request: AssumeServiceAccountRequest,
) -> Result<AssumeServiceAccountResponse, Error>
pub async fn assume_service_account( &self, request: AssumeServiceAccountRequest, ) -> Result<AssumeServiceAccountResponse, Error>
Assumes a WORKLOAD service account with an OIDC token. Exactly one
federated credential, of the named service account or of any, must
trust the token: its issuer and audience, and every one of its
conditions. The token is verified with its issuer’s published keys
(RS256), and a pull request’s job is admitted only by a credential that
names its event_name. Refused with PERMISSION_DENIED when the token
isn’t trusted, without saying why, and with UNAVAILABLE when its
issuer or the trust can’t be read now.