pub struct FederatedCredentialClient { /* private fields */ }Expand description
Calls FederatedCredentialService.
Federated credentials: a service_account::Type::Workload service account’s trust in the OIDC
tokens of an identity provider outside Origin Cloud, such as the token
GitHub Actions gives every job. Software holding a matching token
exchanges it for the service account’s access token, so no secret is
stored where it runs. A trust policy names the token’s issuer and
audience exactly, and the claims it must carry. To change one, create
the new one and delete the old.
Implementations§
Source§impl FederatedCredentialClient
impl FederatedCredentialClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of FederatedCredentialService 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 get_federated_credential(
&self,
request: GetFederatedCredentialRequest,
) -> Result<FederatedCredential, Error>
pub async fn get_federated_credential( &self, request: GetFederatedCredentialRequest, ) -> Result<FederatedCredential, Error>
Returns a federated credential, deleted or not. Needs
iam.service_account.list on the organization.
Sourcepub async fn list_federated_credentials(
&self,
request: ListFederatedCredentialsRequest,
) -> Result<ListFederatedCredentialsResponse, Error>
pub async fn list_federated_credentials( &self, request: ListFederatedCredentialsRequest, ) -> Result<ListFederatedCredentialsResponse, Error>
Lists a service account’s federated credentials, oldest first. Deleted
ones are listed only when show_deleted is set. Needs
iam.service_account.list on the organization.
Sourcepub fn all_federated_credentials(
&self,
request: ListFederatedCredentialsRequest,
) -> Pages<FederatedCredential>
pub fn all_federated_credentials( &self, request: ListFederatedCredentialsRequest, ) -> Pages<FederatedCredential>
Returns everything list_federated_credentials lists from request’s page on, fetching the next page as the stream reaches it. A page that fails ends the stream with its error.
Sourcepub async fn create_federated_credential(
&self,
request: CreateFederatedCredentialRequest,
) -> Result<FederatedCredential, Error>
pub async fn create_federated_credential( &self, request: CreateFederatedCredentialRequest, ) -> Result<FederatedCredential, Error>
Creates a federated credential on an active service_account::Type::Workload service
account. Anyone whose token matches it acts as the service account, so
creating one needs iam.service_account.create and
iam.service_account.act_as on the organization: the right to act as
the account yourself. Refused with INVALID_ARGUMENT when a condition
contains *, or when no condition names an identity that never
changes: repository_id or repository_owner_id for GitHub Actions’
issuer, project_id or namespace_id for GitLab.com’s, sub for any
other.
Sourcepub async fn delete_federated_credential(
&self,
request: DeleteFederatedCredentialRequest,
) -> Result<Empty, Error>
pub async fn delete_federated_credential( &self, request: DeleteFederatedCredentialRequest, ) -> Result<Empty, Error>
Deletes a federated credential: no token is exchanged for it from then
on, and an access token already exchanged for it is refused on its
next request. It stays readable as federated_credential::State::Deleted. Deleting a deleted one
succeeds. Needs iam.service_account.revoke on the organization.