signatures

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignRequest

func SignRequest(reqData any) (req signedRequest, err error)

func UnmarshalSigned

func UnmarshalSigned[PayloadType ContainsClientID](ctx context.Context, body io.Reader) (PayloadType, error)

Types

type ContainsClientID

type ContainsClientID interface {
	GetClientID() string
}

type SignedRequest

type SignedRequest[PayloadType ContainsClientID] struct {
	// The data needed to cancel a running job on the network
	Payload PayloadType `json:"payload" validate:"required"`

	// A base64-encoded signature of the data, signed by the client:
	ClientSignature string `json:"signature" validate:"required"`

	// The base64-encoded public key of the client:
	ClientPublicKey string `json:"client_public_key" validate:"required"`
}

A strongly-typed signed request. We use this type only in our documentation to allow clients to understand the correct type of the payload.

Jump to

Keyboard shortcuts

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