nuts-foundation / nuts-foundation/nuts-node
VDR: Support multiple did:web domains
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 28
- Forks
- 23
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 76
Description
Currently, a Nuts node is tied to 1 domain for did:web DIDs. E.g., if the Nuts node's url config is https://example.com, all created did:web DIDs will be in the format of did:web:example.com:iam:....
However, there are use cases in which a free-to-choose domain (or at least not tied to 1 specific preconfigured domain) is useful for did:web DIDs;
- Vendors who wish to have a domain per client/care organization, or sets of clients
- (Mobile) wallets might only accept rooted did:web DIDs for security reasons (e.g. Microsoft Authenticator does). This could be an issue if care organizations want to issue an employee credential to their employee's mobile wallet.
I suggest making the did:web DID domain (and port) free to choose, to make the Nuts node more flexible. There's no security/functional requirement that prevents us from doing so. It also decouples the did:web domain from the auth module's IRMA/Yivi base path, which also uses the url config (which might be constraining when they have to be the same).
Impact
- domain is now derived from the
urlconfig property - VDR REST API for creating
did:webDIDs now only takesidparameter, not the complete DID - can practically only be used with TLS termination, since the
did:webdomain needs to match the server's TLS certificate.- But nobody is terminating TLS on the Nuts node anyways? Aside from dev/test setups.
- IAM endpoints that now take the
did:webDID's ID (e.g. the GUID after/iam/) need to build the DID from theHostheader.- redirection handler's endpoint is now DID-specific, but could be DID agnostic, since it can use the
stateparameter to resolve the related session. Or add the session ID to the path of the endpoint
- redirection handler's endpoint is now DID-specific, but could be DID agnostic, since it can use the
Suggested changes
- Replace VDR REST API's
idrequest parameter with optionaldidparameter.- Caller either provides the complete DID, or the Nuts node will generate it from the configured Nuts node
urlconfig - If provided by caller, it's probably best check that the DID ID still specifies
:iam:<something>.
- Caller either provides the complete DID, or the Nuts node will generate it from the configured Nuts node
- Construct DID for IAM endpoints off the HTTP request's
Hostheader (and/orX-Forwarded-For), instead from Nuts node'surl's host.- This also applies to the OAuth2/OpenID metadata
Side notes
If did:web does not use url anymore (say the caller MUST provide the DID), only the Auth module uses the url config parameter. Thus, it could be optional (again)...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the VDR REST API for creating did:web DIDs, then the IAM endpoints and OAuth2/OpenID metadata that currently derive domains from the url config. Review how the Host header and forwarded host information are handled. Done means the chosen DID input and host-derived behavior are implemented consistently, including the documented redirection and TLS considerations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, authentication, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100