Skip to content

Commit

Permalink
Support display method (#86)
Browse files Browse the repository at this point in the history
* support display service for w3c

* add JSONLDSchemaIden3DisplayMethod constant
  • Loading branch information
ilya-korotya authored Jan 12, 2024
1 parent 0ba0617 commit 144a2d1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions verifiable/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const (
// JSONLDSchemaW3CCredential2018 is a schema for context with VerifiableCredential type
JSONLDSchemaW3CCredential2018 = "https://www.w3.org/2018/credentials/v1"

// JSONLDSchemaW3CCredential2020 is a schema for context with Display method type
JSONLDSchemaIden3DisplayMethod = "https://schema.iden3.io/core/jsonld/displayMethod.jsonld"

// SparseMerkleTreeProof is CredentialStatusType for standard MTP result handlers
SparseMerkleTreeProof CredentialStatusType = "SparseMerkleTreeProof"

Expand Down Expand Up @@ -75,4 +78,7 @@ const (

// Iden3RefreshService2023 is the type of refresh service
Iden3RefreshService2023 RefreshServiceType = "Iden3RefreshService2023"

// Iden3BasicDisplayMethodV1 is the type fof basic display method
Iden3BasicDisplayMethodV1 DisplayMethodType = "Iden3BasicDisplayMethodV1"
)
1 change: 1 addition & 0 deletions verifiable/credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type W3CCredential struct {
CredentialSchema CredentialSchema `json:"credentialSchema"`
Proof CredentialProofs `json:"proof,omitempty"`
RefreshService *RefreshService `json:"refreshService,omitempty"`
DisplayMethod *DisplayMethod `json:"displayMethod,omitempty"`
}

// Merklize merklizes verifiable credential
Expand Down
8 changes: 8 additions & 0 deletions verifiable/displayMethod.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package verifiable

type DisplayMethodType string

type DisplayMethod struct {
ID string `json:"id"`
Type DisplayMethodType `json:"type"`
}

0 comments on commit 144a2d1

Please sign in to comment.