pub struct RequestItem {
pub identifier: String,
pub issuer_schema_id: u64,
pub signal: Option<String>,
pub genesis_issued_at_min: Option<u64>,
pub expires_at_min: Option<u64>,
}Expand description
Per-credential request payload.
Fields§
§identifier: StringAn RP-defined identifier for this request item used to match against constraints and responses.
Example: orb, document.
issuer_schema_id: u64Unique identifier for the credential schema and issuer pair.
Registered in the CredentialSchemaIssuerRegistry.
signal: Option<String>Arbitrary data provided by the RP that gets cryptographically bound into the proof.
When present, the Authenticator hashes this via signal_hash and commits it into the
proof circuit so the RP can tie the proof to a particular context.
genesis_issued_at_min: Option<u64>Minimum genesis_issued_at timestamp that the used Credential must meet.
If present, the proof will include a constraint that the credential’s genesis issued at timestamp is greater than or equal to this value. Can be set to 0 to skip. This is useful for migration from previous protocol versions.
expires_at_min: Option<u64>The minimum expiration required for the Credential used in the proof.
If the constraint is not required, it should use the current time as the minimum expiration. The Authenticator will normally expose the effective input used in the proof.
This is particularly useful to specify a minimum duration for a Credential proportional to the action being performed. For example, when claiming a benefit that is once every 6 months, the minimum duration can be set to 180 days to prevent double claiming in that period in case the Credential is set to expire earlier.
It is an RP’s responsibility to understand the issuer’s policies regarding expiration to ensure the request can be fulfilled.
If not provided, this will default to the ProofRequest::created_at attribute.
Implementations§
Source§impl RequestItem
impl RequestItem
Sourcepub const fn new(
identifier: String,
issuer_schema_id: u64,
signal: Option<String>,
genesis_issued_at_min: Option<u64>,
expires_at_min: Option<u64>,
) -> Self
pub const fn new( identifier: String, issuer_schema_id: u64, signal: Option<String>, genesis_issued_at_min: Option<u64>, expires_at_min: Option<u64>, ) -> Self
Create a new request item with the given identifier, issuer schema ID and optional signal.
Sourcepub fn signal_hash(&self) -> FieldElement
pub fn signal_hash(&self) -> FieldElement
Get the signal hash for the request item.
Sourcepub const fn effective_expires_at_min(&self, request_created_at: u64) -> u64
pub const fn effective_expires_at_min(&self, request_created_at: u64) -> u64
Get the effective minimum expiration timestamp for this request item.
If expires_at_min is Some, returns that value.
Otherwise, returns the request_created_at value (which should be the ProofRequest::created_at timestamp).
Trait Implementations§
Source§impl Clone for RequestItem
impl Clone for RequestItem
Source§fn clone(&self) -> RequestItem
fn clone(&self) -> RequestItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RequestItem
impl Debug for RequestItem
Source§impl<'de> Deserialize<'de> for RequestItem
impl<'de> Deserialize<'de> for RequestItem
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>,
Source§impl PartialEq for RequestItem
impl PartialEq for RequestItem
Source§impl Serialize for RequestItem
impl Serialize for RequestItem
impl Eq for RequestItem
impl StructuralPartialEq for RequestItem
Auto Trait Implementations§
impl Freeze for RequestItem
impl RefUnwindSafe for RequestItem
impl Send for RequestItem
impl Sync for RequestItem
impl Unpin for RequestItem
impl UnsafeUnpin for RequestItem
impl UnwindSafe for RequestItem
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
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§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more