-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: [SIW-402] Resolve trust chain #34
Conversation
// FIXME: SIW-422 require federation_metadata field | ||
// Actual RP implementation does not comply with the spec | ||
/* federation_entity: z.object({ | ||
organization_name: z.string(), | ||
homepage_uri: z.string(), | ||
policy_uri: z.string(), | ||
logo_uri: z.string(), | ||
contacts: z.array(z.string()), | ||
}), */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for rework but federation_entity
has been added!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 98ca656
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but I still don't see the update here
@@ -80,7 +90,7 @@ export default async () => { | |||
).then((t) => RP.getRequestObject(t, authRequestUrl, entity)); | |||
|
|||
// Attest Relying Party trust | |||
// TODO [SIW-354] | |||
await verifyTrustChain(trustAnchorEntity, requestObj.header.trust_chain); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about adding this check also into the SDK function (like getEntityConfiguration()
)making sure that the caller is not responsible for doing the checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting point. That is true for every trustable document we have (including PID, WIA, RequestObject, etc).
I think it's good, anyway I'd do it in another PR as it involves a sensible refactor of classes because:
- we must provide Trust Anchor data
- we must model better error to avoid to hide informations on error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep! Thanks you
const selectTokenShape = (elementIndex: number) => | ||
elementIndex === 0 | ||
? FirstElementShape | ||
: elementIndex === chain.length - 1 | ||
? LastElementShape | ||
: MiddleElementShape; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
src/trust/types.ts
Outdated
// Actual RP implementation does not comply with the spec | ||
/* federation_entity: z.object({ | ||
organization_name: z.string(), | ||
homepage_uri: z.string(), | ||
policy_uri: z.string(), | ||
logo_uri: z.string(), | ||
contacts: z.array(z.string()), | ||
}), */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RP added federation_entity
. You can uncomment this part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix test since code review fail!
e205909
to
98ca656
Compare
Please check again, I pushed something new
It is necessary to add (certainly with a separate PR) fast renewal for entity configurations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: grausof <[email protected]>
List of Changes
trust
folder for utilities related to the trust modelMotivation and Context
Documents shared with other parties (credentials, attestations, authz requests, etc) are signed and trusted according to https://italia.github.io/eudi-wallet-it-docs/v0.4.1/en/trust.html. Such documents contain a
trust_chain
field, which is intended to provide a static representation of the federation trust chain that connects the Leaf entity (i.e. the entity whose trustworthiness is being checked) to the known Trust Anchor entity,The
trust_chain
is a list of signed token in the form:Each token MUST be signed using one of the keys declared in the token next to it in the chain. The last token's signature will be checked against the known Trust Anchor's keys. Optionally, Trust Anchor entity configuration can be added as last element of the chain.
This PR proposes the
verifyTrustChain
function to be used asHow Has This Been Tested?
Screenshots (if appropriate):
Checklist: