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

feat: did:web resolver should allow resolving DIDs that have different domain in DID if configured #1484

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

sandrask
Copy link
Contributor

Limit resolving did:web DIDs to current host domain plus configured additional domains.

Closes #1475

Signed-off-by: Sandra Vrtikapa sandra.vrtikapa@securekey.com

@cla-bot cla-bot bot added the cla-signed label Sep 15, 2022
@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Merging #1484 (6bdb527) into main (91b10ac) will decrease coverage by 0.00%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main    #1484      +/-   ##
==========================================
- Coverage   87.94%   87.93%   -0.01%     
==========================================
  Files         210      210              
  Lines       19797    19827      +30     
==========================================
+ Hits        17410    17435      +25     
- Misses       1525     1528       +3     
- Partials      862      864       +2     
Impacted Files Coverage Δ
cmd/orb-server/startcmd/start.go 68.67% <50.00%> (-0.11%) ⬇️
cmd/orb-server/startcmd/params.go 81.97% <72.72%> (-0.12%) ⬇️
pkg/discovery/endpoint/restapi/operations.go 89.27% <100.00%> (+0.02%) ⬆️
pkg/document/util/util.go 86.04% <100.00%> (ø)
pkg/document/webresolver/resolvehandler.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -64,8 +72,19 @@ func (r *ResolveHandler) ResolveDocument(id string) (*document.ResolutionResult,
r.metrics.WebDocumentResolveTime(time.Since(startTime))
}()

hostWithPort, err := util.BetweenStrings(id, "did:web:", ":scid:")
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be better validation - I will change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

…t domain in DID if configured

Limit resolving did:web DIDs to those with hosting domain in DID (or configured additional domains)

Closes trustbloc#1475

Signed-off-by: Sandra Vrtikapa <sandra.vrtikapa@securekey.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

did:web resolver should allow resolving DIDs that have different domain in DID if configured
3 participants