resolver

package
v0.0.0-...-e057505 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package resolver implements a universal resolver compatible REST API

https://github.com/decentralized-identity/universal-resolver

The configuration for this resolver are the following:

{
	"pattern": "^(did:cosmos:.+)$",
	"url": "http://uni-resolver-driver-did-uport:8081/",
	"testIdentifiers": [
		"did:cosmos:cash:alice",
		"did:cosmos:key:cosmos1u7clngyucn867fm2za0s869yvln9aur8zjujxe"
	]
}

Index

Constants

View Source
const (
	// ResolutionInvalidDID - the DID supplied to the DID resolution function does not conform to valid syntax.
	ResolutionInvalidDID = "invalidDid"
	// ResolutionNotFound - the DID resolver was unable to find the DID document resulting from this resolution request.
	ResolutionNotFound = "notFound"
	// ResolutionRepresentationNotSupported - the representation requested via the accept input metadata property is not supported
	ResolutionRepresentationNotSupported = "representationNotSupported"
)

Error types for resolution as described in the resolution metadata https://www.w3.org/TR/did-core/#did-resolution-metadata

View Source
const (
	ResolutionJSONType   = "application/json"
	ResolutionJSONLDType = "application/ld+json"
)

Accepted content types

Variables

This section is empty.

Functions

This section is empty.

Types

type AriesDidDocument

type AriesDidDocument struct {
	types.DidDocument
	Created *time.Time `json:"created,omitempty"`
	Updated *time.Time `json:"updated,omitempty"`
}

AriesDidDocument implement the aries did document see: https://github.com/hyperledger/aries-framework-go/blob/2d601d717a3e2297662faf622f7a878e0f50f981/pkg/doc/did/doc.go#L315

type DidResolutionReply

type DidResolutionReply struct {
	Document           types.DidDocument  `json:"didDocument,omitempty"`
	Metadata           types.DidMetadata  `json:"didDocumentMetadata,omitempty"`
	ResolutionMetadata ResolutionMetadata `json:"didResolutionMetadata,omitempty"`
}

DidResolutionReply contains the answer to a identifier endpoint

func ResolveRepresentation

func ResolveRepresentation(cc *grpc.ClientConn, did string, opts ResolutionOption) (drr DidResolutionReply)

ResolveRepresentation resolve a did document with a specific representation

type ResolutionMetadata

type ResolutionMetadata struct {
	ContentType     string            `json:"contentType,omitempty"`
	ResolutionError string            `json:"error,omitempty"`
	DidProperties   map[string]string `json:"did,omitempty"`
}

ResolutionMetadata are info about the resolution https://www.w3.org/TR/did-core/#did-resolution-metadata

func ResolutionErr

func ResolutionErr(err string) ResolutionMetadata

ResolutionErr helper to get a resolution metadata for an error

func ResolutionOk

func ResolutionOk(contentType string) ResolutionMetadata

ResolutionOk helper to get a resolution metadata for a successful resolution

type ResolutionOption

type ResolutionOption struct {
	Accept string `json:"accept,omitempty"`
}

ResolutionOption are parametes for the resolver https://www.w3.org/TR/did-core/#did-resolution-options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL