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

VDR: Produce did:web documents #2631

Merged
merged 25 commits into from
Dec 6, 2023
Merged

VDR: Produce did:web documents #2631

merged 25 commits into from
Dec 6, 2023

Conversation

reinkrul
Copy link
Member

@reinkrul reinkrul commented Nov 29, 2023

This PR adds support to create did:web documents and have them returned by IAM's /iam/{did} endpoint. This enables e2e tests for the new OAuth2 implementations to test with actual did:web documents.

TODO:

auth/api/iam/api.go Outdated Show resolved Hide resolved
core/server_config.go Outdated Show resolved Hide resolved
@@ -301,6 +301,13 @@ components:
type: boolean
description: whether the generated DID Document can be altered with its own capabilityInvocation key.
default: true
method:
Copy link
Member

Choose a reason for hiding this comment

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

I thought we decided on a v2 api?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought we could short-circuit this to get progress on the end-to-end tests, but adding it to the spec. might be a bit much. Since the HTTP request object is hand-written anyways, we can still leave it in the v1 API (so we can get going on e2e tests), but it won't show up in the OAPI spec?

storage/sql_migrations/3_didweb.up.sql Outdated Show resolved Hide resolved
storage/sql_migrations/3_didweb.up.sql Outdated Show resolved Hide resolved
@woutslakhorst woutslakhorst self-assigned this Dec 1, 2023
@woutslakhorst woutslakhorst self-requested a review December 1, 2023 14:17
docs/_static/vdr/v2.yaml Outdated Show resolved Hide resolved
docs/_static/vdr/v2.yaml Outdated Show resolved Hide resolved
docs/_static/vdr/v2.yaml Outdated Show resolved Hide resolved
docs/_static/vdr/v2.yaml Outdated Show resolved Hide resolved
post:
summary: Adds a service to the DID document.
description: |
It adds the given service to the DID Document. The ID will be generated and replaced.
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't need to generate it? Since it isn't the thumbprint any more. So I'd say just accept it as-is, if it's not set we can generate a UUID. There might be use cases for people setting the ID.

Copy link
Member

@woutslakhorst woutslakhorst Dec 4, 2023

Choose a reason for hiding this comment

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

This would actually be nice to do for the DID itself as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, then parties can choose to actually use recognizable DIDs (instead of ones containing random computer stRINGS)

docs/_static/vdr/v2.yaml Outdated Show resolved Hide resolved
e2e-tests/oauth-flow/rfc021/docker-compose.yml Outdated Show resolved Hide resolved
e2e-tests/oauth-flow/rfc021/docker-compose.yml Outdated Show resolved Hide resolved
e2e-tests/oauth-flow/rfc021/run-test.sh Show resolved Hide resolved
* Copyright (C) 2021 Nuts community
*
Copy link
Member Author

Choose a reason for hiding this comment

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

?

Copy link
Member

Choose a reason for hiding this comment

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

nasty malformed copyright statements

@woutslakhorst
Copy link
Member

@reinkrul comment on API should go into #2630

@woutslakhorst
Copy link
Member

Comments solved in #2630

@woutslakhorst
Copy link
Member

@reinkrul up2date with master, now only 1k lines to review

@@ -106,6 +118,7 @@ func createCmd() *cobra.Command {
result.Flags().BoolVar(createRequest.CapabilityInvocation, "capabilityInvocation", defs.KeyFlags.Is(management.CapabilityInvocationUsage), setUsage(defs.KeyFlags.Is(management.CapabilityInvocationUsage), "Pass '%t' to %s capabilityInvocation capabilities."))
result.Flags().BoolVar(createRequest.KeyAgreement, "keyAgreement", defs.KeyFlags.Is(management.KeyAgreementUsage), setUsage(defs.KeyFlags.Is(management.KeyAgreementUsage), "Pass '%t' to %s keyAgreement capabilities."))
result.Flags().BoolVar(createRequest.SelfControl, "selfControl", defs.SelfControl, setUsage(defs.SelfControl, "Pass '%t' to %s DID Document control."))
result.Flags().BoolVar(&useV2, "v2", false, "Pass 'true' to use the V2 API and create a web:did.")
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
result.Flags().BoolVar(&useV2, "v2", false, "Pass 'true' to use the V2 API and create a web:did.")
result.Flags().BoolVar(&useV2, "v2", false, "Pass 'true' to use the V2 API and create a did:web DID.")

Copy link
Member Author

Choose a reason for hiding this comment

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

Regenerate CLI docs

@reinkrul
Copy link
Member Author

reinkrul commented Dec 6, 2023

Found small thing in new CLI flags. Rest looks OK. I can't approve/request changes on my own PR, so I'd say just approve & merge

@woutslakhorst woutslakhorst merged commit 199fbc6 into master Dec 6, 2023
4 of 6 checks passed
@woutslakhorst woutslakhorst deleted the vdr/produce-didweb branch December 6, 2023 07:45
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