operation

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// RegistrationStateFinished registration state finished
	RegistrationStateFinished = "finished"
	// RegistrationStateFailure registration state failure
	RegistrationStateFailure = "failure"

	// Ed25519KeyType defines ed25119 key type
	Ed25519KeyType = "Ed25519"
	// P256KeyType EC P-256 key type
	P256KeyType = "P256"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TLSConfig          *tls.Config
	BlocDomain         string
	Mode               string
	SidetreeReadToken  string
	SidetreeWriteToken string
	EnableSignatures   bool
	GenesisFiles       []GenesisFileConfig
}

Config defines configuration for trustbloc did method operations

type DIDDocument

type DIDDocument struct {
	PublicKey []*PublicKey `json:"publicKey,omitempty"`
	Service   []*Service   `json:"service,omitempty"`
}

DIDDocument did doc

type DIDState

type DIDState struct {
	Identifier string `json:"identifier,omitempty"`
	Reason     string `json:"reason,omitempty"`
	State      string `json:"state,omitempty"`
	Secret     Secret `json:"secret,omitempty"`
}

DIDState did state

type GenesisFileConfig added in v0.1.6

type GenesisFileConfig struct {
	URL  string
	Data []byte
}

GenesisFileConfig defines a genesis file for the trustbloc did method vdri

type Handler

type Handler interface {
	Path() string
	Method() string
	Handle() http.HandlerFunc
}

Handler http handler for each controller API endpoint

type Key

type Key struct {
	PublicKeyBase58  string   `json:"publicKeyBase58,omitempty"`
	PrivateKeyBase58 string   `json:"privateKeyBase58,omitempty"`
	ID               string   `json:"id,omitempty"`
	Purposes         []string `json:"purposes,omitempty"`
}

Key include public key and private key

type Operation

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

Operation defines handlers

func New

func New(config *Config) (*Operation, error)

New returns did method operation instance

func (*Operation) GetRESTHandlers

func (o *Operation) GetRESTHandlers(mode string) ([]Handler, error)

GetRESTHandlers get all controller API handler available for this service

type PublicKey

type PublicKey struct {
	ID   string `json:"id,omitempty"`
	Type string `json:"type,omitempty"`
	// Value is always Base64
	Value    string   `json:"value,omitempty"`
	Purposes []string `json:"purposes,omitempty"`
	Recovery bool     `json:"recovery,omitempty"`
	Update   bool     `json:"update,omitempty"`
	KeyType  string   `json:"keyType,omitempty"`
}

PublicKey public key

type RegisterDIDRequest

type RegisterDIDRequest struct {
	JobID       string            `json:"jobId,omitempty"`
	Options     map[string]string `json:"options,omitempty"`
	DIDDocument DIDDocument       `json:"didDocument,omitempty"`
}

RegisterDIDRequest input data for register DID

type RegisterResponse

type RegisterResponse struct {
	JobID             string                 `json:"jobId,omitempty"`
	DIDState          DIDState               `json:"didState,omitempty"`
	RegistrarMetadata map[string]interface{} `json:"registrarMetadata"`
	MethodMetadata    map[string]interface{} `json:"methodMetadata"`
}

RegisterResponse register response

type Secret

type Secret struct {
	Keys []Key `json:"keys,omitempty"`
}

Secret include keys

type Service

type Service struct {
	ID            string   `json:"id,omitempty"`
	Type          string   `json:"type,omitempty"`
	Priority      uint     `json:"priority,omitempty"`
	RecipientKeys []string `json:"recipientKeys,omitempty"`
	RoutingKeys   []string `json:"routingKeys,omitempty"`
	Endpoint      string   `json:"serviceEndpoint,omitempty"`
}

Service DID doc service

Jump to

Keyboard shortcuts

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