restapi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 24 Imported by: 3

Documentation

Index

Constants

View Source
const (

	// WebFingerEndpoint is the endpoint for WebFinger calls.
	WebFingerEndpoint = "/.well-known/webfinger"

	// HostMetaJSONEndpoint is the endpoint for getting the host-meta document.
	HostMetaJSONEndpoint = "/.well-known/host-meta.json"

	// ActivityJSONType represents a link type that points to an ActivityPub endpoint.
	ActivityJSONType = "application/activity+json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorInfo added in v1.0.0

type AnchorInfo struct {
	AnchorOrigin       string
	AnchorURI          string
	CanonicalReference string
}

AnchorInfo contains information about an anchor credential.

type AnchorInfoRetriever added in v1.0.0

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

AnchorInfoRetriever retrieves anchor information about a DID.

func NewAnchorInfoRetriever added in v1.0.0

func NewAnchorInfoRetriever(r *registry.Registry) *AnchorInfoRetriever

NewAnchorInfoRetriever returns a new AnchorInfoRetriever.

func (*AnchorInfoRetriever) GetAnchorInfo added in v1.0.0

func (r *AnchorInfoRetriever) GetAnchorInfo(did string) (*AnchorInfo, error)

GetAnchorInfo returns anchor information about the given DID.

type Config

type Config struct {
	PubKeys                   []PublicKey
	HTTPSignPubKeys           []PublicKey
	VerificationMethodType    string
	ResolutionPath            string
	OperationPath             string
	WebCASPath                string
	DiscoveryDomains          []string
	DiscoveryMinimumResolvers int
	ServiceID                 *url.URL
	ServiceEndpointURL        *url.URL
}

Config defines configuration for discovery operations.

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"errMessage,omitempty"`
}

ErrorResponse to send error message in the response.

type JRD added in v0.1.2

type JRD struct {
	Subject    string                 `json:"subject,omitempty"`
	Properties map[string]interface{} `json:"properties,omitempty"`
	Links      []Link                 `json:"links,omitempty"`
}

JRD is a JSON Resource Descriptor as defined in https://datatracker.ietf.org/doc/html/rfc6415#appendix-A and https://datatracker.ietf.org/doc/html/rfc7033#section-4.4.

type Link struct {
	Rel      string `json:"rel,omitempty"`
	Type     string `json:"type,omitempty"`
	Href     string `json:"href,omitempty"`
	Template string `json:"template,omitempty"`
}

Link is a link in a JRD. Note that while the host-meta and WebFinger endpoints both use this, only host-meta supports the Template field.

type Operation

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

Operation defines handlers for discovery operations.

func New

func New(c *Config, p *Providers) (*Operation, error)

New returns discovery operations.

func (*Operation) GetRESTHandlers

func (o *Operation) GetRESTHandlers() []common.HTTPHandler

GetRESTHandlers get all controller API handler available for this service.

type Providers added in v1.0.0

type Providers struct {
	ResourceRegistry     *registry.Registry
	CAS                  cas
	AnchorLinkStore      anchorLinkStore
	WebfingerClient      webfingerClient
	LogEndpointRetriever logEndpointRetriever
	WebResolver          webResolver
}

Providers defines the providers for discovery operations.

type PublicKey added in v1.0.0

type PublicKey struct {
	ID    string
	Value []byte
	Type  kms.KeyType
}

PublicKey public key.

type WellKnownResponse

type WellKnownResponse struct {
	ResolutionEndpoint string `json:"resolutionEndpoint,omitempty"`
	OperationEndpoint  string `json:"operationEndpoint,omitempty"`
}

WellKnownResponse well known response.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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