Struct warg_server::policy::record::AuthorizedKeyPolicy
source · pub struct AuthorizedKeyPolicy { /* private fields */ }Expand description
A policy that ensures a published record is signed by an authorized key.
Implementations§
source§impl AuthorizedKeyPolicy
impl AuthorizedKeyPolicy
sourcepub fn with_superuser_key(self, key: KeyID) -> Self
pub fn with_superuser_key(self, key: KeyID) -> Self
Sets an authorized key for publishing to any namespace.
sourcepub fn with_namespace_key(
self,
namespace: impl Into<String>,
key: KeyID
) -> Result<Self>
pub fn with_namespace_key( self, namespace: impl Into<String>, key: KeyID ) -> Result<Self>
Sets an authorized key for publishing to a particular namespace.
sourcepub fn with_namespace_delegation(
self,
namespace: impl Into<String>
) -> Result<Self>
pub fn with_namespace_delegation( self, namespace: impl Into<String> ) -> Result<Self>
Enables delegation for a particular namespace.
sourcepub fn with_package_key(
self,
package_name: impl Into<String>,
key: KeyID
) -> Result<Self>
pub fn with_package_key( self, package_name: impl Into<String>, key: KeyID ) -> Result<Self>
Sets an authorized key for publishing to a particular package.
sourcepub fn with_package_delegation(
self,
package_name: impl Into<String>
) -> Result<Self>
pub fn with_package_delegation( self, package_name: impl Into<String> ) -> Result<Self>
Enables delegation for a particular package.
Trait Implementations§
source§impl Default for AuthorizedKeyPolicy
impl Default for AuthorizedKeyPolicy
source§fn default() -> AuthorizedKeyPolicy
fn default() -> AuthorizedKeyPolicy
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for AuthorizedKeyPolicy
impl<'de> Deserialize<'de> for AuthorizedKeyPolicy
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 RecordPolicy for AuthorizedKeyPolicy
impl RecordPolicy for AuthorizedKeyPolicy
source§fn check(
&self,
name: &PackageName,
record: &ProtoEnvelope<PackageRecord>
) -> RecordPolicyResult<()>
fn check( &self, name: &PackageName, record: &ProtoEnvelope<PackageRecord> ) -> RecordPolicyResult<()>
Checks the record against the policy.
Auto Trait Implementations§
impl Freeze for AuthorizedKeyPolicy
impl RefUnwindSafe for AuthorizedKeyPolicy
impl Send for AuthorizedKeyPolicy
impl Sync for AuthorizedKeyPolicy
impl Unpin for AuthorizedKeyPolicy
impl UnwindSafe for AuthorizedKeyPolicy
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> 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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more