pub struct TargetSystemsClient {
pub(crate) key_store: KeyStore<KeySlotIds>,
pub(crate) api_configurations: Arc<ApiConfigurations>,
}Expand description
Client for PAM rotation target-system operations.
Fields§
§key_store: KeyStore<KeySlotIds>§api_configurations: Arc<ApiConfigurations>Implementations§
Source§impl TargetSystemsClient
impl TargetSystemsClient
Sourcepub async fn list(
&self,
organization_id: OrganizationId,
) -> Result<Vec<TargetSystemView>, RotationError>
pub async fn list( &self, organization_id: OrganizationId, ) -> Result<Vec<TargetSystemView>, RotationError>
Lists the organization’s target systems.
Sourcepub async fn create(
&self,
organization_id: OrganizationId,
request: TargetSystemCreateRequest,
) -> Result<TargetSystemView, TargetSystemCreateError>
pub async fn create( &self, organization_id: OrganizationId, request: TargetSystemCreateRequest, ) -> Result<TargetSystemView, TargetSystemCreateError>
Registers a target system with a POST, leaving it
PendingSeal, then seals its blob under the new ID and
PUTs it. If the second phase fails the row stays PendingSeal; retry via
Self::update with the same request, or Self::delete it.
Sourceasync fn register(
&self,
organization_id: OrganizationId,
prepared: &PreparedTargetSystem,
) -> Result<(TargetSystemId, PamTargetSystemResponseModel), RotationError>
async fn register( &self, organization_id: OrganizationId, prepared: &PreparedTargetSystem, ) -> Result<(TargetSystemId, PamTargetSystemResponseModel), RotationError>
Phase 1 of Self::create. Takes only a prepared target, so the POST can’t run for a
request phase 2 can’t seal.
Sourcefn require_organization_key(
&self,
organization_id: OrganizationId,
) -> Result<(), RotationError>
fn require_organization_key( &self, organization_id: OrganizationId, ) -> Result<(), RotationError>
Runs before the phase-1 POST; put_sealed keeps its own check because it needs the key
in its own context.
Sourceasync fn seal_and_finish(
&self,
organization_id: OrganizationId,
id: TargetSystemId,
phase_one: &PamTargetSystemResponseModel,
prepared: &PreparedTargetSystem,
request: &TargetSystemCreateRequest,
) -> Result<TargetSystemView, RotationError>
async fn seal_and_finish( &self, organization_id: OrganizationId, id: TargetSystemId, phase_one: &PamTargetSystemResponseModel, prepared: &PreparedTargetSystem, request: &TargetSystemCreateRequest, ) -> Result<TargetSystemView, RotationError>
Phase 2 of Self::create. The PUT returns no content, so revision_date is the
phase-1 value.
Sourcepub async fn update(
&self,
organization_id: OrganizationId,
id: TargetSystemId,
request: TargetSystemCreateRequest,
) -> Result<(), RotationError>
pub async fn update( &self, organization_id: OrganizationId, id: TargetSystemId, request: TargetSystemCreateRequest, ) -> Result<(), RotationError>
Re-seals the whole blob, so every field must be resupplied. Also how a
PendingSeal row left by a failed Self::create
becomes Active.
Rejects a method change, and a kind change when the existing blob is verified.
Sourceasync fn existing(
&self,
organization_id: OrganizationId,
id: TargetSystemId,
) -> Result<TargetSystemView, RotationError>
async fn existing( &self, organization_id: OrganizationId, id: TargetSystemId, ) -> Result<TargetSystemView, RotationError>
There is no single-target GET, so this lists and converts only id’s row.
Sourceasync fn put_sealed(
&self,
organization_id: OrganizationId,
id: TargetSystemId,
prepared: &PreparedTargetSystem,
) -> Result<(), RotationError>
async fn put_sealed( &self, organization_id: OrganizationId, id: TargetSystemId, prepared: &PreparedTargetSystem, ) -> Result<(), RotationError>
Seals prepared under id and PUTs it.
Sourcepub async fn enable(
&self,
organization_id: OrganizationId,
id: TargetSystemId,
) -> Result<(), RotationError>
pub async fn enable( &self, organization_id: OrganizationId, id: TargetSystemId, ) -> Result<(), RotationError>
Puts a disabled target system back into service; new rotation jobs dispatch for it again.
Sourcepub async fn disable(
&self,
organization_id: OrganizationId,
id: TargetSystemId,
) -> Result<(), RotationError>
pub async fn disable( &self, organization_id: OrganizationId, id: TargetSystemId, ) -> Result<(), RotationError>
Stops new rotation jobs being dispatched for a target system. Jobs already in flight run to completion.
Sourcepub async fn delete(
&self,
organization_id: OrganizationId,
id: TargetSystemId,
) -> Result<(), RotationError>
pub async fn delete( &self, organization_id: OrganizationId, id: TargetSystemId, ) -> Result<(), RotationError>
Permanently deletes a target system. The server refuses while any rotation config still
names the target; delete those configs first, or disable
a target that is only unavailable.
Trait Implementations§
Source§impl From<TargetSystemsClient> for JsValue
impl From<TargetSystemsClient> for JsValue
Source§fn from(value: TargetSystemsClient) -> Self
fn from(value: TargetSystemsClient) -> Self
Source§impl FromClient for TargetSystemsClient
impl FromClient for TargetSystemsClient
Source§fn from_client(client: &Client) -> Self
fn from_client(client: &Client) -> Self
Client] reference.Source§impl FromWasmAbi for TargetSystemsClient
impl FromWasmAbi for TargetSystemsClient
Source§impl IntoWasmAbi for TargetSystemsClient
impl IntoWasmAbi for TargetSystemsClient
Source§impl RefFromWasmAbi for TargetSystemsClient
impl RefFromWasmAbi for TargetSystemsClient
Source§type Anchor = RcRef<TargetSystemsClient>
type Anchor = RcRef<TargetSystemsClient>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.impl SupportsConstructor for TargetSystemsClient
impl SupportsInstanceProperty for TargetSystemsClient
impl SupportsStaticProperty for TargetSystemsClient
Source§impl TryFromJsValue for TargetSystemsClient
impl TryFromJsValue for TargetSystemsClient
Source§impl VectorFromWasmAbi for TargetSystemsClient
impl VectorFromWasmAbi for TargetSystemsClient
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[TargetSystemsClient]>
Source§impl VectorIntoWasmAbi for TargetSystemsClient
impl VectorIntoWasmAbi for TargetSystemsClient
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[TargetSystemsClient]>) -> Self::Abi
Source§impl WasmDescribe for TargetSystemsClient
impl WasmDescribe for TargetSystemsClient
Auto Trait Implementations§
impl !RefUnwindSafe for TargetSystemsClient
impl !UnwindSafe for TargetSystemsClient
impl Freeze for TargetSystemsClient
impl Send for TargetSystemsClient
impl Sync for TargetSystemsClient
impl Unpin for TargetSystemsClient
impl UnsafeUnpin for TargetSystemsClient
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.