#[non_exhaustive]pub struct PolicyModule {
pub applies_to: Option<Vec<String>>,
pub created_at: DateTime<Utc>,
pub description: Option<PolicyModuleDescription>,
pub enabled: bool,
pub ext: Option<Ext>,
pub id: PolicyModuleId,
pub module: PolicyModuleModule,
pub name: PolicyModuleName,
pub priority: Option<i64>,
pub updated_at: DateTime<Utc>,
pub version: u64,
}Available on crate feature
policy only.Expand description
PolicyModule
JSON schema
{
"title": "PolicyModule",
"type": "object",
"required": [
"createdAt",
"id",
"module",
"name",
"updatedAt",
"version"
],
"properties": {
"appliesTo": {
"description": "List of trust contexts this policy applies to. Empty array = applies to all contexts (the default policy).",
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"description": {
"type": "string",
"maxLength": 1024
},
"enabled": {
"default": true,
"type": "boolean"
},
"ext": {
"$ref": "#/definitions/Ext"
},
"id": {
"type": "string",
"minLength": 1
},
"module": {
"description": "Rego source code. The maintainer's evaluator entry point is the package's `decision` rule, returning a PolicyDecision.",
"type": "string",
"minLength": 1
},
"name": {
"description": "Human-readable name (e.g. \"default vault policy\", \"bank-site step-up\").",
"type": "string",
"maxLength": 128,
"minLength": 1
},
"priority": {
"description": "When multiple policies match a request, evaluation order is by priority descending. The first to return a non-`null` decision wins.",
"type": "integer",
"maximum": 1000.0,
"minimum": 0.0
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"version": {
"type": "integer",
"minimum": 0.0
}
},
"additionalProperties": false
}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.applies_to: Option<Vec<String>>List of trust contexts this policy applies to. Empty array = applies to all contexts (the default policy).
created_at: DateTime<Utc>§description: Option<PolicyModuleDescription>§enabled: bool§ext: Option<Ext>§id: PolicyModuleId§module: PolicyModuleModuleRego source code. The maintainer’s evaluator entry point is the package’s decision rule, returning a PolicyDecision.
name: PolicyModuleNameHuman-readable name (e.g. “default vault policy”, “bank-site step-up”).
priority: Option<i64>When multiple policies match a request, evaluation order is by priority descending. The first to return a non-null decision wins.
updated_at: DateTime<Utc>§version: u64Implementations§
Source§impl PolicyModule
impl PolicyModule
pub fn builder() -> PolicyModule
Trait Implementations§
Source§impl Clone for PolicyModule
impl Clone for PolicyModule
Source§fn clone(&self) -> PolicyModule
fn clone(&self) -> PolicyModule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolicyModule
impl Debug for PolicyModule
Source§impl<'de> Deserialize<'de> for PolicyModule
impl<'de> Deserialize<'de> for PolicyModule
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PolicyModule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PolicyModule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<PolicyModule> for PolicyModule
impl From<PolicyModule> for PolicyModule
Source§fn from(value: PolicyModule) -> PolicyModule
fn from(value: PolicyModule) -> PolicyModule
Converts to this type from the input type.
Source§impl Serialize for PolicyModule
impl Serialize for PolicyModule
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<PolicyModule> for PolicyModule
impl TryFrom<PolicyModule> for PolicyModule
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: PolicyModule) -> Result<PolicyModule, ConversionError>
fn try_from(value: PolicyModule) -> Result<PolicyModule, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for PolicyModule
impl RefUnwindSafe for PolicyModule
impl Send for PolicyModule
impl Sync for PolicyModule
impl Unpin for PolicyModule
impl UnsafeUnpin for PolicyModule
impl UnwindSafe for PolicyModule
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
fn deserialize_typed<S>(
_: &C,
deserializer: S,
) -> Result<T, <S as Deserializer<'de>>::Error>where
S: Deserializer<'de>,
impl<T, U> DeserializeTypedOwned<T> for Uwhere
U: for<'de> DeserializeTyped<'de, T>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§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> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
Returns a reference to the resource of type
T.