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

docs: generate OpenAPI specification #116

Draft
wants to merge 51 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
d00354a
WIP
daniel-mader Aug 21, 2024
4ffa6d1
feat init agetn_holder
nanderstabel Aug 22, 2024
375110e
refactor: add `openapi` module, fix tags, document more endpoints
daniel-mader Aug 24, 2024
ebfc36d
feat: add `HolderState`
nanderstabel Aug 26, 2024
bca826e
feat: add Holder functionality to `agent_store` and `agent_api_rest`
nanderstabel Aug 26, 2024
75d7a31
feat: add Holder functionality to Event Publisher
nanderstabel Aug 26, 2024
c2b2d62
feat: add `SendCredentialOffer` to `agent_verification`
nanderstabel Aug 26, 2024
87d061f
feat: add `/offers/send` issuance endpoint to `agent_api_rest`
nanderstabel Aug 26, 2024
34ff280
fix: remove incorrect Content Type
nanderstabel Aug 27, 2024
7f1ab4f
feat: add `Status` enum
nanderstabel Aug 27, 2024
302e63f
feat: add REST API for Holder
nanderstabel Aug 27, 2024
2673bac
feat: add `AllOffersView`
nanderstabel Aug 27, 2024
5ee0ae4
feat: add Holder views to `init.sql`
nanderstabel Aug 27, 2024
1babdd4
fix: fix `OfferView` update
nanderstabel Aug 27, 2024
7bcc730
feat: add credentials endpoint for Holder
nanderstabel Aug 27, 2024
2000769
refactor: refactor Router
nanderstabel Aug 27, 2024
7599bee
test: refactor test framework
nanderstabel Aug 30, 2024
805591e
refactor: deprecate `path` closure
nanderstabel Aug 30, 2024
dc8c25d
refactor: remove unused dependencies
nanderstabel Aug 30, 2024
9f20fb6
style: add clippy exception
nanderstabel Aug 30, 2024
7c13929
build: bump oid4vc dependencies
nanderstabel Aug 30, 2024
384244c
refactor: move all `CustomQuery` logic to `agent_shared`
nanderstabel Aug 30, 2024
4c39ac7
fix: add Into<SubjectSyntaxType> for SupportedDidMethod
nanderstabel Aug 30, 2024
29f25da
fix: return 200 OK when list is empty
nanderstabel Aug 30, 2024
e08a045
refactor: clean up code
nanderstabel Aug 30, 2024
f307da3
fix: Fix error handling for the Offer aggregate
nanderstabel Aug 30, 2024
29e90d1
fix: add error handling for to Offer aggregate
nanderstabel Aug 30, 2024
cda0b76
refactor: apply clippy suggestion
nanderstabel Aug 30, 2024
bb43a33
test: update Postman Collection
nanderstabel Aug 30, 2024
5aae168
feat: add Events to `config.rs`
nanderstabel Aug 30, 2024
3056a09
docs: add new Holder events to `agent_event_publisher_http` document…
nanderstabel Aug 30, 2024
fa0e631
Merge branch 'dev' into feat/holder-init
nanderstabel Aug 30, 2024
143811f
Merge remote-tracking branch 'origin/feat/holder-init' into feat/gene…
daniel-mader Aug 30, 2024
4e8793f
docs: add basic docs for holder API
daniel-mader Aug 30, 2024
c601e3f
chore: Update OpenID4VCI endpoint paths and tags
daniel-mader Aug 30, 2024
304a469
docs: manually patch the generated OpenAPI document
daniel-mader Aug 30, 2024
dba22fe
docs: patch `description` and `version`
daniel-mader Sep 3, 2024
b099f8c
Merge branch 'dev' into feat/generate-openapi
daniel-mader Sep 20, 2024
37750a5
refactor: remove unnecessary blank line
daniel-mader Sep 20, 2024
6ce460e
feat: remove file-based health check
daniel-mader Sep 20, 2024
4cc16ad
chore(deps): bump `did_manager`
daniel-mader Sep 20, 2024
aff2acd
refactor: rename generated file
daniel-mader Sep 20, 2024
c94a377
chore(deps): bump `utoipa`
daniel-mader Sep 20, 2024
33d5204
docs: describe OpenAPI usage
daniel-mader Sep 20, 2024
2967c3a
refactor: remove Swagger UI
daniel-mader Sep 20, 2024
dd451c6
refactor: rename current `openapi.yaml` file (non-generated)
daniel-mader Sep 20, 2024
ca2ceaf
docs: update OpenAPI reference
daniel-mader Sep 21, 2024
5d20f17
refactor: rename `Well-known` tag
daniel-mader Sep 21, 2024
d99bcd2
docs: add examples
daniel-mader Sep 29, 2024
35a8d11
docs: add missing endpoints
daniel-mader Sep 29, 2024
20d09a5
docs: include Markdown description, add schemas
daniel-mader Oct 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 48 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ edition = "2021"
rust-version = "1.76.0"

[workspace.dependencies]
did_manager = { git = "https://git@github.com/impierce/did-manager.git", tag = "v1.0.0-beta.2" }
did_manager = { git = "https://git@github.com/impierce/did-manager.git", tag = "v1.0.0-beta.3" }
siopv2 = { git = "https://git@github.com/impierce/openid4vc.git", rev = "23facd4" }
oid4vci = { git = "https://git@github.com/impierce/openid4vc.git", rev = "23facd4" }
oid4vc-core = { git = "https://git@github.com/impierce/openid4vc.git", rev = "23facd4" }
Expand Down
15 changes: 14 additions & 1 deletion agent_api_rest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ tracing.workspace = true
tracing-subscriber.workspace = true
url.workspace = true
uuid.workspace = true
utoipa = { version = "=5.0.0-beta.0", features = ["axum_extras", "yaml"] }
utoipa-scalar = { version = "=0.2.0-beta.0", features = ["axum"] }
# TODO: wait for new release that contains PR juhaku/utoipa#1002 (current version `=5.0.0-alpha.1`)
# utoipa = { git = "https://github.com/juhaku/utoipa.git", rev = "f2a7143", features = [
# "axum_extras",
# "yaml",
# ] }
# # TODO: wait for new release that contains PR juhaku/utoipa#1002 (current version `=5.0.0-alpha.1`)
# utoipa-scalar = { git = "https://github.com/juhaku/utoipa.git", rev = "f2a7143", features = [
# "axum",
# ] }

[dev-dependencies]
agent_event_publisher_http = { path = "../agent_event_publisher_http", features = ["test_utils"] }
Expand All @@ -35,7 +46,9 @@ agent_issuance = { path = "../agent_issuance", features = ["test_utils"] }
agent_secret_manager = { path = "../agent_secret_manager", features = ["test_utils"] }
agent_shared = { path = "../agent_shared", features = ["test_utils"] }
agent_store = { path = "../agent_store" }
agent_verification = { path = "../agent_verification", features = ["test_utils"] }
agent_verification = { path = "../agent_verification", features = [
"test_utils",
] }

futures.workspace = true
jsonwebtoken.workspace = true
Expand Down
11 changes: 9 additions & 2 deletions agent_api_rest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ Breaking changes may occur before the API reaches a stable version.

The current version of the REST API is `v0`.

### OpenAPI specification (Swagger UI)
### OpenAPI specification

> [!NOTE]
> UniCore uses [Scalar](https://scalar.com) to make its OpenAPI specification interactive. It is served under `/<BASE_PATH>/<API_VERSION>/api-reference` (for example: `/v0/api-reference`). The `openapi.yaml` file can be downloaded there as well. The latest version of the `openapi.yaml` file is also deployed as part of the documentation at https://docs.impierce.com/unicore/api-reference.

#### Swagger UI

You can also run a local Swagger UI container to inspect the OpenAPI specification.

```bash
docker run --rm -p 9090:8080 -e SWAGGER_JSON=/tmp/openapi.yaml -v $(pwd):/tmp swaggerapi/swagger-ui
```

Browse to http://localhost:9090
Browse to http://localhost:9090.

### CORS

Expand Down
Loading