pub struct AuthClient<'a> { /* private fields */ }Expand description
Thin typed client for Trellis auth/admin RPCs used by the CLI.
Implementations§
Source§impl<'a> AuthClient<'a>
impl<'a> AuthClient<'a>
Sourcepub fn new(inner: &'a TrellisClient) -> Self
pub fn new(inner: &'a TrellisClient) -> Self
Wrap an already-connected low-level Trellis client.
Sourcepub async fn me(&self) -> Result<AuthenticatedUser, TrellisAuthError>
pub async fn me(&self) -> Result<AuthenticatedUser, TrellisAuthError>
Return the currently authenticated user.
Sourcepub async fn list_approvals(
&self,
user: Option<&str>,
digest: Option<&str>,
) -> Result<Vec<ApprovalEntryRecord>, TrellisAuthError>
pub async fn list_approvals( &self, user: Option<&str>, digest: Option<&str>, ) -> Result<Vec<ApprovalEntryRecord>, TrellisAuthError>
List stored app approval decisions.
Sourcepub async fn revoke_approval(
&self,
digest: &str,
user: Option<&str>,
) -> Result<bool, TrellisAuthError>
pub async fn revoke_approval( &self, digest: &str, user: Option<&str>, ) -> Result<bool, TrellisAuthError>
Revoke one stored approval decision.
Sourcepub async fn list_portals(&self) -> Result<Vec<PortalRecord>, TrellisAuthError>
pub async fn list_portals(&self) -> Result<Vec<PortalRecord>, TrellisAuthError>
List registered portals.
Sourcepub async fn create_portal(
&self,
portal_id: &str,
app_contract_id: Option<&str>,
entry_url: &str,
) -> Result<PortalRecord, TrellisAuthError>
pub async fn create_portal( &self, portal_id: &str, app_contract_id: Option<&str>, entry_url: &str, ) -> Result<PortalRecord, TrellisAuthError>
Create or replace a portal record.
Sourcepub async fn disable_portal(
&self,
portal_id: &str,
) -> Result<bool, TrellisAuthError>
pub async fn disable_portal( &self, portal_id: &str, ) -> Result<bool, TrellisAuthError>
Disable a portal.
Sourcepub async fn get_login_portal_default(
&self,
) -> Result<PortalDefaultRecord, TrellisAuthError>
pub async fn get_login_portal_default( &self, ) -> Result<PortalDefaultRecord, TrellisAuthError>
Get the deployment-wide login portal default.
Sourcepub async fn set_login_portal_default(
&self,
portal_id: Option<&str>,
) -> Result<PortalDefaultRecord, TrellisAuthError>
pub async fn set_login_portal_default( &self, portal_id: Option<&str>, ) -> Result<PortalDefaultRecord, TrellisAuthError>
Set the deployment-wide login portal default.
Sourcepub async fn list_login_portal_selections(
&self,
) -> Result<Vec<LoginPortalSelectionRecord>, TrellisAuthError>
pub async fn list_login_portal_selections( &self, ) -> Result<Vec<LoginPortalSelectionRecord>, TrellisAuthError>
List contract-specific login portal selections.
Sourcepub async fn set_login_portal_selection(
&self,
contract_id: &str,
portal_id: Option<&str>,
) -> Result<LoginPortalSelectionRecord, TrellisAuthError>
pub async fn set_login_portal_selection( &self, contract_id: &str, portal_id: Option<&str>, ) -> Result<LoginPortalSelectionRecord, TrellisAuthError>
Create or replace a contract-specific login portal selection.
Sourcepub async fn clear_login_portal_selection(
&self,
contract_id: &str,
) -> Result<bool, TrellisAuthError>
pub async fn clear_login_portal_selection( &self, contract_id: &str, ) -> Result<bool, TrellisAuthError>
Clear a contract-specific login portal selection.
Sourcepub async fn get_workload_portal_default(
&self,
) -> Result<PortalDefaultRecord, TrellisAuthError>
pub async fn get_workload_portal_default( &self, ) -> Result<PortalDefaultRecord, TrellisAuthError>
Get the deployment-wide workload portal default.
Sourcepub async fn set_workload_portal_default(
&self,
portal_id: Option<&str>,
) -> Result<PortalDefaultRecord, TrellisAuthError>
pub async fn set_workload_portal_default( &self, portal_id: Option<&str>, ) -> Result<PortalDefaultRecord, TrellisAuthError>
Set the deployment-wide workload portal default.
Sourcepub async fn list_workload_portal_selections(
&self,
) -> Result<Vec<WorkloadPortalSelectionRecord>, TrellisAuthError>
pub async fn list_workload_portal_selections( &self, ) -> Result<Vec<WorkloadPortalSelectionRecord>, TrellisAuthError>
List profile-specific workload portal selections.
Sourcepub async fn set_workload_portal_selection(
&self,
profile_id: &str,
portal_id: Option<&str>,
) -> Result<WorkloadPortalSelectionRecord, TrellisAuthError>
pub async fn set_workload_portal_selection( &self, profile_id: &str, portal_id: Option<&str>, ) -> Result<WorkloadPortalSelectionRecord, TrellisAuthError>
Create or replace a profile-specific workload portal selection.
Sourcepub async fn clear_workload_portal_selection(
&self,
profile_id: &str,
) -> Result<bool, TrellisAuthError>
pub async fn clear_workload_portal_selection( &self, profile_id: &str, ) -> Result<bool, TrellisAuthError>
Clear a profile-specific workload portal selection.
Sourcepub async fn list_workload_profiles(
&self,
contract_id: Option<&str>,
disabled: bool,
) -> Result<Vec<AuthListWorkloadProfilesResponseProfilesItem>, TrellisAuthError>
pub async fn list_workload_profiles( &self, contract_id: Option<&str>, disabled: bool, ) -> Result<Vec<AuthListWorkloadProfilesResponseProfilesItem>, TrellisAuthError>
List workload profiles.
Sourcepub async fn create_workload_profile(
&self,
profile_id: &str,
contract_id: &str,
allow_digests: &[String],
review_mode: Option<&str>,
contract: Option<BTreeMap<String, Value>>,
) -> Result<AuthCreateWorkloadProfileResponseProfile, TrellisAuthError>
pub async fn create_workload_profile( &self, profile_id: &str, contract_id: &str, allow_digests: &[String], review_mode: Option<&str>, contract: Option<BTreeMap<String, Value>>, ) -> Result<AuthCreateWorkloadProfileResponseProfile, TrellisAuthError>
Create a workload profile.
Sourcepub async fn disable_workload_profile(
&self,
profile_id: &str,
) -> Result<bool, TrellisAuthError>
pub async fn disable_workload_profile( &self, profile_id: &str, ) -> Result<bool, TrellisAuthError>
Disable a workload profile.
Sourcepub async fn provision_workload_instance(
&self,
profile_id: &str,
public_identity_key: &str,
activation_key: &str,
) -> Result<AuthProvisionWorkloadInstanceResponseInstance, TrellisAuthError>
pub async fn provision_workload_instance( &self, profile_id: &str, public_identity_key: &str, activation_key: &str, ) -> Result<AuthProvisionWorkloadInstanceResponseInstance, TrellisAuthError>
Provision a workload instance.
Sourcepub async fn get_workload_activation_status(
&self,
handoff_id: &str,
) -> Result<AuthGetWorkloadActivationStatusResponse, TrellisAuthError>
pub async fn get_workload_activation_status( &self, handoff_id: &str, ) -> Result<AuthGetWorkloadActivationStatusResponse, TrellisAuthError>
Get workload activation status for one handoff.
Sourcepub async fn list_workload_instances(
&self,
profile_id: Option<&str>,
state: Option<&str>,
) -> Result<Vec<AuthListWorkloadInstancesResponseInstancesItem>, TrellisAuthError>
pub async fn list_workload_instances( &self, profile_id: Option<&str>, state: Option<&str>, ) -> Result<Vec<AuthListWorkloadInstancesResponseInstancesItem>, TrellisAuthError>
List workload instances.
Sourcepub async fn disable_workload_instance(
&self,
instance_id: &str,
) -> Result<bool, TrellisAuthError>
pub async fn disable_workload_instance( &self, instance_id: &str, ) -> Result<bool, TrellisAuthError>
Disable a workload instance.
Sourcepub async fn list_workload_activations(
&self,
instance_id: Option<&str>,
profile_id: Option<&str>,
state: Option<&str>,
) -> Result<Vec<AuthListWorkloadActivationsResponseActivationsItem>, TrellisAuthError>
pub async fn list_workload_activations( &self, instance_id: Option<&str>, profile_id: Option<&str>, state: Option<&str>, ) -> Result<Vec<AuthListWorkloadActivationsResponseActivationsItem>, TrellisAuthError>
List workload activations.
Sourcepub async fn revoke_workload_activation(
&self,
instance_id: &str,
) -> Result<bool, TrellisAuthError>
pub async fn revoke_workload_activation( &self, instance_id: &str, ) -> Result<bool, TrellisAuthError>
Revoke a workload activation.
Sourcepub async fn list_workload_activation_reviews(
&self,
instance_id: Option<&str>,
profile_id: Option<&str>,
state: Option<&str>,
) -> Result<Vec<AuthListWorkloadActivationReviewsResponseReviewsItem>, TrellisAuthError>
pub async fn list_workload_activation_reviews( &self, instance_id: Option<&str>, profile_id: Option<&str>, state: Option<&str>, ) -> Result<Vec<AuthListWorkloadActivationReviewsResponseReviewsItem>, TrellisAuthError>
List workload activation reviews.
Sourcepub async fn decide_workload_activation_review(
&self,
review_id: &str,
decision: &str,
reason: Option<&str>,
) -> Result<AuthDecideWorkloadActivationReviewResponse, TrellisAuthError>
pub async fn decide_workload_activation_review( &self, review_id: &str, decision: &str, reason: Option<&str>, ) -> Result<AuthDecideWorkloadActivationReviewResponse, TrellisAuthError>
Decide one workload activation review.
Sourcepub async fn install_service(
&self,
input: &AuthInstallServiceRequest,
) -> Result<AuthInstallServiceResponse, TrellisAuthError>
pub async fn install_service( &self, input: &AuthInstallServiceRequest, ) -> Result<AuthInstallServiceResponse, TrellisAuthError>
Install one service contract remotely.
Sourcepub async fn upgrade_service_contract(
&self,
input: &AuthUpgradeServiceContractRequest,
) -> Result<AuthUpgradeServiceContractResponse, TrellisAuthError>
pub async fn upgrade_service_contract( &self, input: &AuthUpgradeServiceContractRequest, ) -> Result<AuthUpgradeServiceContractResponse, TrellisAuthError>
Upgrade one installed service contract remotely.
Sourcepub async fn get_installed_contract(
&self,
input: &AuthGetInstalledContractRequest,
) -> Result<AuthGetInstalledContractResponse, TrellisAuthError>
pub async fn get_installed_contract( &self, input: &AuthGetInstalledContractRequest, ) -> Result<AuthGetInstalledContractResponse, TrellisAuthError>
Fetch one installed contract by digest.
Sourcepub async fn validate_request(
&self,
input: &AuthValidateRequestRequest,
) -> Result<AuthValidateRequestResponse, TrellisAuthError>
pub async fn validate_request( &self, input: &AuthValidateRequestRequest, ) -> Result<AuthValidateRequestResponse, TrellisAuthError>
Validate one request payload.
Sourcepub async fn list_services(
&self,
) -> Result<Vec<ServiceListEntry>, TrellisAuthError>
pub async fn list_services( &self, ) -> Result<Vec<ServiceListEntry>, TrellisAuthError>
List installed services.
Sourcepub async fn logout(&self) -> Result<bool, TrellisAuthError>
pub async fn logout(&self) -> Result<bool, TrellisAuthError>
Log out the current admin session remotely.
Sourcepub async fn renew_binding_token(
&self,
state: &mut AdminSessionState,
) -> Result<(), TrellisAuthError>
pub async fn renew_binding_token( &self, state: &mut AdminSessionState, ) -> Result<(), TrellisAuthError>
Mint and persist a fresh binding token for the current session.