Struct MarkingServiceClient

Source
pub struct MarkingServiceClient<T> { /* private fields */ }
Expand description

This service manages Markings, which are a mechanism to restrict access to data sources.

Implementations§

Source§

impl MarkingServiceClient<Channel>

Source

pub async fn connect<D>(dst: D) -> Result<Self, Error>
where D: TryInto<Endpoint>, D::Error: Into<StdError>,

Attempt to create a new client by connecting to a given endpoint.

Source§

impl<T> MarkingServiceClient<T>
where T: GrpcService<Body>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,

Source

pub fn new(inner: T) -> Self

Source

pub fn with_origin(inner: T, origin: Uri) -> Self

Source

pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> MarkingServiceClient<InterceptedService<T, F>>
where F: Interceptor, T::ResponseBody: Default, T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>, <T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,

Source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

Source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

Source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

Source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

Source

pub async fn create_marking( &mut self, request: impl IntoRequest<CreateMarkingRequest>, ) -> Result<Response<CreateMarkingResponse>, Status>

Creates a marking. Throws HTTP 409 / gRPC 6 if a marking with the same ID already exists. Throws HTTP 403 / gRPC 7 if the user does not have permission to create a marking. Throws HTTP 403 / gRPC 7 if the user does not have permission to read some of the specified groups.

Source

pub async fn get_marking( &mut self, request: impl IntoRequest<GetMarkingRequest>, ) -> Result<Response<GetMarkingResponse>, Status>

Gets a marking by its RID. Throws HTTP 403 / gRPC 7 if the user does not have permission to read the marking. Throws HTTP 403 / gRPC 5 if the marking is not found.

Source

pub async fn get_marking_by_id( &mut self, request: impl IntoRequest<GetMarkingByIdRequest>, ) -> Result<Response<GetMarkingByIdResponse>, Status>

Gets a marking by its ID, a human-readable identifier unique within the org. Throws HTTP 403 / gRPC 7 if the user does not have permission to read the marking. Throws HTTP 403 / gRPC 5 if the marking is not found.

Source

pub async fn batch_get_markings( &mut self, request: impl IntoRequest<BatchGetMarkingsRequest>, ) -> Result<Response<BatchGetMarkingsResponse>, Status>

Gets multiple markings by RID. If a marking is not found or the user doesn’t have permission to read it, it will not be included in the response.

Source

pub async fn batch_get_marking_metadata( &mut self, request: impl IntoRequest<BatchGetMarkingMetadataRequest>, ) -> Result<Response<BatchGetMarkingMetadataResponse>, Status>

Gets metadata for multiple markings by RID. Metadata does not include the authorized groups. If a marking is not found or the user doesn’t have permission to read it, it will not be included in the response.

Source

pub async fn get_authorized_groups_by_marking( &mut self, request: impl IntoRequest<GetAuthorizedGroupsByMarkingRequest>, ) -> Result<Response<GetAuthorizedGroupsByMarkingResponse>, Status>

Gets the authorized Groups for each of a set of Markings. Markings that are not found or for which the user does not have permission to read will be filtered from the response. Groups for which the user does not have permission to read will be filtered from the response.

Source

pub async fn search_markings( &mut self, request: impl IntoRequest<SearchMarkingsRequest>, ) -> Result<Response<SearchMarkingsResponse>, Status>

Search Markings, returning paged results. Throws HTTP 400 / gRPC 3 if the query is incorrectly formed.

Source

pub async fn update_marking( &mut self, request: impl IntoRequest<UpdateMarkingRequest>, ) -> Result<Response<UpdateMarkingResponse>, Status>

Updates a marking. Throws HTTP 403 / gRPC 7 if the user does not have permission to update the marking. Throws HTTP 403 / gRPC 7 if the user does not have permission to read any of the specified groups. Throws HTTP 403 / gRPC 5 if the marking is not found. Throws HTTP 409 / gRPC 6 if trying to update the ID of a marking to an ID that already exists. Throws HTTP 400 / gRPC 3 if trying to update an archived marking.

Source

pub async fn archive_markings( &mut self, request: impl IntoRequest<ArchiveMarkingsRequest>, ) -> Result<Response<ArchiveMarkingsResponse>, Status>

Archives markings. Archiving a marking is an idempotent operation that prevents further changes or applications of the marking. Archived markings will not appear in search but can be retrieved by get endpoints. Throws HTTP 403 / gRPC 7 if the user does not have permission to archive one or more of the markings or if any of the markings are not found. Throws HTTP 400 / gRPC 3 if the archived marking is currently applied to one or more resources. TODO(MGMT-489): this will throw 403 if any of the Markings don’t exist, but we should throw 404 instead.

Source

pub async fn unarchive_markings( &mut self, request: impl IntoRequest<UnarchiveMarkingsRequest>, ) -> Result<Response<UnarchiveMarkingsResponse>, Status>

Unarchives markings. Restores ability to apply and modify marking. Throws HTTP 403 / gRPC 7 if the user does not have permission to unarchive one or more of the markings or if any of the markings are not found. TODO(MGMT-489): this will throw 403 if any of the Markings don’t exist, but we should throw 404 instead.

Source

pub async fn update_markings_on_resource( &mut self, request: impl IntoRequest<UpdateMarkingsOnResourceRequest>, ) -> Result<Response<UpdateMarkingsOnResourceResponse>, Status>

Update the markings that are applied on a resource. Supports applying and removing markings at once. This endpoint can be used to atomically replace the markings on a resource, or bulk apply/remove markings. This operation is idempotent and will not throw an error if the marking is already applied/removed on the resource. If a resource marking pair is present in both markings_to_apply and markings_to_remove, this will throw. Throws HTTP 403 / gRPC 7 if the user does not have permission to change the markings on the resource. Throws HTTP 400 / gRPC 3 if trying to apply an archived marking.

Source

pub async fn get_resources_for_marking( &mut self, request: impl IntoRequest<GetResourcesForMarkingRequest>, ) -> Result<Response<GetResourcesForMarkingResponse>, Status>

Gets the resources that a Marking is applied to. This endpoint is paginated. Any unauthorized resources will be filtered from the response. Throws HTTP 403 / gRPC 7 if the user does not have permission to read the marking.

Source

pub async fn get_markings_for_resources( &mut self, request: impl IntoRequest<GetMarkingsForResourcesRequest>, ) -> Result<Response<GetMarkingsForResourcesResponse>, Status>

Gets the requested resources and the markings applied to them. Since the number of markings applied to a resource is typically small, this endpoint will return all markings for each resource. Any unauthorized resources or markings will be filtered from the response.

Trait Implementations§

Source§

impl<T: Clone> Clone for MarkingServiceClient<T>

Source§

fn clone(&self) -> MarkingServiceClient<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for MarkingServiceClient<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for MarkingServiceClient<T>

§

impl<T> RefUnwindSafe for MarkingServiceClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for MarkingServiceClient<T>
where T: Send,

§

impl<T> Sync for MarkingServiceClient<T>
where T: Sync,

§

impl<T> Unpin for MarkingServiceClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for MarkingServiceClient<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more