Access

Struct Access 

Source
#[non_exhaustive]
pub struct Access { pub principal_email: String, pub caller_ip: String, pub caller_ip_geo: Option<Geolocation>, pub user_agent_family: String, pub user_agent: String, pub service_name: String, pub method_name: String, pub principal_subject: String, pub service_account_key_name: String, pub service_account_delegation_info: Vec<ServiceAccountDelegationInfo>, pub user_name: String, /* private fields */ }
Expand description

Represents an access event.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§principal_email: String

Associated email, such as “foo@google.com”.

The email address of the authenticated user or a service account acting on behalf of a third party principal making the request. For third party identity callers, the principal_subject field is populated instead of this field. For privacy reasons, the principal email address is sometimes redacted. For more information, see Caller identities in audit logs.

§caller_ip: String

Caller’s IP address, such as “1.1.1.1”.

§caller_ip_geo: Option<Geolocation>

The caller IP’s geolocation, which identifies where the call came from.

§user_agent_family: String

Type of user agent associated with the finding. For example, an operating system shell or an embedded or standalone application.

§user_agent: String

The caller’s user agent string associated with the finding.

§service_name: String

This is the API service that the service account made a call to, e.g. “iam.googleapis.com”

§method_name: String

The method that the service account called, e.g. “SetIamPolicy”.

§principal_subject: String

A string that represents the principal_subject that is associated with the identity. Unlike principal_email, principal_subject supports principals that aren’t associated with email addresses, such as third party principals. For most identities, the format is principal://iam.googleapis.com/{identity pool name}/subject/{subject}. Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD, still use the legacy format serviceAccount:{identity pool name}[{subject}].

§service_account_key_name: String

The name of the service account key that was used to create or exchange credentials when authenticating the service account that made the request. This is a scheme-less URI full resource name. For example:

“//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}”.

§service_account_delegation_info: Vec<ServiceAccountDelegationInfo>

The identity delegation history of an authenticated service account that made the request. The serviceAccountDelegationInfo[] object contains information about the real authorities that try to access Google Cloud resources by delegating on a service account. When multiple authorities are present, they are guaranteed to be sorted based on the original ordering of the identity delegation events.

§user_name: String

A string that represents a username. The username provided depends on the type of the finding and is likely not an IAM principal. For example, this can be a system username if the finding is related to a virtual machine, or it can be an application login username.

Implementations§

Source§

impl Access

Source

pub fn new() -> Self

Source

pub fn set_principal_email<T: Into<String>>(self, v: T) -> Self

Sets the value of principal_email.

§Example
let x = Access::new().set_principal_email("example");
Source

pub fn set_caller_ip<T: Into<String>>(self, v: T) -> Self

Sets the value of caller_ip.

§Example
let x = Access::new().set_caller_ip("example");
Source

pub fn set_caller_ip_geo<T>(self, v: T) -> Self
where T: Into<Geolocation>,

Sets the value of caller_ip_geo.

§Example
use google_cloud_securitycenter_v2::model::Geolocation;
let x = Access::new().set_caller_ip_geo(Geolocation::default()/* use setters */);
Source

pub fn set_or_clear_caller_ip_geo<T>(self, v: Option<T>) -> Self
where T: Into<Geolocation>,

Sets or clears the value of caller_ip_geo.

§Example
use google_cloud_securitycenter_v2::model::Geolocation;
let x = Access::new().set_or_clear_caller_ip_geo(Some(Geolocation::default()/* use setters */));
let x = Access::new().set_or_clear_caller_ip_geo(None::<Geolocation>);
Source

pub fn set_user_agent_family<T: Into<String>>(self, v: T) -> Self

Sets the value of user_agent_family.

§Example
let x = Access::new().set_user_agent_family("example");
Source

pub fn set_user_agent<T: Into<String>>(self, v: T) -> Self

Sets the value of user_agent.

§Example
let x = Access::new().set_user_agent("example");
Source

pub fn set_service_name<T: Into<String>>(self, v: T) -> Self

Sets the value of service_name.

§Example
let x = Access::new().set_service_name("example");
Source

pub fn set_method_name<T: Into<String>>(self, v: T) -> Self

Sets the value of method_name.

§Example
let x = Access::new().set_method_name("example");
Source

pub fn set_principal_subject<T: Into<String>>(self, v: T) -> Self

Sets the value of principal_subject.

§Example
let x = Access::new().set_principal_subject("example");
Source

pub fn set_service_account_key_name<T: Into<String>>(self, v: T) -> Self

Sets the value of service_account_key_name.

§Example
let x = Access::new().set_service_account_key_name("example");
Source

pub fn set_service_account_delegation_info<T, V>(self, v: T) -> Self

Sets the value of service_account_delegation_info.

§Example
use google_cloud_securitycenter_v2::model::ServiceAccountDelegationInfo;
let x = Access::new()
    .set_service_account_delegation_info([
        ServiceAccountDelegationInfo::default()/* use setters */,
        ServiceAccountDelegationInfo::default()/* use (different) setters */,
    ]);
Source

pub fn set_user_name<T: Into<String>>(self, v: T) -> Self

Sets the value of user_name.

§Example
let x = Access::new().set_user_name("example");

Trait Implementations§

Source§

impl Clone for Access

Source§

fn clone(&self) -> Access

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 Debug for Access

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Access

Source§

fn default() -> Access

Returns the “default value” for a type. Read more
Source§

impl Message for Access

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Access

Source§

fn eq(&self, other: &Access) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Access

Auto Trait Implementations§

§

impl Freeze for Access

§

impl RefUnwindSafe for Access

§

impl Send for Access

§

impl Sync for Access

§

impl Unpin for Access

§

impl UnwindSafe for Access

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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,