#[non_exhaustive]pub struct AuthzPolicy {
pub name: String,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub description: String,
pub labels: HashMap<String, String>,
pub target: Option<Target>,
pub http_rules: Vec<AuthzRule>,
pub action: AuthzAction,
pub custom_provider: Option<CustomProvider>,
pub policy_profile: PolicyProfile,
/* private fields */
}Expand description
AuthzPolicy is a resource that allows to forward traffic to a
callout backend designed to scan the traffic for security purposes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringRequired. Identifier. Name of the AuthzPolicy resource in the following
format:
projects/{project}/locations/{location}/authzPolicies/{authz_policy}.
create_time: Option<Timestamp>Output only. The timestamp when the resource was created.
update_time: Option<Timestamp>Output only. The timestamp when the resource was updated.
description: StringOptional. A human-readable description of the resource.
labels: HashMap<String, String>Optional. Set of labels associated with the AuthzPolicy resource.
The format must comply with the following requirements.
target: Option<Target>Required. Specifies the set of resources to which this policy should be applied to.
http_rules: Vec<AuthzRule>Optional. A list of authorization HTTP rules to match against the incoming request. A policy match occurs when at least one HTTP rule matches the request or when no HTTP rules are specified in the policy. At least one HTTP Rule is required for Allow or Deny Action. Limited to 5 rules.
action: AuthzActionRequired. Can be one of ALLOW, DENY, CUSTOM.
When the action is CUSTOM, customProvider must be specified.
When the action is ALLOW, only requests matching the policy will
be allowed.
When the action is DENY, only requests matching the policy will be
denied.
When a request arrives, the policies are evaluated in the following order:
-
If there is a
CUSTOMpolicy that matches the request, theCUSTOMpolicy is evaluated using the custom authorization providers and the request is denied if the provider rejects the request. -
If there are any
DENYpolicies that match the request, the request is denied. -
If there are no
ALLOWpolicies for the resource or if any of theALLOWpolicies match the request, the request is allowed. -
Else the request is denied by default if none of the configured AuthzPolicies with
ALLOWaction match the request.
custom_provider: Option<CustomProvider>Optional. Required if the action is CUSTOM. Allows delegating
authorization decisions to Cloud IAP or to Service Extensions. One of
cloudIap or authzExtension must be specified.
policy_profile: PolicyProfileOptional. Immutable. Defines the type of authorization being performed.
If not specified, REQUEST_AUTHZ is applied. This field cannot be changed
once AuthzPolicy is created.
Implementations§
Source§impl AuthzPolicy
impl AuthzPolicy
pub fn new() -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = AuthzPolicy::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = AuthzPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = AuthzPolicy::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = AuthzPolicy::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = AuthzPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = AuthzPolicy::new().set_or_clear_update_time(None::<Timestamp>);Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_target<T>(self, v: T) -> Self
pub fn set_target<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_target<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_target<T>(self, v: Option<T>) -> Self
Sourcepub fn set_http_rules<T, V>(self, v: T) -> Self
pub fn set_http_rules<T, V>(self, v: T) -> Self
Sets the value of http_rules.
§Example
use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
let x = AuthzPolicy::new()
.set_http_rules([
AuthzRule::default()/* use setters */,
AuthzRule::default()/* use (different) setters */,
]);Sourcepub fn set_action<T: Into<AuthzAction>>(self, v: T) -> Self
pub fn set_action<T: Into<AuthzAction>>(self, v: T) -> Self
Sourcepub fn set_custom_provider<T>(self, v: T) -> Selfwhere
T: Into<CustomProvider>,
pub fn set_custom_provider<T>(self, v: T) -> Selfwhere
T: Into<CustomProvider>,
Sets the value of custom_provider.
§Example
use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
let x = AuthzPolicy::new().set_custom_provider(CustomProvider::default()/* use setters */);Sourcepub fn set_or_clear_custom_provider<T>(self, v: Option<T>) -> Selfwhere
T: Into<CustomProvider>,
pub fn set_or_clear_custom_provider<T>(self, v: Option<T>) -> Selfwhere
T: Into<CustomProvider>,
Sets or clears the value of custom_provider.
§Example
use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
let x = AuthzPolicy::new().set_or_clear_custom_provider(Some(CustomProvider::default()/* use setters */));
let x = AuthzPolicy::new().set_or_clear_custom_provider(None::<CustomProvider>);Sourcepub fn set_policy_profile<T: Into<PolicyProfile>>(self, v: T) -> Self
pub fn set_policy_profile<T: Into<PolicyProfile>>(self, v: T) -> Self
Sets the value of policy_profile.
§Example
use google_cloud_networksecurity_v1::model::authz_policy::PolicyProfile;
let x0 = AuthzPolicy::new().set_policy_profile(PolicyProfile::RequestAuthz);
let x1 = AuthzPolicy::new().set_policy_profile(PolicyProfile::ContentAuthz);Trait Implementations§
Source§impl Clone for AuthzPolicy
impl Clone for AuthzPolicy
Source§fn clone(&self) -> AuthzPolicy
fn clone(&self) -> AuthzPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more