Skip to content

Commit

Permalink
Add context only for LinkedDomains
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Sep 10, 2024
1 parent e869fd8 commit 4bb41ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions services/diddoc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ func (dds DIDDocService) Resolve(did string, version string, contentType types.C
if didResolutionMetadata.ContentType == types.DIDJSONLD || didResolutionMetadata.ContentType == types.JSONLD {
didDoc.AddContext(types.DIDSchemaJSONLD)

if len(didDoc.Service) > 0 {
didDoc.AddContext(types.DIFDIDConfigurationJSONLD)
for _, service := range didDoc.Service {
if service.Type == types.LinkedDomains {
didDoc.AddContext(types.DIFDIDConfigurationJSONLD)
break
}
}

for _, method := range didDoc.VerificationMethod {
Expand Down
1 change: 1 addition & 0 deletions types/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const (
VersionId string = "versionId"
VersionTime string = "versionTime"
TransformKeys string = "transformKeys"
LinkedDomains string = "LinkedDomains"
Metadata string = "metadata"
ServiceQ string = "service"
RelativeRef string = "relativeRef"
Expand Down

0 comments on commit 4bb41ac

Please sign in to comment.