Struct diem_vault_client::Policy
source · pub struct Policy { /* private fields */ }
Expand description
This data structure is used to represent both policies read from Vault and written to Vault. Thus the same Policy read, can then be written back after amending. Vault stores the rules or per path policies in an encoded json blob, so that effectively means json within json, hence the unusual semantics below. { rules: json!{ path: { ‘auth/’: { capabilities: [‘create’, ‘read’, ‘update’, ‘delete’, ‘list’, ‘sudo’] }, ‘sys/auth/’: { capabilities: [‘create’, ‘read’, ‘update’, ‘delete’, ‘sudo’] }, } } } Note: Vault claims rules is deprecated and policy should be used instead, but that doesn’t seem to work and makes the reading asymmetrical from the writing.
Implementations§
source§impl Policy
impl Policy
pub fn new() -> Self
pub fn add_policy(&mut self, path: &str, capabilities: Vec<Capability>)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Policy
impl<'de> Deserialize<'de> for Policy
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Policy> for Policy
impl PartialEq<Policy> for Policy
impl Eq for Policy
impl StructuralEq for Policy
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.