baseline

package
v0.0.0-...-09899ef Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolMessageOpcodeBaseline = "BLINE"
View Source
const ProtocolMessageOpcodeJoin = "JOIN"
View Source
const ProtocolMessageOpcodeSync = "SYNC"

Variables

This section is empty.

Functions

func ConfigureStack

func ConfigureStack(token string, params map[string]interface{}) error

ConfigureStack updates the global configuration on the local baseline stack

func CreateObject

func CreateObject(token string, params map[string]interface{}) (interface{}, error)

CreateObject is a generic way to baseline a business object

func UpdateObject

func UpdateObject(token, id string, params map[string]interface{}) error

UpdateObject updates a business object

func UpdateWorkgroup

func UpdateWorkgroup(id, token string, params map[string]interface{}) error

UpdateWorkgroup updates a previously-initialized workgroup on the local baseline stack

Types

type BaselineContext

type BaselineContext struct {
	ID         *uuid.UUID        `sql:"-" json:"id,omitempty"`
	BaselineID *uuid.UUID        `sql:"-" json:"baseline_id,omitempty"`
	Records    []*BaselineRecord `sql:"-" json:"records,omitempty"`
	Workflow   *Workflow         `sql:"-" json:"-"`
	WorkflowID *uuid.UUID        `sql:"-" json:"workflow_id"`
}

BaselineContext represents a collection of BaselineRecord instances in the context of a workflow

type BaselineRecord

type BaselineRecord struct {
	ID         *string          `sql:"-" json:"id,omitempty"`
	BaselineID *uuid.UUID       `sql:"-" json:"baseline_id,omitempty"`
	Context    *BaselineContext `sql:"-" json:"-"`
	ContextID  *uuid.UUID       `sql:"-" json:"context_id"`
	Type       *string          `sql:"-" json:"type"`
}

BaselineRecord represents a link between an object in the internal system of record and the external BaselineContext

type Config

type Config struct {
	Counterparties           []*Participant    `sql:"-" json:"counterparties,omitempty"`
	Env                      map[string]string `sql:"-" json:"env,omitempty"`
	Errors                   []*api.Error      `sql:"-" json:"errors,omitempty"`
	NetworkID                *uuid.UUID        `sql:"-" json:"network_id,omitempty"`
	OrganizationAddress      *string           `sql:"-" json:"organization_address,omitempty"`
	OrganizationID           *uuid.UUID        `sql:"-" json:"organization_id,omitempty"`
	OrganizationRefreshToken *string           `sql:"-" json:"organization_refresh_token,omitempty"`
	RegistryContractAddress  *string           `sql:"-" json:"registry_contract_address,omitempty"`
}

Config represents the proxy configuration

type IssueVerifiableCredentialRequest

type IssueVerifiableCredentialRequest struct {
	Address        *string    `json:"address,omitempty"`
	OrganizationID *uuid.UUID `json:"organization_id,omitempty"`
	PublicKey      *string    `json:"public_key,omitempty"`
	Signature      *string    `json:"signature"`
}

IssueVerifiableCredentialRequest represents a request to issue a verifiable credential

type IssueVerifiableCredentialResponse

type IssueVerifiableCredentialResponse struct {
	VC *string `json:"credential"`
}

IssueVerifiableCredentialResponse represents a response to a VC issuance request

type Message

type Message struct {
	ID              *string          `sql:"-" json:"id,omitempty"`
	BaselineID      *uuid.UUID       `sql:"-" json:"baseline_id,omitempty"` // optional; when included, can be used to map outbound message just-in-time
	Errors          []*api.Error     `sql:"-" json:"errors,omitempty"`
	MessageID       *string          `sql:"-" json:"message_id,omitempty"`
	Payload         interface{}      `sql:"-" json:"payload,omitempty"`
	ProtocolMessage *ProtocolMessage `sql:"-" json:"protocol_message,omitempty"`
	Recipients      []*Participant   `sql:"-" json:"recipients"`
	Status          *string          `sql:"-" json:"status,omitempty"`
	Type            *string          `sql:"-" json:"type,omitempty"`
}

Message is a proxy-internal wrapper for protocol message handling

type Participant

type Participant struct {
	Address           *string                `sql:"-" json:"address"`
	Metadata          map[string]interface{} `sql:"-" json:"metadata,omitempty"`
	APIEndpoint       *string                `sql:"-" json:"api_endpoint,omitempty"`
	MessagingEndpoint *string                `sql:"-" json:"messaging_endpoint,omitempty"`
}

Participant is a party to a baseline workgroup or workflow context

type ProtocolMessage

type ProtocolMessage struct {
	BaselineID *uuid.UUID              `sql:"-" json:"baseline_id,omitempty"`
	Opcode     *string                 `sql:"-" json:"opcode,omitempty"`
	Sender     *string                 `sql:"-" json:"sender,omitempty"`
	Recipient  *string                 `sql:"-" json:"recipient,omitempty"`
	Shield     *string                 `sql:"-" json:"shield,omitempty"`
	Identifier *uuid.UUID              `sql:"-" json:"identifier,omitempty"`
	Signature  *string                 `sql:"-" json:"signature,omitempty"`
	Type       *string                 `sql:"-" json:"type,omitempty"`
	Payload    *ProtocolMessagePayload `sql:"-" json:"payload,omitempty"`
}

ProtocolMessage is a baseline protocol message see https://github.com/ethereum-oasis/baseline/blob/master/core/types/src/protocol.ts

type ProtocolMessagePayload

type ProtocolMessagePayload struct {
	Object  map[string]interface{} `sql:"-" json:"object,omitempty"`
	Proof   *string                `sql:"-" json:"proof,omitempty"`
	Type    *string                `sql:"-" json:"type,omitempty"`
	Witness interface{}            `sql:"-" json:"witness,omitempty"`
}

ProtocolMessagePayload is a baseline protocol message payload

type Service

type Service struct {
	api.Client
}

Service for the baseline api

func InitBaselineService

func InitBaselineService(token string) *Service

InitBaselineService convenience method to initialize a `baseline.Service` instance

type Workflow

type Workflow struct {
	ID           *uuid.UUID     `sql:"-" json:"id,omitempty"`
	Errors       []*api.Error   `sql:"-" json:"errors,omitempty"`
	Participants []*Participant `sql:"-" json:"participants"`
	Shield       *string        `sql:"-" json:"shield,omitempty"`
	Worksteps    []*Workstep    `sql:"-" json:"worksteps,omitempty"`
}

Workflow is a baseline workflow context

func CreateWorkflow

func CreateWorkflow(token string, params map[string]interface{}) (*Workflow, error)

CreateWorkflow initializes a new workflow on the local baseline stack

func ListWorkflows

func ListWorkflows(token, applicationID string, params map[string]interface{}) ([]*Workflow, error)

ListWorkflows retrieves a paginated list of baseline workflows scoped to the given API token

type Workgroup

type Workgroup struct {
	ID           *uuid.UUID     `sql:"-" json:"id,omitempty"`
	Errors       []*api.Error   `sql:"-" json:"errors,omitempty"`
	Participants []*Participant `sql:"-" json:"participants"`
	Workflows    []*Workflow    `json:"workflows,omitempty"`

	PrivacyPolicy      interface{} `json:"privacy_policy"`      // outlines data visibility rules for each participant
	SecurityPolicy     interface{} `json:"security_policy"`     // consists of authentication and authorization rules for the workgroup participants
	TokenizationPolicy interface{} `json:"tokenization_policy"` // consists of policies governing tokenization of workflow outputs
}

Workgroup is a baseline workgroup context

func CreateWorkgroup

func CreateWorkgroup(token string, params map[string]interface{}) (*Workgroup, error)

CreateWorkgroup initializes a new or previously-joined workgroup on the local baseline stack

func ListWorkgroups

func ListWorkgroups(token, applicationID string, params map[string]interface{}) ([]*Workgroup, error)

ListWorkgroups retrieves a paginated list of baseline workgroups scoped to the given API token

type Workstep

type Workstep struct {
	ID              *uuid.UUID       `sql:"-" json:"id,omitempty"`
	Circuit         *privacy.Circuit `sql:"-" json:"circuit,omitempty"`
	CircuitID       *uuid.UUID       `sql:"-" json:"circuit_id"`
	Errors          []*api.Error     `sql:"-" json:"errors,omitempty"`
	Participants    []*Participant   `sql:"-" json:"participants"`
	RequireFinality bool             `sql:"-" json:"require_finality"`
	WorkflowID      *uuid.UUID       `sql:"-" json:"workflow_id,omitempty"`
}

Workstep is a baseline workflow context

func CreateWorkstep

func CreateWorkstep(token string, params map[string]interface{}) (*Workstep, error)

CreateWorkstep initializes a new workstep on the local baseline stack

func ListWorksteps

func ListWorksteps(token, applicationID string, params map[string]interface{}) ([]*Workstep, error)

ListWorksteps retrieves a paginated list of baseline worksteps scoped to the given API token

Jump to

Keyboard shortcuts

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