Skip to content

Commit

Permalink
Return setter/getter for issuer DID to go-schema-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
olomix committed Jan 26, 2024
1 parent 52e3f8d commit b6f3210
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions verifiable/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,27 @@ package verifiable
import (
"context"
"fmt"

"github.com/iden3/go-iden3-core/v2/w3c"
)

type ctxKeyIssuerDID struct{}

// WithIssuerDID puts the issuer DID in the context
func WithIssuerDID(ctx context.Context, issuerDID *w3c.DID) context.Context {
return context.WithValue(ctx, ctxKeyIssuerDID{}, issuerDID)
}

// GetIssuerDID extract the issuer DID from the context.
// Or nil if nothing is found.
func GetIssuerDID(ctx context.Context) *w3c.DID {
v := ctx.Value(ctxKeyIssuerDID{})
if v == nil {
return nil
}
return v.(*w3c.DID)
}

// CredentialStatusResolver is an interface that allows to interact with deifferent types of credential status to resolve revocation status
type CredentialStatusResolver interface {
Resolve(ctx context.Context,
Expand Down

0 comments on commit b6f3210

Please sign in to comment.