api

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package api provides primitives to interact the openapi HTTP API.

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

Index

Constants

This section is empty.

Variables

View Source
var ErrOrganizationNotFound = errors.New("organization not found")

ErrOrganizationNotFound is returned by the reverseLookup when the organization is not found

Functions

func NewDeprecatedVendorClaimRequest added in v0.14.0

func NewDeprecatedVendorClaimRequest(server string, id string, body DeprecatedVendorClaimJSONRequestBody) (*http.Request, error)

NewDeprecatedVendorClaimRequest calls the generic DeprecatedVendorClaim builder with application/json body

func NewDeprecatedVendorClaimRequestWithBody added in v0.14.0

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

NewDeprecatedVendorClaimRequestWithBody generates requests for DeprecatedVendorClaim with any type of body

func NewEndpointsByOrganisationIdRequest

func NewEndpointsByOrganisationIdRequest(server string, params *EndpointsByOrganisationIdParams) (*http.Request, error)

NewEndpointsByOrganisationIdRequest generates requests for EndpointsByOrganisationId

func NewMTLSCAsRequest added in v0.15.0

func NewMTLSCAsRequest(server string) (*http.Request, error)

NewMTLSCAsRequest generates requests for MTLSCAs

func NewMTLSCertificatesRequest added in v0.15.0

func NewMTLSCertificatesRequest(server string) (*http.Request, error)

NewMTLSCertificatesRequest generates requests for MTLSCertificates

func NewOrganizationByIdRequest

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

NewOrganizationByIdRequest generates requests for OrganizationById

func NewRefreshOrganizationCertificateRequest added in v0.14.0

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

NewRefreshOrganizationCertificateRequest generates requests for RefreshOrganizationCertificate

func NewRegisterEndpointRequest

func NewRegisterEndpointRequest(server string, id string, body RegisterEndpointJSONRequestBody) (*http.Request, error)

NewRegisterEndpointRequest calls the generic RegisterEndpoint builder with application/json body

func NewRegisterEndpointRequestWithBody

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

NewRegisterEndpointRequestWithBody generates requests for RegisterEndpoint with any type of body

func NewRegisterVendorRequestWithBody

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

NewRegisterVendorRequestWithBody generates requests for RegisterVendor with any type of body

func NewSearchOrganizationsRequest

func NewSearchOrganizationsRequest(server string, params *SearchOrganizationsParams) (*http.Request, error)

NewSearchOrganizationsRequest generates requests for SearchOrganizations

func NewVendorByIdRequest added in v0.15.1

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

NewVendorByIdRequest generates requests for VendorById

func NewVendorClaimRequest

func NewVendorClaimRequest(server string, body VendorClaimJSONRequestBody) (*http.Request, error)

NewVendorClaimRequest calls the generic VendorClaim builder with application/json body

func NewVendorClaimRequestWithBody

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

NewVendorClaimRequestWithBody generates requests for VendorClaim with any type of body

func NewVerifyRequest added in v0.14.0

func NewVerifyRequest(server string, params *VerifyParams) (*http.Request, error)

NewVerifyRequest generates requests for Verify

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL added in v0.15.1

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 ApiWrapper

type ApiWrapper struct {
	R pkg.RegistryClient
}

ApiWrapper is needed to connect the implementation to the echo ServiceWrapper

func (ApiWrapper) DeprecatedVendorClaim added in v0.14.0

func (apiResource ApiWrapper) DeprecatedVendorClaim(ctx echo.Context, _ string) error

DeprecatedVendorClaim is deprecated, use VendorClaim.

func (ApiWrapper) EndpointsByOrganisationId

func (apiResource ApiWrapper) EndpointsByOrganisationId(ctx echo.Context, params EndpointsByOrganisationIdParams) error

EndpointsByOrganisationId is the Api implementation for getting all or certain types of endpoints for an organization

func (ApiWrapper) MTLSCAs added in v0.15.0

func (apiResource ApiWrapper) MTLSCAs(ctx echo.Context) error

func (ApiWrapper) MTLSCertificates added in v0.15.0

func (apiResource ApiWrapper) MTLSCertificates(ctx echo.Context) error

func (ApiWrapper) OrganizationById

func (apiResource ApiWrapper) OrganizationById(ctx echo.Context, id string) error

OrganizationById is the Api implementation for getting an organization based on its Id.

func (ApiWrapper) RefreshOrganizationCertificate added in v0.14.0

func (apiResource ApiWrapper) RefreshOrganizationCertificate(ctx echo.Context, id string) error

func (ApiWrapper) RegisterEndpoint

func (apiResource ApiWrapper) RegisterEndpoint(ctx echo.Context, id string) error

RegisterEndpoint is the Api implementation for registering an endpoint.

func (ApiWrapper) RegisterVendor

func (apiResource ApiWrapper) RegisterVendor(ctx echo.Context) error

RegisterVendor is the Api implementation for registering a vendor.

func (ApiWrapper) SearchOrganizations

func (apiResource ApiWrapper) SearchOrganizations(ctx echo.Context, params SearchOrganizationsParams) error

SearchOrganizations is the Api implementation for finding organizations by (partial) query

func (ApiWrapper) VendorById added in v0.15.1

func (apiResource ApiWrapper) VendorById(ctx echo.Context, id string) error

VendorById is the Api implementation for getting a vendor based on its Id.

func (ApiWrapper) VendorClaim

func (apiResource ApiWrapper) VendorClaim(ctx echo.Context) error

VendorClaim is the Api implementation for registering a vendor claim.

func (ApiWrapper) Verify added in v0.14.0

func (apiResource ApiWrapper) Verify(ctx echo.Context, params VerifyParams) error

type CAListWithChain added in v0.15.0

type CAListWithChain struct {

	// list of current active (or will be active) vendor CAs. PEM encoded
	CAList []string `json:"CAList"`

	// list of certificates, roots first then intermediates, shared amongst all CAs. PEM encoded.
	Chain []string `json:"chain"`
}

CAListWithChain defines model for CAListWithChain.

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 callback for modifying requests which are generated before sending over
	// the network.
	RequestEditor 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) DeprecatedVendorClaim added in v0.14.0

func (c *Client) DeprecatedVendorClaim(ctx context.Context, id string, body DeprecatedVendorClaimJSONRequestBody) (*http.Response, error)

func (*Client) DeprecatedVendorClaimWithBody added in v0.14.0

func (c *Client) DeprecatedVendorClaimWithBody(ctx context.Context, id string, contentType string, body io.Reader) (*http.Response, error)

func (*Client) EndpointsByOrganisationId

func (c *Client) EndpointsByOrganisationId(ctx context.Context, params *EndpointsByOrganisationIdParams) (*http.Response, error)

func (*Client) MTLSCAs added in v0.15.0

func (c *Client) MTLSCAs(ctx context.Context) (*http.Response, error)

func (*Client) MTLSCertificates added in v0.15.0

func (c *Client) MTLSCertificates(ctx context.Context) (*http.Response, error)

func (*Client) OrganizationById

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

func (*Client) RefreshOrganizationCertificate added in v0.14.0

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

func (*Client) RegisterEndpoint

func (c *Client) RegisterEndpoint(ctx context.Context, id string, body RegisterEndpointJSONRequestBody) (*http.Response, error)

func (*Client) RegisterEndpointWithBody

func (c *Client) RegisterEndpointWithBody(ctx context.Context, id string, contentType string, body io.Reader) (*http.Response, error)

func (*Client) RegisterVendorWithBody

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

func (*Client) SearchOrganizations

func (c *Client) SearchOrganizations(ctx context.Context, params *SearchOrganizationsParams) (*http.Response, error)

func (*Client) VendorById added in v0.15.1

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

func (*Client) VendorClaim

func (c *Client) VendorClaim(ctx context.Context, body VendorClaimJSONRequestBody) (*http.Response, error)

func (*Client) VendorClaimWithBody

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

func (*Client) Verify added in v0.14.0

func (c *Client) Verify(ctx context.Context, params *VerifyParams) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// Verify request
	Verify(ctx context.Context, params *VerifyParams) (*http.Response, error)

	// EndpointsByOrganisationId request
	EndpointsByOrganisationId(ctx context.Context, params *EndpointsByOrganisationIdParams) (*http.Response, error)

	// MTLSCAs request
	MTLSCAs(ctx context.Context) (*http.Response, error)

	// MTLSCertificates request
	MTLSCertificates(ctx context.Context) (*http.Response, error)

	// VendorClaim request  with any body
	VendorClaimWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)

	VendorClaim(ctx context.Context, body VendorClaimJSONRequestBody) (*http.Response, error)

	// OrganizationById request
	OrganizationById(ctx context.Context, id string) (*http.Response, error)

	// RegisterEndpoint request  with any body
	RegisterEndpointWithBody(ctx context.Context, id string, contentType string, body io.Reader) (*http.Response, error)

	RegisterEndpoint(ctx context.Context, id string, body RegisterEndpointJSONRequestBody) (*http.Response, error)

	// RefreshOrganizationCertificate request
	RefreshOrganizationCertificate(ctx context.Context, id string) (*http.Response, error)

	// SearchOrganizations request
	SearchOrganizations(ctx context.Context, params *SearchOrganizationsParams) (*http.Response, error)

	// VendorById request
	VendorById(ctx context.Context, id string) (*http.Response, error)

	// DeprecatedVendorClaim request  with any body
	DeprecatedVendorClaimWithBody(ctx context.Context, id string, contentType string, body io.Reader) (*http.Response, error)

	DeprecatedVendorClaim(ctx context.Context, id string, body DeprecatedVendorClaimJSONRequestBody) (*http.Response, error)

	// RegisterVendor request  with any body
	RegisterVendorWithBody(ctx context.Context, contentType string, body io.Reader) (*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) DeprecatedVendorClaimWithBodyWithResponse added in v0.14.0

func (c *ClientWithResponses) DeprecatedVendorClaimWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*DeprecatedVendorClaimResponse, error)

DeprecatedVendorClaimWithBodyWithResponse request with arbitrary body returning *DeprecatedVendorClaimResponse

func (*ClientWithResponses) DeprecatedVendorClaimWithResponse added in v0.14.0

func (*ClientWithResponses) EndpointsByOrganisationIdWithResponse

func (c *ClientWithResponses) EndpointsByOrganisationIdWithResponse(ctx context.Context, params *EndpointsByOrganisationIdParams) (*EndpointsByOrganisationIdResponse, error)

EndpointsByOrganisationIdWithResponse request returning *EndpointsByOrganisationIdResponse

func (*ClientWithResponses) MTLSCAsWithResponse added in v0.15.0

func (c *ClientWithResponses) MTLSCAsWithResponse(ctx context.Context) (*MTLSCAsResponse, error)

MTLSCAsWithResponse request returning *MTLSCAsResponse

func (*ClientWithResponses) MTLSCertificatesWithResponse added in v0.15.0

func (c *ClientWithResponses) MTLSCertificatesWithResponse(ctx context.Context) (*MTLSCertificatesResponse, error)

MTLSCertificatesWithResponse request returning *MTLSCertificatesResponse

func (*ClientWithResponses) OrganizationByIdWithResponse

func (c *ClientWithResponses) OrganizationByIdWithResponse(ctx context.Context, id string) (*OrganizationByIdResponse, error)

OrganizationByIdWithResponse request returning *OrganizationByIdResponse

func (*ClientWithResponses) RefreshOrganizationCertificateWithResponse added in v0.14.0

func (c *ClientWithResponses) RefreshOrganizationCertificateWithResponse(ctx context.Context, id string) (*RefreshOrganizationCertificateResponse, error)

RefreshOrganizationCertificateWithResponse request returning *RefreshOrganizationCertificateResponse

func (*ClientWithResponses) RegisterEndpointWithBodyWithResponse

func (c *ClientWithResponses) RegisterEndpointWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*RegisterEndpointResponse, error)

RegisterEndpointWithBodyWithResponse request with arbitrary body returning *RegisterEndpointResponse

func (*ClientWithResponses) RegisterEndpointWithResponse

func (c *ClientWithResponses) RegisterEndpointWithResponse(ctx context.Context, id string, body RegisterEndpointJSONRequestBody) (*RegisterEndpointResponse, error)

func (*ClientWithResponses) RegisterVendorWithBodyWithResponse

func (c *ClientWithResponses) RegisterVendorWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*RegisterVendorResponse, error)

RegisterVendorWithBodyWithResponse request with arbitrary body returning *RegisterVendorResponse

func (*ClientWithResponses) SearchOrganizationsWithResponse

func (c *ClientWithResponses) SearchOrganizationsWithResponse(ctx context.Context, params *SearchOrganizationsParams) (*SearchOrganizationsResponse, error)

SearchOrganizationsWithResponse request returning *SearchOrganizationsResponse

func (*ClientWithResponses) VendorByIdWithResponse added in v0.15.1

func (c *ClientWithResponses) VendorByIdWithResponse(ctx context.Context, id string) (*VendorByIdResponse, error)

VendorByIdWithResponse request returning *VendorByIdResponse

func (*ClientWithResponses) VendorClaimWithBodyWithResponse

func (c *ClientWithResponses) VendorClaimWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*VendorClaimResponse, error)

VendorClaimWithBodyWithResponse request with arbitrary body returning *VendorClaimResponse

func (*ClientWithResponses) VendorClaimWithResponse

func (c *ClientWithResponses) VendorClaimWithResponse(ctx context.Context, body VendorClaimJSONRequestBody) (*VendorClaimResponse, error)

func (*ClientWithResponses) VerifyWithResponse added in v0.14.0

func (c *ClientWithResponses) VerifyWithResponse(ctx context.Context, params *VerifyParams) (*VerifyResponse, error)

VerifyWithResponse request returning *VerifyResponse

type ClientWithResponsesInterface added in v0.15.1

type ClientWithResponsesInterface interface {
	// Verify request
	VerifyWithResponse(ctx context.Context, params *VerifyParams) (*VerifyResponse, error)

	// EndpointsByOrganisationId request
	EndpointsByOrganisationIdWithResponse(ctx context.Context, params *EndpointsByOrganisationIdParams) (*EndpointsByOrganisationIdResponse, error)

	// MTLSCAs request
	MTLSCAsWithResponse(ctx context.Context) (*MTLSCAsResponse, error)

	// MTLSCertificates request
	MTLSCertificatesWithResponse(ctx context.Context) (*MTLSCertificatesResponse, error)

	// VendorClaim request  with any body
	VendorClaimWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*VendorClaimResponse, error)

	VendorClaimWithResponse(ctx context.Context, body VendorClaimJSONRequestBody) (*VendorClaimResponse, error)

	// OrganizationById request
	OrganizationByIdWithResponse(ctx context.Context, id string) (*OrganizationByIdResponse, error)

	// RegisterEndpoint request  with any body
	RegisterEndpointWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*RegisterEndpointResponse, error)

	RegisterEndpointWithResponse(ctx context.Context, id string, body RegisterEndpointJSONRequestBody) (*RegisterEndpointResponse, error)

	// RefreshOrganizationCertificate request
	RefreshOrganizationCertificateWithResponse(ctx context.Context, id string) (*RefreshOrganizationCertificateResponse, error)

	// SearchOrganizations request
	SearchOrganizationsWithResponse(ctx context.Context, params *SearchOrganizationsParams) (*SearchOrganizationsResponse, error)

	// VendorById request
	VendorByIdWithResponse(ctx context.Context, id string) (*VendorByIdResponse, error)

	// DeprecatedVendorClaim request  with any body
	DeprecatedVendorClaimWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*DeprecatedVendorClaimResponse, error)

	DeprecatedVendorClaimWithResponse(ctx context.Context, id string, body DeprecatedVendorClaimJSONRequestBody) (*DeprecatedVendorClaimResponse, error)

	// RegisterVendor request  with any body
	RegisterVendorWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*RegisterVendorResponse, error)
}

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

type DeprecatedVendorClaimJSONBody added in v0.14.0

type DeprecatedVendorClaimJSONBody Organization

DeprecatedVendorClaimJSONBody defines parameters for DeprecatedVendorClaim.

type DeprecatedVendorClaimJSONRequestBody added in v0.14.0

type DeprecatedVendorClaimJSONRequestBody DeprecatedVendorClaimJSONBody

DeprecatedVendorClaimRequestBody defines body for DeprecatedVendorClaim for application/json ContentType.

type DeprecatedVendorClaimResponse added in v0.15.1

type DeprecatedVendorClaimResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Event
}

func ParseDeprecatedVendorClaimResponse added in v0.14.0

func ParseDeprecatedVendorClaimResponse(rsp *http.Response) (*DeprecatedVendorClaimResponse, error)

ParseDeprecatedVendorClaimResponse parses an HTTP response from a DeprecatedVendorClaimWithResponse call

func (DeprecatedVendorClaimResponse) Status added in v0.15.1

Status returns HTTPResponse.Status

func (DeprecatedVendorClaimResponse) StatusCode added in v0.15.1

func (r DeprecatedVendorClaimResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Domain

type Domain string

Domain defines model for Domain.

const (
	Domain_healthcare Domain = "healthcare"
	Domain_insurance  Domain = "insurance"
	Domain_personal   Domain = "personal"
)

List of Domain

type EchoRouter added in v0.14.0

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(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 Endpoint

type Endpoint struct {

	// location of the actual en endpoint on the internet
	URL string `json:"URL"`

	// URI of the type of endpoint
	EndpointType string `json:"endpointType"`

	// Generic identifier used for representing BSN, agbcode, etc. It's always constructed as an URN followed by a double colon (:) and then the identifying value of the given URN
	Identifier Identifier `json:"identifier"`

	// Generic identifier used for representing BSN, agbcode, etc. It's always constructed as an URN followed by a double colon (:) and then the identifying value of the given URN
	Organization Identifier `json:"organization"`

	// A property bag, containing extra properties for endpoints
	Properties *EndpointProperties `json:"properties,omitempty"`

	// status of the endpoint
	Status string `json:"status"`
}

Endpoint defines model for Endpoint.

type EndpointProperties

type EndpointProperties map[string]interface{}

EndpointProperties defines model for EndpointProperties.

type EndpointsByOrganisationIdParams

type EndpointsByOrganisationIdParams struct {

	// A list of organisation identifiers to query for. identifiers are Nuts Identifiers with proper escaping
	OrgIds []string `json:"orgIds"`

	// The type of endpoint requested, eg Nuts or FHIR
	Type *string `json:"type,omitempty"`

	// only return successfull result if each given organisation has an endpoint of the requested type, otherwise 400
	Strict *bool `json:"strict,omitempty"`
}

EndpointsByOrganisationIdParams defines parameters for EndpointsByOrganisationId.

type EndpointsByOrganisationIdResponse added in v0.15.1

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

func ParseEndpointsByOrganisationIdResponse

func ParseEndpointsByOrganisationIdResponse(rsp *http.Response) (*EndpointsByOrganisationIdResponse, error)

ParseEndpointsByOrganisationIdResponse parses an HTTP response from a EndpointsByOrganisationIdWithResponse call

func (EndpointsByOrganisationIdResponse) Status added in v0.15.1

Status returns HTTPResponse.Status

func (EndpointsByOrganisationIdResponse) StatusCode added in v0.15.1

func (r EndpointsByOrganisationIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Event

type Event struct {

	// timestamp at which the event happened
	IssuedAt *time.Time `json:"issuedAt,omitempty"`

	// payload of the event
	Payload *interface{} `json:"payload,omitempty"`

	// JWS (JSON Web Signature) securing the payload's authenticity and integrity.
	Signature *string `json:"signature,omitempty"`

	// type of the event
	Type *string `json:"type,omitempty"`
}

Event defines model for Event.

type HttpClient

type HttpClient struct {
	ServerAddress string
	Timeout       time.Duration
}

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

func (HttpClient) EndpointsByOrganizationAndType

func (hb HttpClient) EndpointsByOrganizationAndType(organizationID core.PartyID, endpointType *string) ([]db.Endpoint, error)

EndpointsByOrganization is the client Api implementation for getting all or certain types of endpoints for an organization

func (HttpClient) OrganizationById

func (hb HttpClient) OrganizationById(id core.PartyID) (*db.Organization, error)

OrganizationById is the client Api implementation for getting an organization based on its Id.

func (HttpClient) RefreshOrganizationCertificate added in v0.14.0

func (hb HttpClient) RefreshOrganizationCertificate(organizationID core.PartyID) (events.Event, error)

func (HttpClient) RegisterEndpoint

func (hb HttpClient) RegisterEndpoint(organizationID core.PartyID, id string, url string, endpointType string, status string, properties map[string]string) (events.Event, error)

RegisterEndpoint is the client Api implementation for registering an endpoint for an organisation.

func (HttpClient) RegisterVendor

func (hb HttpClient) RegisterVendor(certificate *x509.Certificate) (events.Event, error)

RegisterVendor is the client Api implementation for registering a vendor.

func (HttpClient) ReverseLookup

func (hb HttpClient) ReverseLookup(name string) (*db.Organization, error)

ReverseLookup returns an exact match or an error

func (HttpClient) SearchOrganizations

func (hb HttpClient) SearchOrganizations(query string) ([]db.Organization, error)

SearchOrganizations is the client Api implementation for finding organizations by (partial) query

func (HttpClient) VendorById added in v0.15.1

func (hb HttpClient) VendorById(id core.PartyID) (*db.Vendor, error)

VendorById is the client Api implementation for getting a vendor based on its Id.

func (HttpClient) VendorCAs added in v0.15.0

func (hb HttpClient) VendorCAs() [][]*x509.Certificate

VendorCAs on the client is not implemented

func (HttpClient) VendorClaim

func (hb HttpClient) VendorClaim(orgID core.PartyID, orgName string, orgKeys []interface{}) (events.Event, error)

VendorClaim is the client Api implementation for registering an organisation.

func (HttpClient) Verify added in v0.14.0

func (hb HttpClient) Verify(fix bool) ([]events.Event, bool, error)

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Identifier

type Identifier string

Identifier defines model for Identifier.

func (Identifier) String

func (i Identifier) String() string

String converts an identifier to string

type JWK

type JWK map[string]interface{}

JWK defines model for JWK.

type MTLSCAsResponse added in v0.15.1

type MTLSCAsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *CAListWithChain
}

func ParseMTLSCAsResponse added in v0.15.0

func ParseMTLSCAsResponse(rsp *http.Response) (*MTLSCAsResponse, error)

ParseMTLSCAsResponse parses an HTTP response from a MTLSCAsWithResponse call

func (MTLSCAsResponse) Status added in v0.15.1

func (r MTLSCAsResponse) Status() string

Status returns HTTPResponse.Status

func (MTLSCAsResponse) StatusCode added in v0.15.1

func (r MTLSCAsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type MTLSCertificatesResponse added in v0.15.1

type MTLSCertificatesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]string
}

func ParseMTLSCertificatesResponse added in v0.15.0

func ParseMTLSCertificatesResponse(rsp *http.Response) (*MTLSCertificatesResponse, error)

ParseMTLSCertificatesResponse parses an HTTP response from a MTLSCertificatesWithResponse call

func (MTLSCertificatesResponse) Status added in v0.15.1

func (r MTLSCertificatesResponse) Status() string

Status returns HTTPResponse.Status

func (MTLSCertificatesResponse) StatusCode added in v0.15.1

func (r MTLSCertificatesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Organization

type Organization struct {
	Endpoints *[]Endpoint `json:"endpoints,omitempty"`

	// Generic identifier used for representing BSN, agbcode, etc. It's always constructed as an URN followed by a double colon (:) and then the identifying value of the given URN
	Identifier Identifier `json:"identifier"`
	Keys       *[]JWK     `json:"keys,omitempty"`

	// the well-known name for the organization
	Name string `json:"name"`

	// PEM encoded public key (deprecated, use JWK)
	PublicKey *string `json:"publicKey,omitempty"`
}

Organization defines model for Organization.

type OrganizationByIdResponse added in v0.15.1

type OrganizationByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Organization
}

func ParseOrganizationByIdResponse

func ParseOrganizationByIdResponse(rsp *http.Response) (*OrganizationByIdResponse, error)

ParseOrganizationByIdResponse parses an HTTP response from a OrganizationByIdWithResponse call

func (OrganizationByIdResponse) Status added in v0.15.1

func (r OrganizationByIdResponse) Status() string

Status returns HTTPResponse.Status

func (OrganizationByIdResponse) StatusCode added in v0.15.1

func (r OrganizationByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RefreshOrganizationCertificateResponse added in v0.15.1

type RefreshOrganizationCertificateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Event
}

func ParseRefreshOrganizationCertificateResponse added in v0.14.0

func ParseRefreshOrganizationCertificateResponse(rsp *http.Response) (*RefreshOrganizationCertificateResponse, error)

ParseRefreshOrganizationCertificateResponse parses an HTTP response from a RefreshOrganizationCertificateWithResponse call

func (RefreshOrganizationCertificateResponse) Status added in v0.15.1

Status returns HTTPResponse.Status

func (RefreshOrganizationCertificateResponse) StatusCode added in v0.15.1

StatusCode returns HTTPResponse.StatusCode

type RegisterEndpointEvent

type RegisterEndpointEvent struct {

	// location of the actual en endpoint on the internet
	URL string `json:"URL"`

	// URI of the type of endpoint
	EndpointType string `json:"endpointType"`

	// Generic identifier used for representing BSN, agbcode, etc. It's always constructed as an URN followed by a double colon (:) and then the identifying value of the given URN
	Identifier Identifier `json:"identifier"`

	// Generic identifier used for representing BSN, agbcode, etc. It's always constructed as an URN followed by a double colon (:) and then the identifying value of the given URN
	Organization Identifier `json:"organization"`

	// A property bag, containing extra properties for endpoints
	Properties *EndpointProperties `json:"properties,omitempty"`

	// status of the endpoint
	Status string `json:"status"`
}

RegisterEndpointEvent defines model for RegisterEndpointEvent.

type RegisterEndpointJSONBody

type RegisterEndpointJSONBody Endpoint

RegisterEndpointJSONBody defines parameters for RegisterEndpoint.

type RegisterEndpointJSONRequestBody

type RegisterEndpointJSONRequestBody RegisterEndpointJSONBody

RegisterEndpointRequestBody defines body for RegisterEndpoint for application/json ContentType.

type RegisterEndpointResponse added in v0.15.1

type RegisterEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Event
}

func ParseRegisterEndpointResponse

func ParseRegisterEndpointResponse(rsp *http.Response) (*RegisterEndpointResponse, error)

ParseRegisterEndpointResponse parses an HTTP response from a RegisterEndpointWithResponse call

func (RegisterEndpointResponse) Status added in v0.15.1

func (r RegisterEndpointResponse) Status() string

Status returns HTTPResponse.Status

func (RegisterEndpointResponse) StatusCode added in v0.15.1

func (r RegisterEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RegisterVendorEvent

type RegisterVendorEvent struct {

	// Domain the entity operates in.
	Domain Domain `json:"domain"`

	// Generic identifier used for representing BSN, agbcode, etc. It's always constructed as an URN followed by a double colon (:) and then the identifying value of the given URN
	Identifier Identifier `json:"identifier"`

	// the well-known name for the vendor
	Name    string `json:"name"`
	OrgKeys *[]JWK `json:"orgKeys,omitempty"`
}

RegisterVendorEvent defines model for RegisterVendorEvent.

type RegisterVendorResponse added in v0.15.1

type RegisterVendorResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Event
}

func ParseRegisterVendorResponse

func ParseRegisterVendorResponse(rsp *http.Response) (*RegisterVendorResponse, error)

ParseRegisterVendorResponse parses an HTTP response from a RegisterVendorWithResponse call

func (RegisterVendorResponse) Status added in v0.15.1

func (r RegisterVendorResponse) Status() string

Status returns HTTPResponse.Status

func (RegisterVendorResponse) StatusCode added in v0.15.1

func (r RegisterVendorResponse) 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 SearchOrganizationsParams

type SearchOrganizationsParams struct {

	// Search string
	Query string `json:"query"`

	// Only return exact matches, for reverse lookup
	Exact *bool `json:"exact,omitempty"`
}

SearchOrganizationsParams defines parameters for SearchOrganizations.

type SearchOrganizationsResponse added in v0.15.1

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

func ParseSearchOrganizationsResponse

func ParseSearchOrganizationsResponse(rsp *http.Response) (*SearchOrganizationsResponse, error)

ParseSearchOrganizationsResponse parses an HTTP response from a SearchOrganizationsWithResponse call

func (SearchOrganizationsResponse) Status added in v0.15.1

Status returns HTTPResponse.Status

func (SearchOrganizationsResponse) StatusCode added in v0.15.1

func (r SearchOrganizationsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ServerInterface

type ServerInterface interface {
	// Verifies the registry data (owned by the vendor) and fixes where necessarry (e.g. issue certificates) if fix = true.
	// (POST /api/admin/verify)
	Verify(ctx echo.Context, params VerifyParams) error
	// Find endpoints based on organisation identifiers and type of endpoint (optional)
	// (GET /api/endpoints)
	EndpointsByOrganisationId(ctx echo.Context, params EndpointsByOrganisationIdParams) error
	// Get a list of current active vendor CAs
	// (GET /api/mtls/cas)
	MTLSCAs(ctx echo.Context) error
	// Get a list of current active certificates that may be used to setup a mTLS connection
	// (GET /api/mtls/certificates)
	MTLSCertificates(ctx echo.Context) error
	// Claim an organization for the current vendor (registers an organization under the vendor in the registry).
	// (POST /api/organization)
	VendorClaim(ctx echo.Context) error
	// Get organization by id
	// (GET /api/organization/{id})
	OrganizationById(ctx echo.Context, id string) error
	// Adds/updates an endpoint for this organisation to the registry. If the endpoint already exists (matched by endpoint ID) it is updated.
	// (POST /api/organization/{id}/endpoints)
	RegisterEndpoint(ctx echo.Context, id string) error
	// Refreshes the organization's certificate.
	// (POST /api/organization/{id}/refresh-cert)
	RefreshOrganizationCertificate(ctx echo.Context, id string) error
	// Search for organizations
	// (GET /api/organizations)
	SearchOrganizations(ctx echo.Context, params SearchOrganizationsParams) error
	// Get vendor by id
	// (GET /api/vendor/{id})
	VendorById(ctx echo.Context, id string) error
	// Claim an organization for a vendor (registers an organization under a vendor in the registry).
	// (POST /api/vendor/{id}/claim)
	DeprecatedVendorClaim(ctx echo.Context, id string) error
	// Registers the vendor in the registry
	// (POST /api/vendors)
	RegisterVendor(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) DeprecatedVendorClaim added in v0.14.0

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

DeprecatedVendorClaim converts echo context to params.

func (*ServerInterfaceWrapper) EndpointsByOrganisationId

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

EndpointsByOrganisationId converts echo context to params.

func (*ServerInterfaceWrapper) MTLSCAs added in v0.15.0

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

MTLSCAs converts echo context to params.

func (*ServerInterfaceWrapper) MTLSCertificates added in v0.15.0

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

MTLSCertificates converts echo context to params.

func (*ServerInterfaceWrapper) OrganizationById

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

OrganizationById converts echo context to params.

func (*ServerInterfaceWrapper) RefreshOrganizationCertificate added in v0.14.0

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

RefreshOrganizationCertificate converts echo context to params.

func (*ServerInterfaceWrapper) RegisterEndpoint

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

RegisterEndpoint converts echo context to params.

func (*ServerInterfaceWrapper) RegisterVendor

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

RegisterVendor converts echo context to params.

func (*ServerInterfaceWrapper) SearchOrganizations

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

SearchOrganizations converts echo context to params.

func (*ServerInterfaceWrapper) VendorById added in v0.15.1

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

VendorById converts echo context to params.

func (*ServerInterfaceWrapper) VendorClaim

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

VendorClaim converts echo context to params.

func (*ServerInterfaceWrapper) Verify added in v0.14.0

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

Verify converts echo context to params.

type Vendor

type Vendor struct {

	// Domain the entity operates in.
	Domain Domain `json:"domain"`

	// Generic identifier used for representing BSN, agbcode, etc. It's always constructed as an URN followed by a double colon (:) and then the identifying value of the given URN
	Identifier *Identifier `json:"identifier,omitempty"`
	Keys       *[]JWK      `json:"keys,omitempty"`

	// the well-known name for the vendor
	Name string `json:"name"`
}

Vendor defines model for Vendor.

type VendorByIdResponse added in v0.15.1

type VendorByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Vendor
}

func ParseVendorByIdResponse added in v0.15.1

func ParseVendorByIdResponse(rsp *http.Response) (*VendorByIdResponse, error)

ParseVendorByIdResponse parses an HTTP response from a VendorByIdWithResponse call

func (VendorByIdResponse) Status added in v0.15.1

func (r VendorByIdResponse) Status() string

Status returns HTTPResponse.Status

func (VendorByIdResponse) StatusCode added in v0.15.1

func (r VendorByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VendorClaimEvent

type VendorClaimEvent struct {

	// Generic identifier used for representing BSN, agbcode, etc. It's always constructed as an URN followed by a double colon (:) and then the identifying value of the given URN
	OrgIdentifier Identifier `json:"orgIdentifier"`
	OrgKeys       *[]JWK     `json:"orgKeys,omitempty"`

	// the well-known name for the organisation
	OrgName string `json:"orgName"`

	// Generic identifier used for representing BSN, agbcode, etc. It's always constructed as an URN followed by a double colon (:) and then the identifying value of the given URN
	VendorIdentifier Identifier `json:"vendorIdentifier"`
}

VendorClaimEvent defines model for VendorClaimEvent.

type VendorClaimJSONBody

type VendorClaimJSONBody Organization

VendorClaimJSONBody defines parameters for VendorClaim.

type VendorClaimJSONRequestBody

type VendorClaimJSONRequestBody VendorClaimJSONBody

VendorClaimRequestBody defines body for VendorClaim for application/json ContentType.

type VendorClaimResponse added in v0.15.1

type VendorClaimResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Event
}

func ParseVendorClaimResponse

func ParseVendorClaimResponse(rsp *http.Response) (*VendorClaimResponse, error)

ParseVendorClaimResponse parses an HTTP response from a VendorClaimWithResponse call

func (VendorClaimResponse) Status added in v0.15.1

func (r VendorClaimResponse) Status() string

Status returns HTTPResponse.Status

func (VendorClaimResponse) StatusCode added in v0.15.1

func (r VendorClaimResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VerifyParams added in v0.14.0

type VerifyParams struct {

	// Wheter to fix data in the registry that's broken or requires upgrading
	Fix *bool `json:"fix,omitempty"`
}

VerifyParams defines parameters for Verify.

type VerifyResponse added in v0.15.1

type VerifyResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {

		// list of events that resulted from fixing the data, list may be empty
		Events *[]Event `json:"events,omitempty"`

		// if true, the data in the registry needs fixing/upgrading.
		Fix *bool `json:"fix,omitempty"`
	}
}

func ParseVerifyResponse added in v0.14.0

func ParseVerifyResponse(rsp *http.Response) (*VerifyResponse, error)

ParseVerifyResponse parses an HTTP response from a VerifyWithResponse call

func (VerifyResponse) Status added in v0.15.1

func (r VerifyResponse) Status() string

Status returns HTTPResponse.Status

func (VerifyResponse) StatusCode added in v0.15.1

func (r VerifyResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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