v1

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: 22 Imported by: 0

Documentation

Overview

Package v1 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 NewCreateAccessTokenRequestWithBody

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

NewCreateAccessTokenRequestWithBody generates requests for CreateAccessToken with any type of body

func NewCreateJwtGrantRequest

func NewCreateJwtGrantRequest(server string, body CreateJwtGrantJSONRequestBody) (*http.Request, error)

NewCreateJwtGrantRequest calls the generic CreateJwtGrant builder with application/json body

func NewCreateJwtGrantRequestWithBody

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

NewCreateJwtGrantRequestWithBody generates requests for CreateJwtGrant with any type of body

func NewCreateSignSessionRequest

func NewCreateSignSessionRequest(server string, body CreateSignSessionJSONRequestBody) (*http.Request, error)

NewCreateSignSessionRequest calls the generic CreateSignSession builder with application/json body

func NewCreateSignSessionRequestWithBody

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

NewCreateSignSessionRequestWithBody generates requests for CreateSignSession with any type of body

func NewDrawUpContractRequest

func NewDrawUpContractRequest(server string, body DrawUpContractJSONRequestBody) (*http.Request, error)

NewDrawUpContractRequest calls the generic DrawUpContract builder with application/json body

func NewDrawUpContractRequestWithBody

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

NewDrawUpContractRequestWithBody generates requests for DrawUpContract with any type of body

func NewGetContractByTypeRequest

func NewGetContractByTypeRequest(server string, contractType string, params *GetContractByTypeParams) (*http.Request, error)

NewGetContractByTypeRequest generates requests for GetContractByType

func NewGetSignSessionStatusRequest

func NewGetSignSessionStatusRequest(server string, sessionID string) (*http.Request, error)

NewGetSignSessionStatusRequest generates requests for GetSignSessionStatus

func NewIntrospectAccessTokenRequestWithBody

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

NewIntrospectAccessTokenRequestWithBody generates requests for IntrospectAccessToken with any type of body

func NewRequestAccessTokenRequest

func NewRequestAccessTokenRequest(server string, body RequestAccessTokenJSONRequestBody) (*http.Request, error)

NewRequestAccessTokenRequest calls the generic RequestAccessToken builder with application/json body

func NewRequestAccessTokenRequestWithBody

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

NewRequestAccessTokenRequestWithBody generates requests for RequestAccessToken with any type of body

func NewVerifyAccessTokenRequest

func NewVerifyAccessTokenRequest(server string, params *VerifyAccessTokenParams) (*http.Request, error)

NewVerifyAccessTokenRequest generates requests for VerifyAccessToken

func NewVerifySignatureRequest

func NewVerifySignatureRequest(server string, body VerifySignatureJSONRequestBody) (*http.Request, error)

NewVerifySignatureRequest calls the generic VerifySignature builder with application/json body

func NewVerifySignatureRequestWithBody

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

NewVerifySignatureRequestWithBody generates requests for VerifySignature 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 AccessTokenRequestFailedResponse

type AccessTokenRequestFailedResponse struct {
	Error AccessTokenRequestFailedResponseError `json:"error"`

	// Human-readable ASCII text providing additional information, used to assist the client developer in understanding the error that occurred.
	ErrorDescription string `json:"error_description"`
}

Error response when access token request fails as described in rfc6749 sectionn 5.2

type AccessTokenRequestFailedResponseError

type AccessTokenRequestFailedResponseError string

AccessTokenRequestFailedResponseError defines model for AccessTokenRequestFailedResponse.Error.

const (
	AccessTokenRequestFailedResponseErrorInvalidGrant AccessTokenRequestFailedResponseError = "invalid_grant"

	AccessTokenRequestFailedResponseErrorInvalidRequest AccessTokenRequestFailedResponseError = "invalid_request"

	AccessTokenRequestFailedResponseErrorUnsupportedGrantType AccessTokenRequestFailedResponseError = "unsupported_grant_type"
)

Defines values for AccessTokenRequestFailedResponseError.

type AccessTokenResponse

type AccessTokenResponse struct {
	// The access token issued by the authorization server.
	// Could be a signed JWT or a random number. It should not have a meaning to the client.
	AccessToken string `json:"access_token"`

	// The lifetime in seconds of the access token.
	ExpiresIn int `json:"expires_in"`

	// The type of the token issued
	TokenType string `json:"token_type"`
}

Successful response as described in rfc6749 section 5.1

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) CreateAccessTokenWithBody

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

func (*Client) CreateJwtGrant

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

func (*Client) CreateJwtGrantWithBody

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

func (*Client) CreateSignSession

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

func (*Client) CreateSignSessionWithBody

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

func (*Client) DrawUpContract

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

func (*Client) DrawUpContractWithBody

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

func (*Client) GetContractByType

func (c *Client) GetContractByType(ctx context.Context, contractType string, params *GetContractByTypeParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSignSessionStatus

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

func (*Client) IntrospectAccessTokenWithBody

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

func (*Client) RequestAccessToken

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

func (*Client) RequestAccessTokenWithBody

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

func (*Client) VerifyAccessToken

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

func (*Client) VerifySignature

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

func (*Client) VerifySignatureWithBody

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

type ClientInterface

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

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

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

	DrawUpContract(ctx context.Context, body DrawUpContractJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	CreateJwtGrant(ctx context.Context, body CreateJwtGrantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	RequestAccessToken(ctx context.Context, body RequestAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	CreateSignSession(ctx context.Context, body CreateSignSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	VerifySignature(ctx context.Context, body VerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// GetContractByType request
	GetContractByType(ctx context.Context, contractType string, params *GetContractByTypeParams, 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) CreateAccessTokenWithBodyWithResponse

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

CreateAccessTokenWithBodyWithResponse request with arbitrary body returning *CreateAccessTokenResponse

func (*ClientWithResponses) CreateJwtGrantWithBodyWithResponse

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

CreateJwtGrantWithBodyWithResponse request with arbitrary body returning *CreateJwtGrantResponse

func (*ClientWithResponses) CreateJwtGrantWithResponse

func (c *ClientWithResponses) CreateJwtGrantWithResponse(ctx context.Context, body CreateJwtGrantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateJwtGrantResponse, error)

func (*ClientWithResponses) CreateSignSessionWithBodyWithResponse

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

CreateSignSessionWithBodyWithResponse request with arbitrary body returning *CreateSignSessionResponse

func (*ClientWithResponses) CreateSignSessionWithResponse

func (c *ClientWithResponses) CreateSignSessionWithResponse(ctx context.Context, body CreateSignSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSignSessionResponse, error)

func (*ClientWithResponses) DrawUpContractWithBodyWithResponse

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

DrawUpContractWithBodyWithResponse request with arbitrary body returning *DrawUpContractResponse

func (*ClientWithResponses) DrawUpContractWithResponse

func (c *ClientWithResponses) DrawUpContractWithResponse(ctx context.Context, body DrawUpContractJSONRequestBody, reqEditors ...RequestEditorFn) (*DrawUpContractResponse, error)

func (*ClientWithResponses) GetContractByTypeWithResponse

func (c *ClientWithResponses) GetContractByTypeWithResponse(ctx context.Context, contractType string, params *GetContractByTypeParams, reqEditors ...RequestEditorFn) (*GetContractByTypeResponse, error)

GetContractByTypeWithResponse request returning *GetContractByTypeResponse

func (*ClientWithResponses) GetSignSessionStatusWithResponse

func (c *ClientWithResponses) GetSignSessionStatusWithResponse(ctx context.Context, sessionID string, reqEditors ...RequestEditorFn) (*GetSignSessionStatusResponse, error)

GetSignSessionStatusWithResponse request returning *GetSignSessionStatusResponse

func (*ClientWithResponses) IntrospectAccessTokenWithBodyWithResponse

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

IntrospectAccessTokenWithBodyWithResponse request with arbitrary body returning *IntrospectAccessTokenResponse

func (*ClientWithResponses) RequestAccessTokenWithBodyWithResponse

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

RequestAccessTokenWithBodyWithResponse request with arbitrary body returning *RequestAccessTokenResponse

func (*ClientWithResponses) RequestAccessTokenWithResponse

func (c *ClientWithResponses) RequestAccessTokenWithResponse(ctx context.Context, body RequestAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestAccessTokenResponse, error)

func (*ClientWithResponses) VerifyAccessTokenWithResponse

func (c *ClientWithResponses) VerifyAccessTokenWithResponse(ctx context.Context, params *VerifyAccessTokenParams, reqEditors ...RequestEditorFn) (*VerifyAccessTokenResponse, error)

VerifyAccessTokenWithResponse request returning *VerifyAccessTokenResponse

func (*ClientWithResponses) VerifySignatureWithBodyWithResponse

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

VerifySignatureWithBodyWithResponse request with arbitrary body returning *VerifySignatureResponse

func (*ClientWithResponses) VerifySignatureWithResponse

func (c *ClientWithResponses) VerifySignatureWithResponse(ctx context.Context, body VerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifySignatureResponse, error)

type ClientWithResponsesInterface

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

	// VerifyAccessToken request
	VerifyAccessTokenWithResponse(ctx context.Context, params *VerifyAccessTokenParams, reqEditors ...RequestEditorFn) (*VerifyAccessTokenResponse, error)

	// DrawUpContract request with any body
	DrawUpContractWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DrawUpContractResponse, error)

	DrawUpContractWithResponse(ctx context.Context, body DrawUpContractJSONRequestBody, reqEditors ...RequestEditorFn) (*DrawUpContractResponse, error)

	// CreateJwtGrant request with any body
	CreateJwtGrantWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateJwtGrantResponse, error)

	CreateJwtGrantWithResponse(ctx context.Context, body CreateJwtGrantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateJwtGrantResponse, error)

	// RequestAccessToken request with any body
	RequestAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestAccessTokenResponse, error)

	RequestAccessTokenWithResponse(ctx context.Context, body RequestAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestAccessTokenResponse, error)

	// CreateSignSession request with any body
	CreateSignSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSignSessionResponse, error)

	CreateSignSessionWithResponse(ctx context.Context, body CreateSignSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSignSessionResponse, error)

	// GetSignSessionStatus request
	GetSignSessionStatusWithResponse(ctx context.Context, sessionID string, reqEditors ...RequestEditorFn) (*GetSignSessionStatusResponse, error)

	// VerifySignature request with any body
	VerifySignatureWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifySignatureResponse, error)

	VerifySignatureWithResponse(ctx context.Context, body VerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifySignatureResponse, error)

	// CreateAccessToken request with any body
	CreateAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAccessTokenResponse, error)

	// GetContractByType request
	GetContractByTypeWithResponse(ctx context.Context, contractType string, params *GetContractByTypeParams, reqEditors ...RequestEditorFn) (*GetContractByTypeResponse, error)
}

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

type Contract

type Contract struct {
	// Language of the contract in all caps.
	Language           ContractLanguage `json:"language"`
	SignerAttributes   *[]string        `json:"signer_attributes,omitempty"`
	Template           *string          `json:"template,omitempty"`
	TemplateAttributes *[]string        `json:"template_attributes,omitempty"`

	// Type of which contract to sign.
	Type ContractType `json:"type"`

	// Version of the contract.
	Version ContractVersion `json:"version"`
}

Contract defines model for Contract.

type ContractLanguage

type ContractLanguage string

Language of the contract in all caps.

type ContractResponse

type ContractResponse struct {
	// Language of the contract in all caps.
	Language ContractLanguage `json:"language"`

	// The contract message.
	Message string `json:"message"`

	// Type of which contract to sign.
	Type ContractType `json:"type"`

	// Version of the contract.
	Version ContractVersion `json:"version"`
}

ContractResponse defines model for ContractResponse.

type ContractSigningRequest

type ContractSigningRequest struct {
	// Language of the contract in all caps.
	Language ContractLanguage `json:"language"`

	// DID of the organization as registered in the Nuts registry.
	LegalEntity LegalEntity `json:"legalEntity"`

	// Type of which contract to sign.
	Type ContractType `json:"type"`

	// ValidFrom describes the time from which this contract should be considered valid
	ValidFrom *string `json:"valid_from,omitempty"`

	// ValidTo describes the time until this contract should be considered valid
	ValidTo *string `json:"valid_to,omitempty"`

	// Version of the contract.
	Version ContractVersion `json:"version"`
}

ContractSigningRequest defines model for ContractSigningRequest.

type ContractType

type ContractType string

Type of which contract to sign.

type ContractVersion

type ContractVersion string

Version of the contract.

type CreateAccessTokenRequest

type CreateAccessTokenRequest struct {
	// Base64 encoded JWT following rfc7523 and the Nuts documentation
	Assertion string `json:"assertion"`

	// always must contain the value "urn:ietf:params:oauth:grant-type:jwt-bearer"
	GrantType string `json:"grant_type"`
}

Request as described in RFC7523 section 2.1

type CreateAccessTokenResponse

type CreateAccessTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AccessTokenResponse
	JSON400      *AccessTokenRequestFailedResponse
}

func ParseCreateAccessTokenResponse

func ParseCreateAccessTokenResponse(rsp *http.Response) (*CreateAccessTokenResponse, error)

ParseCreateAccessTokenResponse parses an HTTP response from a CreateAccessTokenWithResponse call

func (CreateAccessTokenResponse) Status

func (r CreateAccessTokenResponse) Status() string

Status returns HTTPResponse.Status

func (CreateAccessTokenResponse) StatusCode

func (r CreateAccessTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateJwtGrantJSONBody

type CreateJwtGrantJSONBody CreateJwtGrantRequest

CreateJwtGrantJSONBody defines parameters for CreateJwtGrant.

type CreateJwtGrantJSONRequestBody

type CreateJwtGrantJSONRequestBody CreateJwtGrantJSONBody

CreateJwtGrantJSONRequestBody defines body for CreateJwtGrant for application/json ContentType.

type CreateJwtGrantRequest

type CreateJwtGrantRequest struct {
	Authorizer  string                 `json:"authorizer"`
	Credentials []VerifiableCredential `json:"credentials"`

	// If the signature session is completed, this property contains the signature embedded in an w3c verifiable presentation.
	Identity  *VerifiablePresentation `json:"identity,omitempty"`
	Requester string                  `json:"requester"`

	// The service for which this access-token can be used. The right oauth endpoint is selected based on the service.
	Service string `json:"service"`
}

Request for a JWT Grant. The grant can be used during a Access Token Request in the assertion field

type CreateJwtGrantResponse

type CreateJwtGrantResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *JwtGrantResponse
}

func ParseCreateJwtGrantResponse

func ParseCreateJwtGrantResponse(rsp *http.Response) (*CreateJwtGrantResponse, error)

ParseCreateJwtGrantResponse parses an HTTP response from a CreateJwtGrantWithResponse call

func (CreateJwtGrantResponse) Status

func (r CreateJwtGrantResponse) Status() string

Status returns HTTPResponse.Status

func (CreateJwtGrantResponse) StatusCode

func (r CreateJwtGrantResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateSignSessionJSONBody

type CreateSignSessionJSONBody SignSessionRequest

CreateSignSessionJSONBody defines parameters for CreateSignSession.

type CreateSignSessionJSONRequestBody

type CreateSignSessionJSONRequestBody CreateSignSessionJSONBody

CreateSignSessionJSONRequestBody defines body for CreateSignSession for application/json ContentType.

type CreateSignSessionResponse

type CreateSignSessionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *SignSessionResponse
}

func ParseCreateSignSessionResponse

func ParseCreateSignSessionResponse(rsp *http.Response) (*CreateSignSessionResponse, error)

ParseCreateSignSessionResponse parses an HTTP response from a CreateSignSessionWithResponse call

func (CreateSignSessionResponse) Status

func (r CreateSignSessionResponse) Status() string

Status returns HTTPResponse.Status

func (CreateSignSessionResponse) StatusCode

func (r CreateSignSessionResponse) 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 map[string]interface{}

Subject of a Verifiable Credential identifying the holder and expressing claims.

type DID

type DID string

DID according to Nuts specification

type DrawUpContractJSONBody

type DrawUpContractJSONBody DrawUpContractRequest

DrawUpContractJSONBody defines parameters for DrawUpContract.

type DrawUpContractJSONRequestBody

type DrawUpContractJSONRequestBody DrawUpContractJSONBody

DrawUpContractJSONRequestBody defines body for DrawUpContract for application/json ContentType.

type DrawUpContractRequest

type DrawUpContractRequest struct {
	// Language of the contract in all caps.
	Language ContractLanguage `json:"language"`

	// DID of the organization as registered in the Nuts registry.
	LegalEntity LegalEntity `json:"legalEntity"`

	// Type of which contract to sign.
	Type ContractType `json:"type"`

	// The duration this contract is valid, starting from validFrom or current time if validFrom is omitted. Uses this node default when omitted. Valid time units are: 's', 'm', 'h'
	ValidDuration *string `json:"validDuration,omitempty"`

	// validFrom describes the time from which this contract should be considered valid. Current time is used when omitted.
	ValidFrom *string `json:"validFrom,omitempty"`

	// Version of the contract.
	Version ContractVersion `json:"version"`
}

DrawUpContractRequest defines model for DrawUpContractRequest.

type DrawUpContractResponse

type DrawUpContractResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ContractResponse
}

func ParseDrawUpContractResponse

func ParseDrawUpContractResponse(rsp *http.Response) (*DrawUpContractResponse, error)

ParseDrawUpContractResponse parses an HTTP response from a DrawUpContractWithResponse call

func (DrawUpContractResponse) Status

func (r DrawUpContractResponse) Status() string

Status returns HTTPResponse.Status

func (DrawUpContractResponse) StatusCode

func (r DrawUpContractResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

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 ErrorStatusCodeResolver

type ErrorStatusCodeResolver interface {
	ResolveStatusCode(err error) int
}

type GetContractByTypeParams

type GetContractByTypeParams struct {
	// The version of this contract. If omitted, the most recent version will be returned
	Version  *string `json:"version,omitempty"`
	Language *string `json:"language,omitempty"`
}

GetContractByTypeParams defines parameters for GetContractByType.

type GetContractByTypeResponse

type GetContractByTypeResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Contract
}

func ParseGetContractByTypeResponse

func ParseGetContractByTypeResponse(rsp *http.Response) (*GetContractByTypeResponse, error)

ParseGetContractByTypeResponse parses an HTTP response from a GetContractByTypeWithResponse call

func (GetContractByTypeResponse) Status

func (r GetContractByTypeResponse) Status() string

Status returns HTTPResponse.Status

func (GetContractByTypeResponse) StatusCode

func (r GetContractByTypeResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSignSessionStatusResponse

type GetSignSessionStatusResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SignSessionStatusResponse
}

func ParseGetSignSessionStatusResponse

func ParseGetSignSessionStatusResponse(rsp *http.Response) (*GetSignSessionStatusResponse, error)

ParseGetSignSessionStatusResponse parses an HTTP response from a GetSignSessionStatusWithResponse call

func (GetSignSessionStatusResponse) Status

Status returns HTTPResponse.Status

func (GetSignSessionStatusResponse) StatusCode

func (r GetSignSessionStatusResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HTTPClient

type HTTPClient struct {
	Timeout time.Duration
	// contains filtered or unexported fields
}

HTTPClient holds the server address and other basic settings for the http client

func NewHTTPClient

func NewHTTPClient(serverAddress string, timeout time.Duration, opts ...ClientOption) (*HTTPClient, error)

NewHTTPClient creates a new HTTPClient using the generated OAS client

func (HTTPClient) CreateAccessToken

func (h HTTPClient) CreateAccessToken(endpointURL url.URL, bearerToken string) (*AccessTokenResponse, error)

CreateAccessToken creates an access token and overrides the url by the 'endpointURL' input argument

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type IntrospectAccessTokenResponse

type IntrospectAccessTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TokenIntrospectionResponse
}

func ParseIntrospectAccessTokenResponse

func ParseIntrospectAccessTokenResponse(rsp *http.Response) (*IntrospectAccessTokenResponse, error)

ParseIntrospectAccessTokenResponse parses an HTTP response from a IntrospectAccessTokenWithResponse call

func (IntrospectAccessTokenResponse) Status

Status returns HTTPResponse.Status

func (IntrospectAccessTokenResponse) StatusCode

func (r IntrospectAccessTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type JwtGrantResponse

type JwtGrantResponse struct {
	// The URL that corresponds to the oauth endpoint of the selected service.
	AuthorizationServerEndpoint string `json:"authorization_server_endpoint"`
	BearerToken                 string `json:"bearer_token"`
}

Response with a JWT Grant. It contains a JWT, signed with the private key of the requestor software vendor.

type LegalEntity

type LegalEntity string

DID of the organization as registered in the Nuts registry.

type Preprocessor

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

type RequestAccessTokenJSONBody

type RequestAccessTokenJSONBody RequestAccessTokenRequest

RequestAccessTokenJSONBody defines parameters for RequestAccessToken.

type RequestAccessTokenJSONRequestBody

type RequestAccessTokenJSONRequestBody RequestAccessTokenJSONBody

RequestAccessTokenJSONRequestBody defines body for RequestAccessToken for application/json ContentType.

type RequestAccessTokenRequest

type RequestAccessTokenRequest struct {
	Authorizer  string                 `json:"authorizer"`
	Credentials []VerifiableCredential `json:"credentials"`

	// If the signature session is completed, this property contains the signature embedded in an w3c verifiable presentation.
	Identity  *VerifiablePresentation `json:"identity,omitempty"`
	Requester string                  `json:"requester"`

	// The service for which this access-token can be used. The right oauth endpoint is selected based on the service.
	Service string `json:"service"`
}

Request for a JWT Grant and use it as authorization grant to get the access token from the authorizer

type RequestAccessTokenResponse

type RequestAccessTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AccessTokenResponse
}

func ParseRequestAccessTokenResponse

func ParseRequestAccessTokenResponse(rsp *http.Response) (*RequestAccessTokenResponse, error)

ParseRequestAccessTokenResponse parses an HTTP response from a RequestAccessTokenWithResponse call

func (RequestAccessTokenResponse) Status

Status returns HTTPResponse.Status

func (RequestAccessTokenResponse) StatusCode

func (r RequestAccessTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type ServerInterface

type ServerInterface interface {
	// Introspection endpoint to retrieve information from an Access Token as described by RFC7662
	// (POST /internal/auth/v1/accesstoken/introspect)
	IntrospectAccessToken(ctx echo.Context) error
	// Verifies the provided access token
	// (HEAD /internal/auth/v1/accesstoken/verify)
	VerifyAccessToken(ctx echo.Context, params VerifyAccessTokenParams) error
	// Draw up a contract using a specified contract template, language and version
	// (PUT /internal/auth/v1/contract/drawup)
	DrawUpContract(ctx echo.Context) error
	// Create a JWT Grant
	// (POST /internal/auth/v1/jwt-grant)
	CreateJwtGrant(ctx echo.Context) error
	// Request an accesstoken from the authorizer
	// (POST /internal/auth/v1/request-access-token)
	RequestAccessToken(ctx echo.Context) error
	// Create a signing session for a supported means.
	// (POST /internal/auth/v1/signature/session)
	CreateSignSession(ctx echo.Context) error
	// Get the current status of a signing session
	// (GET /internal/auth/v1/signature/session/{sessionID})
	GetSignSessionStatus(ctx echo.Context, sessionID string) error
	// Verify a signature in the form of a verifiable presentation
	// (PUT /internal/auth/v1/signature/verify)
	VerifySignature(ctx echo.Context) error
	// Create an access token using a JWT as authorization grant
	// (POST /n2n/auth/v1/accesstoken)
	CreateAccessToken(ctx echo.Context) error
	// Get a contract by type and version
	// (GET /public/auth/v1/contract/{contractType})
	GetContractByType(ctx echo.Context, contractType string, params GetContractByTypeParams) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateAccessToken

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

CreateAccessToken converts echo context to params.

func (*ServerInterfaceWrapper) CreateJwtGrant

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

CreateJwtGrant converts echo context to params.

func (*ServerInterfaceWrapper) CreateSignSession

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

CreateSignSession converts echo context to params.

func (*ServerInterfaceWrapper) DrawUpContract

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

DrawUpContract converts echo context to params.

func (*ServerInterfaceWrapper) GetContractByType

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

GetContractByType converts echo context to params.

func (*ServerInterfaceWrapper) GetSignSessionStatus

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

GetSignSessionStatus converts echo context to params.

func (*ServerInterfaceWrapper) IntrospectAccessToken

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

IntrospectAccessToken converts echo context to params.

func (*ServerInterfaceWrapper) RequestAccessToken

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

RequestAccessToken converts echo context to params.

func (*ServerInterfaceWrapper) VerifyAccessToken

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

VerifyAccessToken converts echo context to params.

func (*ServerInterfaceWrapper) VerifySignature

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

VerifySignature converts echo context to params.

type SignSessionRequest

type SignSessionRequest struct {
	Means SignSessionRequestMeans `json:"means"`

	// Params are passed to the means. Should be documented in the means documentation.
	Params map[string]interface{} `json:"params"`

	// Base64 encoded payload what needs to be signed.
	Payload string `json:"payload"`
}

SignSessionRequest defines model for SignSessionRequest.

type SignSessionRequestMeans

type SignSessionRequestMeans string

SignSessionRequestMeans defines model for SignSessionRequest.Means.

const (
	SignSessionRequestMeansDummy SignSessionRequestMeans = "dummy"

	SignSessionRequestMeansIrma SignSessionRequestMeans = "irma"
)

Defines values for SignSessionRequestMeans.

type SignSessionResponse

type SignSessionResponse struct {
	// The means this session uses to sign.
	Means SignSessionResponseMeans `json:"means"`

	// Unique identifier of this sign session.
	SessionID string `json:"sessionID"`

	// A pointer to a sign session. This is an opaque value which only has meaning in the context of the signing means. Can be an URL, base64 encoded image of a QRCode etc.
	SessionPtr map[string]interface{} `json:"sessionPtr"`
}

SignSessionResponse defines model for SignSessionResponse.

type SignSessionResponseMeans

type SignSessionResponseMeans string

The means this session uses to sign.

const (
	SignSessionResponseMeansDummy SignSessionResponseMeans = "dummy"

	SignSessionResponseMeansIrma SignSessionResponseMeans = "irma"
)

Defines values for SignSessionResponseMeans.

type SignSessionStatusResponse

type SignSessionStatusResponse struct {
	// Status indicates the status of the signing proces. Values depend on the implementation of the signing means.
	Status string `json:"status"`

	// If the signature session is completed, this property contains the signature embedded in an w3c verifiable presentation.
	VerifiablePresentation *VerifiablePresentation `json:"verifiablePresentation,omitempty"`
}

SignSessionStatusResponse defines model for SignSessionStatusResponse.

type SignatureVerificationRequest

type SignatureVerificationRequest struct {
	// If the signature session is completed, this property contains the signature embedded in an w3c verifiable presentation.
	VerifiablePresentation VerifiablePresentation `json:"VerifiablePresentation"`

	// Moment in time to check the validity of the signature. If omitted, the current time is used.
	CheckTime *string `json:"checkTime,omitempty"`
}

SignatureVerificationRequest defines model for SignatureVerificationRequest.

type SignatureVerificationResponse

type SignatureVerificationResponse struct {
	// Key value pairs containing claims and their values.
	Credentials *map[string]interface{} `json:"credentials,omitempty"`

	// Key vale pairs containing the attributes of the issuer.
	IssuerAttributes *map[string]interface{} `json:"issuerAttributes,omitempty"`

	// Indicates the validity of the signature.
	Validity bool `json:"validity"`

	// Type of Verifiable credential.
	VpType *string `json:"vpType,omitempty"`
}

Contains the signature verification result.

type TokenIntrospectionRequest

type TokenIntrospectionRequest struct {
	Token string `json:"token"`
}

Token introspection request as described in RFC7662 section 2.1

type TokenIntrospectionResponse

type TokenIntrospectionResponse struct {
	// True if the token is active, false if the token is expired, malformed etc.
	Active bool `json:"active"`

	// As per rfc7523 https://tools.ietf.org/html/rfc7523>, the aud must be the
	// token endpoint. This can be taken from the Nuts registry.
	Aud *string `json:"aud,omitempty"`

	// End-User's preferred e-mail address. Should be a personal email and can be used to uniquely identify a user. Just like the email used for an account.
	Email *string `json:"email,omitempty"`
	Exp   *int    `json:"exp,omitempty"`

	// Surname(s) or last name(s) of the End-User.
	FamilyName *string `json:"family_name,omitempty"`
	Iat        *int    `json:"iat,omitempty"`

	// Initials of the End-User.
	Initials *string `json:"initials,omitempty"`

	// The subject (not a Nuts subject) contains the DID of the authorizer.
	Iss *string `json:"iss,omitempty"`

	// encoded ops signature. (TBD)
	Osi *string `json:"osi,omitempty"`

	// Surname prefix
	Prefix *string `json:"prefix,omitempty"`

	// credentials resolved from `vcs` (VC IDs).
	ResolvedVCs *[]VerifiableCredential `json:"resolvedVCs,omitempty"`
	Service     *string                 `json:"service,omitempty"`

	// The subject is always the acting party, thus the care organization requesting access to data.
	Sub *string   `json:"sub,omitempty"`
	Vcs *[]string `json:"vcs,omitempty"`
}

Token introspection response as described in RFC7662 section 2.2

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 VerifyAccessTokenParams

type VerifyAccessTokenParams struct {
	Authorization string `json:"Authorization"`
}

VerifyAccessTokenParams defines parameters for VerifyAccessToken.

type VerifyAccessTokenResponse

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

func ParseVerifyAccessTokenResponse

func ParseVerifyAccessTokenResponse(rsp *http.Response) (*VerifyAccessTokenResponse, error)

ParseVerifyAccessTokenResponse parses an HTTP response from a VerifyAccessTokenWithResponse call

func (VerifyAccessTokenResponse) Status

func (r VerifyAccessTokenResponse) Status() string

Status returns HTTPResponse.Status

func (VerifyAccessTokenResponse) StatusCode

func (r VerifyAccessTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VerifySignatureJSONBody

type VerifySignatureJSONBody SignatureVerificationRequest

VerifySignatureJSONBody defines parameters for VerifySignature.

type VerifySignatureJSONRequestBody

type VerifySignatureJSONRequestBody VerifySignatureJSONBody

VerifySignatureJSONRequestBody defines body for VerifySignature for application/json ContentType.

type VerifySignatureResponse

type VerifySignatureResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SignatureVerificationResponse
}

func ParseVerifySignatureResponse

func ParseVerifySignatureResponse(rsp *http.Response) (*VerifySignatureResponse, error)

ParseVerifySignatureResponse parses an HTTP response from a VerifySignatureWithResponse call

func (VerifySignatureResponse) Status

func (r VerifySignatureResponse) Status() string

Status returns HTTPResponse.Status

func (VerifySignatureResponse) StatusCode

func (r VerifySignatureResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Wrapper

type Wrapper struct {
	Auth               auth.AuthenticationServices
	CredentialResolver vcr.Resolver
}

Wrapper bridges the generated api types and http logic to the internal types and logic. It checks required parameters and message body. It converts data from api to internal types. Then passes the internal formats to the AuthenticationServices. Converts internal results back to the generated Api types. Handles errors and returns the correct http response. It does not perform any business logic.

func (Wrapper) CreateAccessToken

func (w Wrapper) CreateAccessToken(ctx echo.Context) (err error)

CreateAccessToken handles the http request (from a remote vendor's Nuts node) for creating an access token for accessing resources of the local vendor's EPD/XIS. It consumes a JWT Bearer token. It consumes and checks the JWT and returns a smaller sessionToken The errors returns for this API do not follow RFC7807 but follow the oauth framework error response: RFC6749 (https://tools.ietf.org/html/rfc6749#page-45)

func (Wrapper) CreateJwtGrant

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

CreateJwtGrant handles the http request (from the vendor's EPD/XIS) for creating a JWT bearer token which can be used to retrieve an access token from a remote Nuts node.

func (Wrapper) CreateSignSession

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

CreateSignSession handles the CreateSignSession http request. It parses the parameters, finds the means handler and returns a session pointer which can be used to monitor the session.

func (Wrapper) DrawUpContract

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

DrawUpContract handles the http request for drawing up a contract for a given contract template identified by type, language and version.

func (Wrapper) GetContractByType

func (w Wrapper) GetContractByType(ctx echo.Context, contractType string, params GetContractByTypeParams) error

GetContractByType handles the http request for finding a contract by type.

func (Wrapper) GetSignSessionStatus

func (w Wrapper) GetSignSessionStatus(ctx echo.Context, sessionID string) error

GetSignSessionStatus handles the http requests for getting the current status of a signing session.

func (Wrapper) IntrospectAccessToken

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

IntrospectAccessToken handles the http request (from the vendor's EPD/XIS) for introspecting an access token received from a remote Nuts node.

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) RequestAccessToken

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

RequestAccessToken handles the HTTP request (from the vendor's EPD/XIS) for creating a JWT grant and using it as authorization grant to get an access token from the remote Nuts node.

func (*Wrapper) ResolveStatusCode

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

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

func (*Wrapper) Routes

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

Routes registers the Echo routes for the API.

func (Wrapper) VerifyAccessToken

func (w Wrapper) VerifyAccessToken(ctx echo.Context, params VerifyAccessTokenParams) error

VerifyAccessToken handles the http request (from the vendor's EPD/XIS) for verifying an access token received from a remote Nuts node.

func (Wrapper) VerifySignature

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

VerifySignature handles the VerifySignature http request. It parses the request body, parses the verifiable presentation and calls the ContractNotary to verify the VP.

Jump to

Keyboard shortcuts

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