decorator

package
Version: v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 11 Imported by: 23

Documentation

Index

Constants

View Source
const (
	// TransportReturnRouteNone return route option none.
	TransportReturnRouteNone = "none"

	// TransportReturnRouteAll return route option all.
	TransportReturnRouteAll = "all"

	// TransportReturnRouteThread return route option thread.
	TransportReturnRouteThread = "thread"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment added in v0.1.2

type Attachment struct {
	// ID is a JSON-LD construct that uniquely identifies attached content within the scope of a given message.
	// Recommended on appended attachment descriptors. Possible but generally unused on embedded attachment descriptors.
	// Never required if no references to the attachment exist; if omitted, then there is no way
	// to refer to the attachment later in the thread, in error messages, and so forth.
	// Because @id is used to compose URIs, it is recommended that this name be brief and avoid spaces
	// and other characters that require URI escaping.
	ID string `json:"@id,omitempty"`
	// Description is an optional human-readable description of the content.
	Description string `json:"description,omitempty"`
	// FileName is a hint about the name that might be used if this attachment is persisted as a file.
	// It is not required, and need not be unique. If this field is present and mime-type is not,
	// the extension on the filename may be used to infer a MIME type.
	FileName string `json:"filename,omitempty"`
	// MimeType describes the MIME type of the attached content. Optional but recommended.
	MimeType string `json:"mime-type,omitempty"`
	// LastModTime is a hint about when the content in this attachment was last modified.
	LastModTime time.Time `json:"lastmod_time,omitempty"`
	// ByteCount is an optional, and mostly relevant when content is included by reference instead of by value.
	// Lets the receiver guess how expensive it will be, in time, bandwidth, and storage, to fully fetch the attachment.
	ByteCount int64 `json:"byte_count,omitempty"`
	// Data is a JSON object that gives access to the actual content of the attachment.
	Data AttachmentData `json:"data,omitempty"`
}

Attachment is intended to provide the possibility to include files, links or even JSON payload to the message. To find out more please visit https://github.com/hyperledger/aries-rfcs/tree/master/concepts/0017-attachments

type AttachmentData added in v0.1.2

type AttachmentData struct {
	// Sha256 is a hash of the content. Optional. Used as an integrity check if content is inlined.
	// if content is only referenced, then including this field makes the content tamper-evident.
	// This may be redundant, if the content is stored in an inherently immutable container like
	// content-addressable storage. This may also be undesirable, if dynamic content at a specified
	// link is beneficial. Including a hash without including a way to fetch the content via link
	// is a form of proof of existence.
	Sha256 string `json:"sha256,omitempty"`
	// Links is a list of zero or more locations at which the content may be fetched.
	Links []string `json:"links,omitempty"`
	// Base64 encoded data, when representing arbitrary content inline instead of via links. Optional.
	Base64 string `json:"base64,omitempty"`
	// JSON is a directly embedded JSON data, when representing content inline instead of via links,
	// and when the content is natively conveyable as JSON. Optional.
	JSON interface{} `json:"json,omitempty"`
	// JWS is a JSON web signature over the encoded data, in detached format.
	JWS json.RawMessage `json:"jws,omitempty"`
}

AttachmentData contains attachment payload.

func (*AttachmentData) Fetch added in v0.1.3

func (d *AttachmentData) Fetch() ([]byte, error)

Fetch this attachment's contents.

func (*AttachmentData) Sign added in v0.1.7

func (d *AttachmentData) Sign(c crypto.Crypto, kh, pub interface{}, pubBytes []byte) error

Sign signs the base64 payload of the AttachmentData, and adds the signature to the attachment.

func (*AttachmentData) Verify added in v0.1.7

func (d *AttachmentData) Verify(c crypto.Crypto, keyManager kms.KeyManager) error

Verify verifies the signature on the attachment data.

type AttachmentV2 added in v0.1.7

type AttachmentV2 struct {
	// ID is a JSON-LD construct that uniquely identifies attached content within the scope of a given message.
	// Recommended on appended attachment descriptors. Possible but generally unused on embedded attachment descriptors.
	// Never required if no references to the attachment exist; if omitted, then there is no way
	// to refer to the attachment later in the thread, in error messages, and so forth.
	// Because @id is used to compose URIs, it is recommended that this name be brief and avoid spaces
	// and other characters that require URI escaping.
	ID string `json:"id,omitempty"`
	// Description is an optional human-readable description of the content.
	Description string `json:"description,omitempty"`
	// FileName is a hint about the name that might be used if this attachment is persisted as a file.
	// It is not required, and need not be unique. If this field is present and mime-type is not,
	// the extension on the filename may be used to infer a MIME type.
	FileName string `json:"filename,omitempty"`
	// MediaType describes the MIME type of the attached content. Optional but recommended.
	MediaType string `json:"media_type,omitempty"`
	// LastModTime is a hint about when the content in this attachment was last modified.
	LastModTime time.Time `json:"lastmod_time,omitempty"`
	// ByteCount is an optional, and mostly relevant when content is included by reference instead of by value.
	// Lets the receiver guess how expensive it will be, in time, bandwidth, and storage, to fully fetch the attachment.
	ByteCount int64 `json:"byte_count,omitempty"`
	// Data is a JSON object that gives access to the actual content of the attachment.
	Data AttachmentData `json:"data,omitempty"`
	// Format describes the format of the attachment if the media_type is not sufficient.
	Format string `json:"format,omitempty"`
}

AttachmentV2 is intended to provide the possibility to include files, links or even JSON payload to the message. To find out more please visit https://identity.foundation/didcomm-messaging/spec/#attachments

type ReturnRoute added in v0.1.1

type ReturnRoute struct {
	Value string `json:"~return_route,omitempty"`
}

ReturnRoute works with Transport decorator. Acceptable values - "none", "all" or "thread".

type Thread

type Thread struct {
	ID             string         `json:"thid,omitempty"`
	PID            string         `json:"pthid,omitempty"`
	SenderOrder    int            `json:"sender_order,omitempty"`
	ReceivedOrders map[string]int `json:"received_orders,omitempty"`
}

Thread thread data.

type Timing

type Timing struct {
	ExpiresTime time.Time `json:"expires_time,omitempty"`
}

Timing keeps expiration time.

type Transport added in v0.1.1

type Transport struct {
	ReturnRoute *ReturnRoute `json:"~transport,omitempty"`
}

Transport transport decorator https://github.com/hyperledger/aries-rfcs/tree/master/features/0092-transport-return-route

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL