v2

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package v2 provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.8.2 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateVPRequest

func NewCreateVPRequest(server string, body CreateVPJSONRequestBody) (*http.Request, error)

NewCreateVPRequest calls the generic CreateVP builder with application/json body

func NewCreateVPRequestWithBody

func NewCreateVPRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateVPRequestWithBody generates requests for CreateVP with any type of body

func NewIssueVCRequest

func NewIssueVCRequest(server string, body IssueVCJSONRequestBody) (*http.Request, error)

NewIssueVCRequest calls the generic IssueVC builder with application/json body

func NewIssueVCRequestWithBody

func NewIssueVCRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewIssueVCRequestWithBody generates requests for IssueVC with any type of body

func NewListTrustedRequest

func NewListTrustedRequest(server string, credentialType string) (*http.Request, error)

NewListTrustedRequest generates requests for ListTrusted

func NewListUntrustedRequest

func NewListUntrustedRequest(server string, credentialType string) (*http.Request, error)

NewListUntrustedRequest generates requests for ListUntrusted

func NewResolveVCRequest

func NewResolveVCRequest(server string, id string) (*http.Request, error)

NewResolveVCRequest generates requests for ResolveVC

func NewRevokeVCRequest

func NewRevokeVCRequest(server string, id string) (*http.Request, error)

NewRevokeVCRequest generates requests for RevokeVC

func NewSearchIssuedVCsRequest

func NewSearchIssuedVCsRequest(server string, params *SearchIssuedVCsParams) (*http.Request, error)

NewSearchIssuedVCsRequest generates requests for SearchIssuedVCs

func NewSearchVCsRequest

func NewSearchVCsRequest(server string, body SearchVCsJSONRequestBody) (*http.Request, error)

NewSearchVCsRequest calls the generic SearchVCs builder with application/json body

func NewSearchVCsRequestWithBody

func NewSearchVCsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewSearchVCsRequestWithBody generates requests for SearchVCs with any type of body

func NewTrustIssuerRequest

func NewTrustIssuerRequest(server string, body TrustIssuerJSONRequestBody) (*http.Request, error)

NewTrustIssuerRequest calls the generic TrustIssuer builder with application/json body

func NewTrustIssuerRequestWithBody

func NewTrustIssuerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewTrustIssuerRequestWithBody generates requests for TrustIssuer with any type of body

func NewUntrustIssuerRequest

func NewUntrustIssuerRequest(server string, body UntrustIssuerJSONRequestBody) (*http.Request, error)

NewUntrustIssuerRequest calls the generic UntrustIssuer builder with application/json body

func NewUntrustIssuerRequestWithBody

func NewUntrustIssuerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewUntrustIssuerRequestWithBody generates requests for UntrustIssuer with any type of body

func NewVerifyVCRequest

func NewVerifyVCRequest(server string, body VerifyVCJSONRequestBody) (*http.Request, error)

NewVerifyVCRequest calls the generic VerifyVC builder with application/json body

func NewVerifyVCRequestWithBody

func NewVerifyVCRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewVerifyVCRequestWithBody generates requests for VerifyVC with any type of body

func NewVerifyVPRequest

func NewVerifyVPRequest(server string, body VerifyVPJSONRequestBody) (*http.Request, error)

NewVerifyVPRequest calls the generic VerifyVP builder with application/json body

func NewVerifyVPRequestWithBody

func NewVerifyVPRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewVerifyVPRequestWithBody generates requests for VerifyVP with any type of body

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CreateVP

func (c *Client) CreateVP(ctx context.Context, body CreateVPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateVPWithBody

func (c *Client) CreateVPWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) IssueVC

func (c *Client) IssueVC(ctx context.Context, body IssueVCJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) IssueVCWithBody

func (c *Client) IssueVCWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListTrusted

func (c *Client) ListTrusted(ctx context.Context, credentialType string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListUntrusted

func (c *Client) ListUntrusted(ctx context.Context, credentialType string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ResolveVC

func (c *Client) ResolveVC(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RevokeVC

func (c *Client) RevokeVC(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SearchIssuedVCs

func (c *Client) SearchIssuedVCs(ctx context.Context, params *SearchIssuedVCsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SearchVCs

func (c *Client) SearchVCs(ctx context.Context, body SearchVCsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SearchVCsWithBody

func (c *Client) SearchVCsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) TrustIssuer

func (c *Client) TrustIssuer(ctx context.Context, body TrustIssuerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) TrustIssuerWithBody

func (c *Client) TrustIssuerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UntrustIssuer

func (c *Client) UntrustIssuer(ctx context.Context, body UntrustIssuerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UntrustIssuerWithBody

func (c *Client) UntrustIssuerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) VerifyVC

func (c *Client) VerifyVC(ctx context.Context, body VerifyVCJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) VerifyVCWithBody

func (c *Client) VerifyVCWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) VerifyVP

func (c *Client) VerifyVP(ctx context.Context, body VerifyVPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) VerifyVPWithBody

func (c *Client) VerifyVPWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// CreateVP request with any body
	CreateVPWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateVP(ctx context.Context, body CreateVPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// IssueVC request with any body
	IssueVCWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	IssueVC(ctx context.Context, body IssueVCJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SearchIssuedVCs request
	SearchIssuedVCs(ctx context.Context, params *SearchIssuedVCsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RevokeVC request
	RevokeVC(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SearchVCs request with any body
	SearchVCsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	SearchVCs(ctx context.Context, body SearchVCsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ResolveVC request
	ResolveVC(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UntrustIssuer request with any body
	UntrustIssuerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UntrustIssuer(ctx context.Context, body UntrustIssuerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// TrustIssuer request with any body
	TrustIssuerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	TrustIssuer(ctx context.Context, body TrustIssuerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// VerifyVC request with any body
	VerifyVCWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	VerifyVC(ctx context.Context, body VerifyVCJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// VerifyVP request with any body
	VerifyVPWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	VerifyVP(ctx context.Context, body VerifyVPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListTrusted request
	ListTrusted(ctx context.Context, credentialType string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListUntrusted request
	ListUntrusted(ctx context.Context, credentialType string, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateVPWithBodyWithResponse

func (c *ClientWithResponses) CreateVPWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPResponse, error)

CreateVPWithBodyWithResponse request with arbitrary body returning *CreateVPResponse

func (*ClientWithResponses) CreateVPWithResponse

func (c *ClientWithResponses) CreateVPWithResponse(ctx context.Context, body CreateVPJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPResponse, error)

func (*ClientWithResponses) IssueVCWithBodyWithResponse

func (c *ClientWithResponses) IssueVCWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IssueVCResponse, error)

IssueVCWithBodyWithResponse request with arbitrary body returning *IssueVCResponse

func (*ClientWithResponses) IssueVCWithResponse

func (c *ClientWithResponses) IssueVCWithResponse(ctx context.Context, body IssueVCJSONRequestBody, reqEditors ...RequestEditorFn) (*IssueVCResponse, error)

func (*ClientWithResponses) ListTrustedWithResponse

func (c *ClientWithResponses) ListTrustedWithResponse(ctx context.Context, credentialType string, reqEditors ...RequestEditorFn) (*ListTrustedResponse, error)

ListTrustedWithResponse request returning *ListTrustedResponse

func (*ClientWithResponses) ListUntrustedWithResponse

func (c *ClientWithResponses) ListUntrustedWithResponse(ctx context.Context, credentialType string, reqEditors ...RequestEditorFn) (*ListUntrustedResponse, error)

ListUntrustedWithResponse request returning *ListUntrustedResponse

func (*ClientWithResponses) ResolveVCWithResponse

func (c *ClientWithResponses) ResolveVCWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ResolveVCResponse, error)

ResolveVCWithResponse request returning *ResolveVCResponse

func (*ClientWithResponses) RevokeVCWithResponse

func (c *ClientWithResponses) RevokeVCWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RevokeVCResponse, error)

RevokeVCWithResponse request returning *RevokeVCResponse

func (*ClientWithResponses) SearchIssuedVCsWithResponse

func (c *ClientWithResponses) SearchIssuedVCsWithResponse(ctx context.Context, params *SearchIssuedVCsParams, reqEditors ...RequestEditorFn) (*SearchIssuedVCsResponse, error)

SearchIssuedVCsWithResponse request returning *SearchIssuedVCsResponse

func (*ClientWithResponses) SearchVCsWithBodyWithResponse

func (c *ClientWithResponses) SearchVCsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchVCsResponse, error)

SearchVCsWithBodyWithResponse request with arbitrary body returning *SearchVCsResponse

func (*ClientWithResponses) SearchVCsWithResponse

func (c *ClientWithResponses) SearchVCsWithResponse(ctx context.Context, body SearchVCsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchVCsResponse, error)

func (*ClientWithResponses) TrustIssuerWithBodyWithResponse

func (c *ClientWithResponses) TrustIssuerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TrustIssuerResponse, error)

TrustIssuerWithBodyWithResponse request with arbitrary body returning *TrustIssuerResponse

func (*ClientWithResponses) TrustIssuerWithResponse

func (c *ClientWithResponses) TrustIssuerWithResponse(ctx context.Context, body TrustIssuerJSONRequestBody, reqEditors ...RequestEditorFn) (*TrustIssuerResponse, error)

func (*ClientWithResponses) UntrustIssuerWithBodyWithResponse

func (c *ClientWithResponses) UntrustIssuerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UntrustIssuerResponse, error)

UntrustIssuerWithBodyWithResponse request with arbitrary body returning *UntrustIssuerResponse

func (*ClientWithResponses) UntrustIssuerWithResponse

func (c *ClientWithResponses) UntrustIssuerWithResponse(ctx context.Context, body UntrustIssuerJSONRequestBody, reqEditors ...RequestEditorFn) (*UntrustIssuerResponse, error)

func (*ClientWithResponses) VerifyVCWithBodyWithResponse

func (c *ClientWithResponses) VerifyVCWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyVCResponse, error)

VerifyVCWithBodyWithResponse request with arbitrary body returning *VerifyVCResponse

func (*ClientWithResponses) VerifyVCWithResponse

func (c *ClientWithResponses) VerifyVCWithResponse(ctx context.Context, body VerifyVCJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyVCResponse, error)

func (*ClientWithResponses) VerifyVPWithBodyWithResponse

func (c *ClientWithResponses) VerifyVPWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyVPResponse, error)

VerifyVPWithBodyWithResponse request with arbitrary body returning *VerifyVPResponse

func (*ClientWithResponses) VerifyVPWithResponse

func (c *ClientWithResponses) VerifyVPWithResponse(ctx context.Context, body VerifyVPJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyVPResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// CreateVP request with any body
	CreateVPWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPResponse, error)

	CreateVPWithResponse(ctx context.Context, body CreateVPJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPResponse, error)

	// IssueVC request with any body
	IssueVCWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IssueVCResponse, error)

	IssueVCWithResponse(ctx context.Context, body IssueVCJSONRequestBody, reqEditors ...RequestEditorFn) (*IssueVCResponse, error)

	// SearchIssuedVCs request
	SearchIssuedVCsWithResponse(ctx context.Context, params *SearchIssuedVCsParams, reqEditors ...RequestEditorFn) (*SearchIssuedVCsResponse, error)

	// RevokeVC request
	RevokeVCWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RevokeVCResponse, error)

	// SearchVCs request with any body
	SearchVCsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchVCsResponse, error)

	SearchVCsWithResponse(ctx context.Context, body SearchVCsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchVCsResponse, error)

	// ResolveVC request
	ResolveVCWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ResolveVCResponse, error)

	// UntrustIssuer request with any body
	UntrustIssuerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UntrustIssuerResponse, error)

	UntrustIssuerWithResponse(ctx context.Context, body UntrustIssuerJSONRequestBody, reqEditors ...RequestEditorFn) (*UntrustIssuerResponse, error)

	// TrustIssuer request with any body
	TrustIssuerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TrustIssuerResponse, error)

	TrustIssuerWithResponse(ctx context.Context, body TrustIssuerJSONRequestBody, reqEditors ...RequestEditorFn) (*TrustIssuerResponse, error)

	// VerifyVC request with any body
	VerifyVCWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyVCResponse, error)

	VerifyVCWithResponse(ctx context.Context, body VerifyVCJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyVCResponse, error)

	// VerifyVP request with any body
	VerifyVPWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyVPResponse, error)

	VerifyVPWithResponse(ctx context.Context, body VerifyVPJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyVPResponse, error)

	// ListTrusted request
	ListTrustedWithResponse(ctx context.Context, credentialType string, reqEditors ...RequestEditorFn) (*ListTrustedResponse, error)

	// ListUntrusted request
	ListUntrustedWithResponse(ctx context.Context, credentialType string, reqEditors ...RequestEditorFn) (*ListUntrustedResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateVPJSONBody

type CreateVPJSONBody CreateVPRequest

CreateVPJSONBody defines parameters for CreateVP.

type CreateVPJSONRequestBody

type CreateVPJSONRequestBody CreateVPJSONBody

CreateVPJSONRequestBody defines body for CreateVP for application/json ContentType.

type CreateVPRequest

type CreateVPRequest struct {
	// A random or pseudo-random value used by some authentication protocols to mitigate replay attacks.
	Challenge *string `json:"challenge,omitempty"`

	// A string value that specifies the operational domain of a digital proof. This could be an Internet domain
	// name like example.com, an ad-hoc value such as mycorp-level3-access, or a very specific transaction value
	// like 8zF6T$mqP. A signer could include a domain in its digital proof to restrict its use to particular
	// target, identified by the specified domain.
	Domain *string `json:"domain,omitempty"`

	// Date and time at which proof will expire. If omitted, the proof does not have an end date.
	Expires *time.Time `json:"expires,omitempty"`

	// The specific intent for the proof, the reason why an entity created it. Acts as a safeguard to prevent the
	// proof from being misused for a purpose other than the one it was intended for.
	ProofPurpose *string `json:"proofPurpose,omitempty"`

	// Specifies the DID of the signing party that must be used to create the digital signature.
	// If not specified, it is derived from the given Verifiable Credentials' subjectCredential ID.
	// It can only be derived if all given Verifiable Credentials have the same, single subjectCredential.
	SignerDID             *string                `json:"signerDID,omitempty"`
	VerifiableCredentials []VerifiableCredential `json:"verifiableCredentials"`
}

A request for creating a new Verifiable Presentation for a set of Verifiable Credentials.

type CreateVPResponse

type CreateVPResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *VerifiablePresentation
}

func ParseCreateVPResponse

func ParseCreateVPResponse(rsp *http.Response) (*CreateVPResponse, error)

ParseCreateVPResponse parses an HTTP response from a CreateVPWithResponse call

func (CreateVPResponse) Status

func (r CreateVPResponse) Status() string

Status returns HTTPResponse.Status

func (CreateVPResponse) StatusCode

func (r CreateVPResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CredentialIssuer

type CredentialIssuer struct {
	// a credential type
	CredentialType string `json:"credentialType"`

	// the DID of an issuer
	Issuer string `json:"issuer"`
}

CredentialIssuer defines model for CredentialIssuer.

type CredentialSubject

type CredentialSubject = interface{}

CredentialSubject is an alias to use from within the API

type DID

type DID string

DID according to Nuts specification

type EchoRouter

type EchoRouter interface {
	Add(method string, path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type EmbeddedProof

type EmbeddedProof struct {
	// A random or pseudo-random value, provided by the verifier, used by some authentication protocols to
	// mitigate replay attacks.
	Challenge *string `json:"challenge,omitempty"`

	// Date and time at which proof has been created.
	Created time.Time `json:"created"`

	// A string value that specifies the operational domain of a digital proof. This could be an Internet domain
	// name like example.com, an ad-hoc value such as mycorp-level3-access, or a very specific transaction value
	// like 8zF6T$mqP. A signer could include a domain in its digital proof to restrict its use to particular
	// target, identified by the specified domain.
	Domain *string `json:"domain,omitempty"`

	// JSON Web Signature
	Jws string `json:"jws"`

	// A unique string value generated by the holder, MUST only be used once for a particular domain
	// and window of time. This value can be used to mitigate replay attacks.
	Nonce *string `json:"nonce,omitempty"`

	// It expresses the purpose of the proof and ensures the information is protected by the
	// signature.
	ProofPurpose string `json:"proofPurpose"`

	// Type of the object or the datatype of the typed value. Currently only supported value is "JsonWebSignature2020".
	Type string `json:"type"`

	// Specifies the public key that can be used to verify the digital signature.
	// Dereferencing a public key URL reveals information about the controller of the key,
	// which can be checked against the issuer of the credential.
	VerificationMethod string `json:"verificationMethod"`
}

Cryptographic proofs that can be used to detect tampering and verify the authorship of a credential or presentation. An embedded proof is a mechanism where the proof is included in the data, such as a Linked Data Signature.

type ErrorStatusCodeResolver

type ErrorStatusCodeResolver interface {
	ResolveStatusCode(err error) int
}

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type IssueVCJSONBody

type IssueVCJSONBody IssueVCRequest

IssueVCJSONBody defines parameters for IssueVC.

type IssueVCJSONRequestBody

type IssueVCJSONRequestBody IssueVCJSONBody

IssueVCJSONRequestBody defines body for IssueVC for application/json ContentType.

type IssueVCRequest

type IssueVCRequest struct {
	// The resolvable context of the credentialSubject as URI. If omitted, the "https://nuts.nl/credentials/v1" context is used.
	// Note: it is not needed to provide the "https://www.w3.org/2018/credentials/v1" context here.
	Context *string `json:"@context,omitempty"`

	// Subject of a Verifiable Credential identifying the holder and expressing claims.
	CredentialSubject CredentialSubject `json:"credentialSubject"`

	// rfc3339 time string until when the credential is valid.
	ExpirationDate *string `json:"expirationDate,omitempty"`

	// DID according to Nuts specification.
	Issuer string `json:"issuer"`

	// If set, the node publishes this credential to the network. This is the default behaviour.
	// When set to false, the caller is responsible for distributing the VC to a holder. When the issuer is
	// also the holder, it then can be used to directly create a presentation (self issued).
	// Note: a not published credential can still be publicaly revoked.
	PublishToNetwork *bool `json:"publishToNetwork,omitempty"`

	// Type definition for the credential.
	Type string `json:"type"`

	// When publishToNetwork is true, the credential can be published publicly or privately to the holder.
	// This field is mandatory if publishToNetwork is true to prevent accidents. It defaults to "private".
	Visibility *IssueVCRequestVisibility `json:"visibility,omitempty"`
}

A request for issuing a new Verifiable Credential.

type IssueVCRequestVisibility

type IssueVCRequestVisibility string

When publishToNetwork is true, the credential can be published publicly or privately to the holder. This field is mandatory if publishToNetwork is true to prevent accidents. It defaults to "private".

const (
	IssueVCRequestVisibilityPrivate IssueVCRequestVisibility = "private"

	IssueVCRequestVisibilityPublic IssueVCRequestVisibility = "public"
)

Defines values for IssueVCRequestVisibility.

type IssueVCResponse

type IssueVCResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *VerifiableCredential
}

func ParseIssueVCResponse

func ParseIssueVCResponse(rsp *http.Response) (*IssueVCResponse, error)

ParseIssueVCResponse parses an HTTP response from a IssueVCWithResponse call

func (IssueVCResponse) Status

func (r IssueVCResponse) Status() string

Status returns HTTPResponse.Status

func (IssueVCResponse) StatusCode

func (r IssueVCResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListTrustedResponse

type ListTrustedResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]DID
}

func ParseListTrustedResponse

func ParseListTrustedResponse(rsp *http.Response) (*ListTrustedResponse, error)

ParseListTrustedResponse parses an HTTP response from a ListTrustedWithResponse call

func (ListTrustedResponse) Status

func (r ListTrustedResponse) Status() string

Status returns HTTPResponse.Status

func (ListTrustedResponse) StatusCode

func (r ListTrustedResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListUntrustedResponse

type ListUntrustedResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]DID
}

func ParseListUntrustedResponse

func ParseListUntrustedResponse(rsp *http.Response) (*ListUntrustedResponse, error)

ParseListUntrustedResponse parses an HTTP response from a ListUntrustedWithResponse call

func (ListUntrustedResponse) Status

func (r ListUntrustedResponse) Status() string

Status returns HTTPResponse.Status

func (ListUntrustedResponse) StatusCode

func (r ListUntrustedResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Preprocessor

type Preprocessor interface {
	Preprocess(operationID string, context echo.Context)
}

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ResolveVCResponse

type ResolveVCResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *VerifiableCredential
}

func ParseResolveVCResponse

func ParseResolveVCResponse(rsp *http.Response) (*ResolveVCResponse, error)

ParseResolveVCResponse parses an HTTP response from a ResolveVCWithResponse call

func (ResolveVCResponse) Status

func (r ResolveVCResponse) Status() string

Status returns HTTPResponse.Status

func (ResolveVCResponse) StatusCode

func (r ResolveVCResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Revocation

type Revocation = credential.Revocation

Revocation is an alias to use from within the API

type RevokeVCResponse

type RevokeVCResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Revocation
}

func ParseRevokeVCResponse

func ParseRevokeVCResponse(rsp *http.Response) (*RevokeVCResponse, error)

ParseRevokeVCResponse parses an HTTP response from a RevokeVCWithResponse call

func (RevokeVCResponse) Status

func (r RevokeVCResponse) Status() string

Status returns HTTPResponse.Status

func (RevokeVCResponse) StatusCode

func (r RevokeVCResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SearchIssuedVCsParams

type SearchIssuedVCsParams struct {
	// The type of the credential
	CredentialType string `json:"credentialType"`

	// the DID of the issuer
	Issuer string `json:"issuer"`

	// the URI which indicates the subject (usually a DID)
	Subject *string `json:"subject,omitempty"`
}

SearchIssuedVCsParams defines parameters for SearchIssuedVCs.

type SearchIssuedVCsResponse

type SearchIssuedVCsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SearchVCResults
}

func ParseSearchIssuedVCsResponse

func ParseSearchIssuedVCsResponse(rsp *http.Response) (*SearchIssuedVCsResponse, error)

ParseSearchIssuedVCsResponse parses an HTTP response from a SearchIssuedVCsWithResponse call

func (SearchIssuedVCsResponse) Status

func (r SearchIssuedVCsResponse) Status() string

Status returns HTTPResponse.Status

func (SearchIssuedVCsResponse) StatusCode

func (r SearchIssuedVCsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SearchOptions

type SearchOptions struct {
	// If set to true, VCs from an untrusted issuer are returned.
	AllowUntrustedIssuer *bool `json:"allowUntrustedIssuer,omitempty"`
}

SearchOptions defines model for SearchOptions.

type SearchVCRequest

type SearchVCRequest struct {
	// A partial VerifiableCredential in JSON-LD format. Each field will be used to match credentials against. All fields MUST be present.
	Query         vc.VerifiableCredential `json:"query"`
	SearchOptions *SearchOptions          `json:"searchOptions,omitempty"`
}

SearchVCRequest is the request body for searching VCs

type SearchVCResult

type SearchVCResult struct {
	// Credential revocation record
	Revocation *Revocation `json:"revocation,omitempty"`

	// A credential according to the W3C and Nuts specs.
	VerifiableCredential VerifiableCredential `json:"verifiableCredential"`
}

result of a Search operation.

type SearchVCResults

type SearchVCResults struct {
	VerifiableCredentials []SearchVCResult `json:"verifiableCredentials"`
}

result of a Search operation.

type SearchVCsJSONBody

type SearchVCsJSONBody SearchVCRequest

SearchVCsJSONBody defines parameters for SearchVCs.

type SearchVCsJSONRequestBody

type SearchVCsJSONRequestBody SearchVCsJSONBody

SearchVCsJSONRequestBody defines body for SearchVCs for application/json ContentType.

type SearchVCsResponse

type SearchVCsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SearchVCResults
}

func ParseSearchVCsResponse

func ParseSearchVCsResponse(rsp *http.Response) (*SearchVCsResponse, error)

ParseSearchVCsResponse parses an HTTP response from a SearchVCsWithResponse call

func (SearchVCsResponse) Status

func (r SearchVCsResponse) Status() string

Status returns HTTPResponse.Status

func (SearchVCsResponse) StatusCode

func (r SearchVCsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ServerInterface

type ServerInterface interface {
	// Create a new Verifiable Presentation for a set of Verifiable Credentials.
	// (POST /internal/vcr/v2/holder/vp)
	CreateVP(ctx echo.Context) error
	// Issues a new Verifiable Credential
	// (POST /internal/vcr/v2/issuer/vc)
	IssueVC(ctx echo.Context) error
	// Searches for verifiable credentials issued by this node which matches the search params
	// (GET /internal/vcr/v2/issuer/vc/search)
	SearchIssuedVCs(ctx echo.Context, params SearchIssuedVCsParams) error
	// Revoke an issued credential
	// (DELETE /internal/vcr/v2/issuer/vc/{id})
	RevokeVC(ctx echo.Context, id string) error
	// Searches for verifiable credentials that could be used for different use-cases.
	// (POST /internal/vcr/v2/search)
	SearchVCs(ctx echo.Context) error
	// Resolves a verifiable credential
	// (GET /internal/vcr/v2/vc/{id})
	ResolveVC(ctx echo.Context, id string) error
	// Remove trust in an issuer/credentialType combination
	// (DELETE /internal/vcr/v2/verifier/trust)
	UntrustIssuer(ctx echo.Context) error
	// Mark all the VCs of given type and issuer as 'trusted'.
	// (POST /internal/vcr/v2/verifier/trust)
	TrustIssuer(ctx echo.Context) error
	// Verifies a Verifiable Credential
	// (POST /internal/vcr/v2/verifier/vc)
	VerifyVC(ctx echo.Context) error
	// Verifies a Verifiable Presentation
	// (POST /internal/vcr/v2/verifier/vp)
	VerifyVP(ctx echo.Context) error
	// List all trusted issuers for a given credential type
	// (GET /internal/vcr/v2/verifier/{credentialType}/trusted)
	ListTrusted(ctx echo.Context, credentialType string) error
	// List all untrusted issuers for a given credential type
	// (GET /internal/vcr/v2/verifier/{credentialType}/untrusted)
	ListUntrusted(ctx echo.Context, credentialType string) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateVP

func (w *ServerInterfaceWrapper) CreateVP(ctx echo.Context) error

CreateVP converts echo context to params.

func (*ServerInterfaceWrapper) IssueVC

func (w *ServerInterfaceWrapper) IssueVC(ctx echo.Context) error

IssueVC converts echo context to params.

func (*ServerInterfaceWrapper) ListTrusted

func (w *ServerInterfaceWrapper) ListTrusted(ctx echo.Context) error

ListTrusted converts echo context to params.

func (*ServerInterfaceWrapper) ListUntrusted

func (w *ServerInterfaceWrapper) ListUntrusted(ctx echo.Context) error

ListUntrusted converts echo context to params.

func (*ServerInterfaceWrapper) ResolveVC

func (w *ServerInterfaceWrapper) ResolveVC(ctx echo.Context) error

ResolveVC converts echo context to params.

func (*ServerInterfaceWrapper) RevokeVC

func (w *ServerInterfaceWrapper) RevokeVC(ctx echo.Context) error

RevokeVC converts echo context to params.

func (*ServerInterfaceWrapper) SearchIssuedVCs

func (w *ServerInterfaceWrapper) SearchIssuedVCs(ctx echo.Context) error

SearchIssuedVCs converts echo context to params.

func (*ServerInterfaceWrapper) SearchVCs

func (w *ServerInterfaceWrapper) SearchVCs(ctx echo.Context) error

SearchVCs converts echo context to params.

func (*ServerInterfaceWrapper) TrustIssuer

func (w *ServerInterfaceWrapper) TrustIssuer(ctx echo.Context) error

TrustIssuer converts echo context to params.

func (*ServerInterfaceWrapper) UntrustIssuer

func (w *ServerInterfaceWrapper) UntrustIssuer(ctx echo.Context) error

UntrustIssuer converts echo context to params.

func (*ServerInterfaceWrapper) VerifyVC

func (w *ServerInterfaceWrapper) VerifyVC(ctx echo.Context) error

VerifyVC converts echo context to params.

func (*ServerInterfaceWrapper) VerifyVP

func (w *ServerInterfaceWrapper) VerifyVP(ctx echo.Context) error

VerifyVP converts echo context to params.

type TrustIssuerJSONBody

type TrustIssuerJSONBody CredentialIssuer

TrustIssuerJSONBody defines parameters for TrustIssuer.

type TrustIssuerJSONRequestBody

type TrustIssuerJSONRequestBody TrustIssuerJSONBody

TrustIssuerJSONRequestBody defines body for TrustIssuer for application/json ContentType.

type TrustIssuerResponse

type TrustIssuerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseTrustIssuerResponse

func ParseTrustIssuerResponse(rsp *http.Response) (*TrustIssuerResponse, error)

ParseTrustIssuerResponse parses an HTTP response from a TrustIssuerWithResponse call

func (TrustIssuerResponse) Status

func (r TrustIssuerResponse) Status() string

Status returns HTTPResponse.Status

func (TrustIssuerResponse) StatusCode

func (r TrustIssuerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UntrustIssuerJSONBody

type UntrustIssuerJSONBody CredentialIssuer

UntrustIssuerJSONBody defines parameters for UntrustIssuer.

type UntrustIssuerJSONRequestBody

type UntrustIssuerJSONRequestBody UntrustIssuerJSONBody

UntrustIssuerJSONRequestBody defines body for UntrustIssuer for application/json ContentType.

type UntrustIssuerResponse

type UntrustIssuerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseUntrustIssuerResponse

func ParseUntrustIssuerResponse(rsp *http.Response) (*UntrustIssuerResponse, error)

ParseUntrustIssuerResponse parses an HTTP response from a UntrustIssuerWithResponse call

func (UntrustIssuerResponse) Status

func (r UntrustIssuerResponse) Status() string

Status returns HTTPResponse.Status

func (UntrustIssuerResponse) StatusCode

func (r UntrustIssuerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VCVerificationOptions

type VCVerificationOptions struct {
	// If set to true, an untrusted credential issuer is alowed.
	AllowUntrustedIssuer *bool `json:"allowUntrustedIssuer,omitempty"`
}

VCVerificationOptions defines model for VCVerificationOptions.

type VCVerificationRequest

type VCVerificationRequest struct {
	// A credential according to the W3C and Nuts specs.
	VerifiableCredential VerifiableCredential   `json:"verifiableCredential"`
	VerificationOptions  *VCVerificationOptions `json:"verificationOptions,omitempty"`
}

VCVerificationRequest defines model for VCVerificationRequest.

type VCVerificationResult

type VCVerificationResult struct {
	// Indicates what went wrong
	Message *string `json:"message,omitempty"`

	// Indicates the validity of the signature, issuer and revocation state.
	Validity bool `json:"validity"`
}

Contains the verifiable credential verification result.

type VPVerificationRequest

type VPVerificationRequest struct {
	// Date and time at which the VP should be valid. If not supplied, the current date/time is used.
	ValidAt *time.Time `json:"validAt,omitempty"`

	// Verifiable Presentation
	VerifiablePresentation VerifiablePresentation `json:"verifiablePresentation"`

	// Indicates whether the Verifiable Credentials within the VP must be verified, default true.
	VerifyCredentials *bool `json:"verifyCredentials,omitempty"`
}

VPVerificationRequest defines model for VPVerificationRequest.

type VPVerificationResult

type VPVerificationResult struct {
	// If the VP is valid, it will contain the credentials inside the VP.
	Credentials *[]VerifiableCredential `json:"credentials,omitempty"`

	// Indicates what went wrong
	Message *string `json:"message,omitempty"`

	// Indicates the validity of the signature, issuer and revocation state.
	Validity bool `json:"validity"`
}

Contains the verifiable presentation verification result.

type VerifiableCredential

type VerifiableCredential = vc.VerifiableCredential

VerifiableCredential is an alias to use from within the API

type VerifiablePresentation

type VerifiablePresentation = vc.VerifiablePresentation

VerifiablePresentation is an alias to use from within the API

type VerifyVCJSONBody

type VerifyVCJSONBody VCVerificationRequest

VerifyVCJSONBody defines parameters for VerifyVC.

type VerifyVCJSONRequestBody

type VerifyVCJSONRequestBody VerifyVCJSONBody

VerifyVCJSONRequestBody defines body for VerifyVC for application/json ContentType.

type VerifyVCResponse

type VerifyVCResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *VCVerificationResult
}

func ParseVerifyVCResponse

func ParseVerifyVCResponse(rsp *http.Response) (*VerifyVCResponse, error)

ParseVerifyVCResponse parses an HTTP response from a VerifyVCWithResponse call

func (VerifyVCResponse) Status

func (r VerifyVCResponse) Status() string

Status returns HTTPResponse.Status

func (VerifyVCResponse) StatusCode

func (r VerifyVCResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VerifyVPJSONBody

type VerifyVPJSONBody VPVerificationRequest

VerifyVPJSONBody defines parameters for VerifyVP.

type VerifyVPJSONRequestBody

type VerifyVPJSONRequestBody VerifyVPJSONBody

VerifyVPJSONRequestBody defines body for VerifyVP for application/json ContentType.

type VerifyVPResponse

type VerifyVPResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *VPVerificationResult
}

func ParseVerifyVPResponse

func ParseVerifyVPResponse(rsp *http.Response) (*VerifyVPResponse, error)

ParseVerifyVPResponse parses an HTTP response from a VerifyVPWithResponse call

func (VerifyVPResponse) Status

func (r VerifyVPResponse) Status() string

Status returns HTTPResponse.Status

func (VerifyVPResponse) StatusCode

func (r VerifyVPResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Wrapper

type Wrapper struct {
	CredentialResolver issuer.CredentialSearcher
	VCR                vcr.VCR
}

Wrapper implements the generated interface from oapi-codegen It parses and checks the params. Handles errors and returns the appropriate response.

func (*Wrapper) CreateVP

func (w *Wrapper) CreateVP(ctx echo.Context) error

CreateVP handles API request to create a Verifiable Presentation for one or more Verifiable Credentials.

func (Wrapper) IssueVC

func (w Wrapper) IssueVC(ctx echo.Context) error

IssueVC handles the API request for credential issuing.

func (*Wrapper) ListTrusted

func (w *Wrapper) ListTrusted(ctx echo.Context, credentialType string) error

ListTrusted handles API request list all trusted issuers.

func (*Wrapper) ListUntrusted

func (w *Wrapper) ListUntrusted(ctx echo.Context, credentialType string) error

ListUntrusted handles API request list all untrusted issuers, which have issued Verifiable Credentials.

func (*Wrapper) Preprocess

func (w *Wrapper) Preprocess(operationID string, context echo.Context)

Preprocess is called just before the API operation itself is invoked.

func (*Wrapper) ResolveStatusCode

func (w *Wrapper) ResolveStatusCode(err error) int

ResolveStatusCode maps errors returned by this API to specific HTTP status codes.

func (*Wrapper) ResolveVC

func (w *Wrapper) ResolveVC(ctx echo.Context, id string) error

ResolveVC handles the API request for resolving a VC

func (Wrapper) RevokeVC

func (w Wrapper) RevokeVC(ctx echo.Context, id string) error

RevokeVC handles the API request for revoking a credential.

func (*Wrapper) Routes

func (w *Wrapper) Routes(router core.EchoRouter)

Routes registers the handler to the echo router

func (*Wrapper) SearchIssuedVCs

func (w *Wrapper) SearchIssuedVCs(ctx echo.Context, params SearchIssuedVCsParams) error

SearchIssuedVCs handles the API request for searching for issued VCs

func (*Wrapper) SearchVCs

func (w *Wrapper) SearchVCs(ctx echo.Context) error

SearchVCs checks the context used in the JSON-LD query, based on the contents it maps to a non-JSON-LD query After V1, this needs to be remapped to a DB search that supports native JSON-LD

func (*Wrapper) TrustIssuer

func (w *Wrapper) TrustIssuer(ctx echo.Context) error

TrustIssuer handles API request to start trusting an issuer of a Verifiable Credential.

func (*Wrapper) UntrustIssuer

func (w *Wrapper) UntrustIssuer(ctx echo.Context) error

UntrustIssuer handles API request to stop trusting an issuer of a Verifiable Credential.

func (*Wrapper) VerifyVC

func (w *Wrapper) VerifyVC(ctx echo.Context) error

VerifyVC handles API request to verify a Verifiable Credential.

func (*Wrapper) VerifyVP

func (w *Wrapper) VerifyVP(ctx echo.Context) error

VerifyVP handles API request to verify a Verifiable Presentation.

Jump to

Keyboard shortcuts

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