Skip to content
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

refactor: implement IssuanceServices for signing and verifying #98

Merged
merged 48 commits into from
Aug 2, 2024

Conversation

nanderstabel
Copy link
Collaborator

@nanderstabel nanderstabel commented Jul 29, 2024

Description of change

At the moment we have two different approaches of utilizing the SecretManager for signing and verifying in UniCore.

  • In agent_issaunce we load the SecretManager each time we either Sign a Credential, or Verify an incoming CredentialRequest.
  • in agent_verifiactionone single instance of the SecretManager is loaded on initialization of UniCore and this instance will be reused for all signing and verifying.

The loading of the SecretManager takes a significant amount of time and therefore this PR introduces the same approach used in agent_verification to agent_issuance.

To illustrate how this change (positively) affects UniCore's latency, below are the first and last log messages when UniCore receives a call to the /openid4vci/credential endpoint both before and after the changes in this PR.

Before (latency ≈ 2.4 seconds):

2024-07-31T08:54:17.819256Z  INFO HTTP Request {method=POST path="/openid4vci/credential"}: ...
...
2024-07-31T08:54:20.189200Z  INFO HTTP Request {method=POST path="/openid4vci/credential"}: ...

After (latency ≈ 0.4 seconds):

2024-07-31T08:58:37.624807Z  INFO HTTP Request {method=POST path="/openid4vci/credential"}: ...
...
2024-07-31T08:58:38.044879Z  INFO HTTP Request {method=POST path="/openid4vci/credential"}: ...

Links to any relevant issues

Fixes #99

How the change has been tested

Manually tested using the Postman Collection

Definition of Done checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have successfully tested this change in a docker environment

@nanderstabel nanderstabel added the Enhancement New feature or improvement to an existing feature label Jul 29, 2024
@nanderstabel nanderstabel self-assigned this Jul 29, 2024
@nanderstabel nanderstabel linked an issue Jul 29, 2024 that may be closed by this pull request
2 tasks
Base automatically changed from refactor/config to dev July 29, 2024 20:48
@nanderstabel nanderstabel marked this pull request as ready for review July 31, 2024 12:44
@nanderstabel nanderstabel merged commit 560a20f into dev Aug 2, 2024
1 check passed
@nanderstabel nanderstabel deleted the feat/issuance-service branch August 2, 2024 12:36
berkes pushed a commit to educredentials/ssi-agent that referenced this pull request Aug 14, 2024
…ierce#98)

* refactor: undo unnecessary changes

* docs: list all config values

* refactor: rename config file

* refactor: remove example files from docker image

* refactor: merge config files

* refactor: update .dockerignore to include all Dockerfiles and .env files

* WIP: migrate from config macro to config function

* refactor: configs for `log_format` and `event_store`

* refactor: remove unused macros calls

* refactor: migrate `url` config

* refactor: `secret_manager` config

* refactor: `credential_configurations` config

* refactor: rename `DidMethodOptions`, add config for `signing_algorithms_supported`

* refactor: determine default DID method

* refactor: remove comments, load env variables

* WIP: refactor `event_publishers` config

* refactor: remove `metadata`

* refactor: remove `config!` macro

* refactor: rename `config_2` to `config`

* chore: change example logo, disable `event_publisher`, respect `default_did_method`

* chore: resolve clippy issues

* refactor: remove `set_metadata_configuration`

* refactor: remove `TEST_METADATA`

* WIP

* test: fix tests

* ci: update docker-compose

* fix: replace `localhost` with container name

* refactor: clean up code

* chore: fix unused import

* chore: remove unused deployment scripts

* refactor: read `connection_string` inside postgres module

* refactor: rename env prefix to `UNICORE`

* feat: init `IsuanceService`

* refacotr: remove unused code

* feat: add `from_jsonwebtoken_algorithm_to_jwsalgorithm` helper function

* chore: remove unused code

* feat: add `generate_stronghold` option

* chore: update logo URI's in example config file

* chore: remove temp stronghold file

* chore: remove `example-config.yaml` file

* chore: remove unused `identity_iota` dependencies

* refactor: remove unused 'services'

* refactor: use `from_jsonwebtoken_algorithm_to_jwsalgorithm`

* fix: reset config source to `agent_application/config.yaml`

* feat: update config files

* chore: update docker-compose file

* fix: don't use `example.config.yaml` by default

---------

Co-authored-by: Daniel Mader <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use IssuanceServices for signing and verifying data in agent_issuance
2 participants