-
Notifications
You must be signed in to change notification settings - Fork 99
feat: Add CAWG validation to Reader
#1370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 25 commits
41d19ae
ac8acc1
61c2ced
adc1715
650d954
d8c04e3
faf671b
0f90e21
5270494
c7928b8
ccb6038
25d029f
c87e7f5
aeab1bc
13523aa
a612b45
ad03081
1d4b79f
909ba26
5178230
c9df434
4622847
316091e
0ab0e53
33aab39
c51180b
8bebd11
bbebf93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,14 +71,15 @@ pub struct IdentityAssertion { | |
pub(crate) label: Option<String>, | ||
} | ||
|
||
#[allow(unused)] // TEMPORARY while considering API simplification | ||
impl IdentityAssertion { | ||
/// Find the `IdentityAssertion`s that may be present in a given | ||
/// [`Manifest`]. | ||
/// | ||
/// Iterator returns a [`Result`] because each assertion may fail to parse. | ||
/// | ||
/// Aside from CBOR parsing, no further validation is performed. | ||
pub fn from_manifest<'a>( | ||
pub(crate) fn from_manifest<'a>( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From my point of view the access changes are OK. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the fields of IdentityAssertion above be public, or can I have a more general constructor? I redefine it in the Node SDK, which is not a good practice. |
||
manifest: &'a Manifest, | ||
status_tracker: &'a mut StatusTracker, | ||
) -> impl Iterator<Item = Result<Self, crate::Error>> + use<'a> { | ||
|
@@ -93,6 +94,11 @@ impl IdentityAssertion { | |
ia.label = Some(to_assertion_uri(manifest_label, a.label())); | ||
} | ||
} | ||
// TO DO: Add error readout if the proposed new setting resulted | ||
// in this assertion being parsed and converted to JSON. This function | ||
// has become incompatible with the now-default behavior to validate | ||
// identity assertions during parsing. This applies only if this API | ||
// becomes public again. | ||
(a.label().to_owned(), ia) | ||
}) | ||
.inspect(|(label, r)| { | ||
|
@@ -120,7 +126,7 @@ impl IdentityAssertion { | |
/// of the identity assertion. | ||
/// | ||
/// [`validate`]: Self::validate | ||
pub async fn to_summary<SV: SignatureVerifier>( | ||
pub(crate) async fn to_summary<SV: SignatureVerifier>( | ||
&self, | ||
manifest: &Manifest, | ||
status_tracker: &mut StatusTracker, | ||
|
@@ -161,7 +167,7 @@ impl IdentityAssertion { | |
} | ||
|
||
/// Summarize all of the identity assertions found for a [`Manifest`]. | ||
pub async fn summarize_all<SV: SignatureVerifier>( | ||
pub(crate) async fn summarize_all<SV: SignatureVerifier>( | ||
manifest: &Manifest, | ||
status_tracker: &mut StatusTracker, | ||
verifier: &SV, | ||
|
@@ -210,7 +216,7 @@ impl IdentityAssertion { | |
} | ||
|
||
/// Summarize all of the identity assertions found for a [`Reader`]. | ||
pub async fn summarize_from_reader<SV: SignatureVerifier>( | ||
pub(crate) async fn summarize_from_reader<SV: SignatureVerifier>( | ||
reader: &Reader, | ||
status_tracker: &mut StatusTracker, | ||
verifier: &SV, | ||
|
@@ -243,7 +249,7 @@ impl IdentityAssertion { | |
/// be derived from the signature. This is the [`SignatureVerifier::Output`] | ||
/// type which typically describes the named actor, but may also contain | ||
/// information about the time of signing or the credential's source. | ||
pub async fn validate<SV: SignatureVerifier>( | ||
pub(crate) async fn validate<SV: SignatureVerifier>( | ||
&self, | ||
manifest: &Manifest, | ||
status_tracker: &mut StatusTracker, | ||
|
@@ -285,7 +291,7 @@ impl IdentityAssertion { | |
/// be derived from the signature. This is the [`SignatureVerifier::Output`] | ||
/// type which typically describes the named actor, but may also contain | ||
/// information about the time of signing or the credential's source. | ||
pub async fn validate_partial_claim( | ||
pub(crate) async fn validate_partial_claim( | ||
&self, | ||
partial_claim: &PartialClaim, | ||
status_tracker: &mut StatusTracker, | ||
|
Uh oh!
There was an error while loading. Please reload this page.