principalresolver

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const WellKnownDIDPath = "/.well-known/did.json"

Variables

This section is empty.

Functions

func ExtractDomainFromDID added in v0.0.10

func ExtractDomainFromDID(didWeb did.DID) (string, error)

ExtractDomainFromDID extracts the domain from a DID web string

Types

type CachedResolver added in v0.0.10

type CachedResolver struct {
	// contains filtered or unexported fields
}

func NewCachedResolver added in v0.0.10

func NewCachedResolver(wrapped validator.PrincipalResolver, ttl time.Duration) (*CachedResolver, error)

func (*CachedResolver) ResolveDIDKey added in v0.0.10

func (c *CachedResolver) ResolveDIDKey(ctx context.Context, input did.DID) (did.DID, validator.UnresolvedDID)

type Document added in v0.0.10

type Document struct {
	Context            FlexibleContext      `json:"@context"` // https://w3id.org/did/v1
	ID                 string               `json:"id"`
	Controller         []string             `json:"controller,omitempty"`
	VerificationMethod []VerificationMethod `json:"verificationMethod,omitempty"`
	Authentication     []string             `json:"authentication,omitempty"`
	AssertionMethod    []string             `json:"assertionMethod,omitempty"`
}

Document is a did document that describes a did subject. See https://www.w3.org/TR/did-core/#dfn-did-documents. Copied from: https://github.com/storacha/indexing-service/blob/fe8f2211a15d851f2672bfeb64dcfc65c52e6011/pkg/server/server.go#L238

type FlexibleContext added in v0.0.10

type FlexibleContext []string

FlexibleContext handles both string and []string formats for @context field as allowed by the DID Core specification

func (*FlexibleContext) UnmarshalJSON added in v0.0.10

func (fc *FlexibleContext) UnmarshalJSON(data []byte) error

type HTTPResolver added in v0.0.10

type HTTPResolver struct {
	// contains filtered or unexported fields
}

func NewHTTPResolver added in v0.0.10

func NewHTTPResolver(webKeys []did.DID, opts ...Option) (*HTTPResolver, error)

func (*HTTPResolver) ResolveDIDKey added in v0.0.10

func (r *HTTPResolver) ResolveDIDKey(ctx context.Context, input did.DID) (did.DID, validator.UnresolvedDID)

TODO(forrest): the interface this implements in go-ucanto should probably accept a context since means of resolution here are open ended, and may go to network or disk.

type MapResolver added in v0.0.10

type MapResolver struct {
	// contains filtered or unexported fields
}

func NewMapResolver added in v0.0.10

func NewMapResolver(smap map[string]string) (*MapResolver, error)

func (*MapResolver) ResolveDIDKey added in v0.0.10

func (r *MapResolver) ResolveDIDKey(_ context.Context, input did.DID) (did.DID, validator.UnresolvedDID)

type Option added in v0.0.10

type Option func(*config) error

func InsecureResolution added in v0.0.10

func InsecureResolution() Option

func WithTimeout added in v0.0.10

func WithTimeout(timeout time.Duration) Option

type VerificationMethod added in v0.0.10

type VerificationMethod struct {
	ID                 string `json:"id,omitempty"`
	Type               string `json:"type,omitempty"`
	Controller         string `json:"controller,omitempty"`
	PublicKeyMultibase string `json:"publicKeyMultibase,omitempty"`
}

VerificationMethod describes how to authenticate or authorize interactions with a did subject. See https://www.w3.org/TR/did-core/#dfn-verification-method.

Jump to

Keyboard shortcuts

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