pub struct PackContext {Show 15 fields
pub id: String,
pub has_template_defaults: bool,
pub has_inferred_capabilities: bool,
pub has_signed_receipts: bool,
pub runtime: Option<String>,
pub is_regulated_environment: bool,
pub uses_public_registry: bool,
pub trust_tier: TrustTier,
pub ownership_classes: Vec<OwnershipClass>,
pub is_allowlisted: bool,
pub has_signature_verification: bool,
pub uses_semver: bool,
pub is_version_downgrade: bool,
pub has_composition_receipt: bool,
pub has_provenance_tracking: bool,
}Expand description
Pack context for policy enforcement.
Fields§
§id: StringPack identifier.
has_template_defaults: boolWhether pack uses template defaults.
has_inferred_capabilities: boolWhether pack has inferred capabilities.
has_signed_receipts: boolWhether pack has signed receipts.
runtime: Option<String>Runtime type (if specified).
is_regulated_environment: boolWhether environment is regulated.
uses_public_registry: boolWhether pack uses public registry.
trust_tier: TrustTierPack trust tier.
ownership_classes: Vec<OwnershipClass>Ownership classes used by pack.
is_allowlisted: boolWhether pack is allowlisted.
has_signature_verification: boolWhether pack has signature verification.
uses_semver: boolWhether pack uses semantic versioning.
is_version_downgrade: boolWhether this is a version downgrade.
has_composition_receipt: boolWhether pack has composition receipt.
has_provenance_tracking: boolWhether pack has provenance tracking.
Implementations§
Source§impl PackContext
impl PackContext
Sourcepub fn new(id: String) -> PackContext
pub fn new(id: String) -> PackContext
Create a new pack context.
Sourcepub fn with_template_defaults(self, value: bool) -> PackContext
pub fn with_template_defaults(self, value: bool) -> PackContext
Set whether pack uses template defaults.
Sourcepub fn with_inferred_capabilities(self, value: bool) -> PackContext
pub fn with_inferred_capabilities(self, value: bool) -> PackContext
Set whether pack has inferred capabilities.
Sourcepub fn with_signed_receipts(self, value: bool) -> PackContext
pub fn with_signed_receipts(self, value: bool) -> PackContext
Set whether pack has signed receipts.
Sourcepub fn with_runtime(self, runtime: Option<String>) -> PackContext
pub fn with_runtime(self, runtime: Option<String>) -> PackContext
Set runtime type.
Sourcepub fn with_regulated_environment(self, value: bool) -> PackContext
pub fn with_regulated_environment(self, value: bool) -> PackContext
Set whether environment is regulated.
Sourcepub fn with_public_registry(self, value: bool) -> PackContext
pub fn with_public_registry(self, value: bool) -> PackContext
Set whether pack uses public registry.
Sourcepub fn with_trust_tier(self, tier: TrustTier) -> PackContext
pub fn with_trust_tier(self, tier: TrustTier) -> PackContext
Set trust tier.
Sourcepub fn with_ownership_class(self, class: OwnershipClass) -> PackContext
pub fn with_ownership_class(self, class: OwnershipClass) -> PackContext
Add ownership class.
Sourcepub fn with_allowlisted(self, value: bool) -> PackContext
pub fn with_allowlisted(self, value: bool) -> PackContext
Set whether pack is allowlisted.
Sourcepub fn with_signature_verification(self, value: bool) -> PackContext
pub fn with_signature_verification(self, value: bool) -> PackContext
Set whether pack has signature verification.
Sourcepub fn with_semver(self, value: bool) -> PackContext
pub fn with_semver(self, value: bool) -> PackContext
Set whether pack uses semantic versioning.
Sourcepub fn with_version_downgrade(self, value: bool) -> PackContext
pub fn with_version_downgrade(self, value: bool) -> PackContext
Set whether this is a version downgrade.
Sourcepub fn with_composition_receipt(self, value: bool) -> PackContext
pub fn with_composition_receipt(self, value: bool) -> PackContext
Set whether pack has composition receipt.
Sourcepub fn with_provenance_tracking(self, value: bool) -> PackContext
pub fn with_provenance_tracking(self, value: bool) -> PackContext
Set whether pack has provenance tracking.
Trait Implementations§
Source§impl Clone for PackContext
impl Clone for PackContext
Source§fn clone(&self) -> PackContext
fn clone(&self) -> PackContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PackContext
impl Debug for PackContext
impl Eq for PackContext
Source§impl PartialEq for PackContext
impl PartialEq for PackContext
Source§fn eq(&self, other: &PackContext) -> bool
fn eq(&self, other: &PackContext) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PackContext
Auto Trait Implementations§
impl Freeze for PackContext
impl RefUnwindSafe for PackContext
impl Send for PackContext
impl Sync for PackContext
impl Unpin for PackContext
impl UnsafeUnpin for PackContext
impl UnwindSafe for PackContext
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> EvidenceKind for T
impl<T> EvidenceKind for T
default fn kind_label(&self) -> &'static str
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> ⓘ
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> ⓘ
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 moreSource§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>
T in a tonic::Request