Skip to content

Commit

Permalink
feat: add verification endpoints to agent_api_rest (#37)
Browse files Browse the repository at this point in the history
* WIP

* WIP

* feat: re-introduce generics

* WIP

* feat: introduce `AppState`

* style: rename `ApplicationState` and `AppState`

* feat: add `Domain` trait

* WIP

* WIP

* style: remove unused code

* fix: fix some `unwrap`s, clean code

* refactor: simplify agent_store

* feat: add `CommandHandlers` struct

* style: fix clippy warnings

* refactor: simplify Commands

* style: change name

* chore: add log messages

* fix: only update view when `CredentialOfferCreated`

* chore: add comments and logging

* refactor: separate queries

* fix: several fixes

* test: update postman collection

* fix: set `oid4vc` dependencies to specific `rev`

* chore: set `rust-version` and use `workspace.package` settings

* feat: add `GET` method for `credentials` endpoint

* test: add `GET` method for `credentials` endpoint in postman collection

This includes a test for the `POST` method for the `credentials`
endpoint that updates the `CREDENTIAL_LOCATION` environment variable

* chore: add `/v1/credentials/{credential_id}` to `openapi.yaml` file

* chore: bump `axum` dependency to `0.7`

* chore: update `axum` related code to version `0.7`

* feat: add `log_error_response` macro for cleaner logging of error responses

* chore: update POST request to a valid OBv3 `credentialSubject`

* chore: use `TraceLayer` for proper tracing in `agent_api_rest`

* `on_request` makes sure that each request is traced
* `on_response` makes sure that each response is traced
* `on_body_chunk` makes sure that each response body is traced

`TraceLayer` only accepts `Request<axum::body::Body` which is not `Serialize`,
therefore, we still need to explicitly trace the request body in each route.

* fix: remove obsolete `log_error_response` macro

The `log_error_response` macro is replaced by the `TraceLayer`.`

* refactor: use `if` + `is_err()` rather than `match` for `command_handler` useage

* feat: add `NOT_FOUND` response option

* fix: set tokio version to `1`

* feat: initialize module

* WIP

* refactor: move `ApplicationState` to `agent_shared`

* feat: add `agent_verification`

* style: rename `AuthorizationRequestTestFramework` to `ConnectionTestFramework`

* feat: add `VerificationState` to `ApplicationState`

* chore: add `Cargo.lock` file

* feat: add verification endpoints

* refactor: remove `ApplicationState` struct and replace it for a tuple

* fix: remove `ConnectionNotificationSent`

Instead of using the `VerificationServices` for sending connection notifications
we will probably need to utilize a `Query` that will function as an
outgoing adapter.

* feat: add `VerificationState` to `ApplicationState`

* feat: add `authorization_request` and `connection` tables to `init.sql`

* feat: add `EventPublisherHttp`

* feat: add `OutboundAdapter` trait

* test: add default parameters to tests  in `agent_api_rest`

* feat: make `EventPublisherHttp` support all different aggregates

* test: adjust test for `EventPublisherHttp`

* feat: add `EventPublisherHttp` to `agent_application`

* test: fix `Mutex`

* chore: remove unused environment variables from `.env.example`

* fix: rename aggregate event publishers

* test: improve tests for Verification in  `agent_api_rest`

* fix: rename siopv2 endpoints, add `path`

* feat: move `client_metadata` to `VerificationServices`

* docs: add `README.md` file for `agent_event_publisher`, remove `config.yaml`

* fix: default to empty `EventPublisherHttp` when `config.yml` does not exist

* fix: use `client_id` for the `connection_id`

* fix: return `text/plain` instead of `application/json`

* fix: add `InvalidSIOPv2AuthorizationResponse` error

* docs: add comments to Verification endpoints

* fix: fix the path to the `config.yml` file

* test: fix test

* feat: enable `agent_event_publisher_http` in docker environment

* docs: add documentation for `SecretManager` and `EventPublisherHttp`

* style: use `pub type`s for adapters

* feat: change content-type to application/json

* style: replace closure for enum variant

* fix: change `authorization_requests` endpoints response content-type to `text/plain`

* docs: add verification related endpoints to `openapi.yml`

* style: rename `OutboundAdapter` to `EventPublisher`

* docs: specify that the default Stronghold option is temporary

* refactor: move `secret_manager` function to `agent_secret_manager`

* feat: add `get_authorization_requests` endpoint

* docs: fix example link

* fix: fix `SecretManager` import

* chore: update `did-manager` and `oid4vc` dependencies

* fix: reset `format-lint-test` workflow

* test: add verification endpoints to Postman collection

* fix: use `rustls` instead of `openssl`

* docs: add `important` alert to `docker/README.md`

* fix: set the `/v1/offers` endpoints response Content-Type to `application/x-www-form-urlencoded`

* fix: set `request` endpoints response Content-Type to `application/jwt`

* fix: set `v1/authorization_requests` response Content-Type to `application/x-www-form-urlencoded`

* test: add Content-Type assertions to `agent_api_rest` tests

* docs: add doc comment with more elaborative description

* test: update Postman collection

---------

Co-authored-by: Daniel Mader <daniel.mader@impierce.com>
  • Loading branch information
nanderstabel and daniel-mader authored Apr 12, 2024
1 parent bfe1f28 commit 4a7f028
Show file tree
Hide file tree
Showing 37 changed files with 1,265 additions and 478 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 11-04-2024
`/v1/offers` incorrectly returned with Content-Type `application/json`. The Content-Type has now beeen changed to `application/x-www-form-urlencoded`.

### 24-01-2024

Environment variable `AGENT_APPLICATION_HOST` has changed to `AGENT_APPLICATION_URL` and requires the complete URL. e.g.:
Expand Down
Loading

0 comments on commit 4a7f028

Please sign in to comment.