Skip to content

Modular pkg and tests#13

Merged
leonbotros merged 20 commits intomainfrom
modular-pkg
Oct 31, 2022
Merged

Modular pkg and tests#13
leonbotros merged 20 commits intomainfrom
modular-pkg

Conversation

@leonbotros
Copy link
Copy Markdown
Collaborator

@leonbotros leonbotros commented Jun 27, 2022

This PR adds modularity wrt authentication method to the PKG. It is implemented as follows:

  • The authentication middleware wraps the key service and it responsible for
  1. authenticating a user,
  2. extracting (validated) credentials/attributes,
  3. deriving an identity (<K as IBKEM>::Id) for a scheme.
    The middleware adds the identity to the request-local extensions. The key service extracts the key and adds it the the response-local extensions after which the middleware is responsible for creating the response. This way a key cannot end up in a response "by accident".

This PR also includes testing middleware that receives an IRMA policy and performs no authentication. This way, some PKG endpoints can be tested without testing the IRMA part of the process. Some basic tests and a full round of encapsulation using the keys obtained via the API are included.

This PR does make breaking changes to the API, specifically, the endpoints that are used for IRMA authentication are now prefixed with /irma.

@leonbotros leonbotros requested a review from Iso5786 June 28, 2022 12:37
Copy link
Copy Markdown
Member

@Iso5786 Iso5786 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, update documentation

Comment thread irmaseal-pkg/src/middleware/irma.rs Outdated
Comment thread irmaseal-pkg/src/middleware/irma.rs Outdated
Comment thread irmaseal-pkg/src/middleware/irma_noauth.rs Outdated
@leonbotros leonbotros force-pushed the modular-pkg branch 5 times, most recently from 3aaffea to 9d951a0 Compare October 26, 2022 16:10
@leonbotros
Copy link
Copy Markdown
Collaborator Author

Checks do not all succeed because I changed the them to a matrix strategy, but they are the same tests.
PKG API should now also be fully backwards compatible with older clients.

@leonbotros leonbotros merged commit ecc2936 into main Oct 31, 2022
@leonbotros leonbotros deleted the modular-pkg branch November 2, 2022 10:23
@dobby-coder dobby-coder Bot mentioned this pull request Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants