v1

package
v6.2.12 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Index

Constants

View Source
const (
	JwtBearerAuthScopes = "jwtBearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewAddNewVerificationMethodRequest

func NewAddNewVerificationMethodRequest(server string, did string, body AddNewVerificationMethodJSONRequestBody) (*http.Request, error)

NewAddNewVerificationMethodRequest calls the generic AddNewVerificationMethod builder with application/json body

func NewAddNewVerificationMethodRequestWithBody

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

NewAddNewVerificationMethodRequestWithBody generates requests for AddNewVerificationMethod with any type of body

func NewConflictedDIDsRequest

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

NewConflictedDIDsRequest generates requests for ConflictedDIDs

func NewCreateDIDRequest

func NewCreateDIDRequest(server string, body CreateDIDJSONRequestBody) (*http.Request, error)

NewCreateDIDRequest calls the generic CreateDID builder with application/json body

func NewCreateDIDRequestWithBody

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

NewCreateDIDRequestWithBody generates requests for CreateDID with any type of body

func NewDeactivateDIDRequest

func NewDeactivateDIDRequest(server string, did string) (*http.Request, error)

NewDeactivateDIDRequest generates requests for DeactivateDID

func NewDeleteVerificationMethodRequest

func NewDeleteVerificationMethodRequest(server string, did string, kid string) (*http.Request, error)

NewDeleteVerificationMethodRequest generates requests for DeleteVerificationMethod

func NewGetDIDRequest

func NewGetDIDRequest(server string, did string, params *GetDIDParams) (*http.Request, error)

NewGetDIDRequest generates requests for GetDID

func NewUpdateDIDRequest

func NewUpdateDIDRequest(server string, did string, body UpdateDIDJSONRequestBody) (*http.Request, error)

NewUpdateDIDRequest calls the generic UpdateDID builder with application/json body

func NewUpdateDIDRequestWithBody

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

NewUpdateDIDRequestWithBody generates requests for UpdateDID 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 AddNewVerificationMethod200JSONResponse

type AddNewVerificationMethod200JSONResponse VerificationMethod

func (AddNewVerificationMethod200JSONResponse) VisitAddNewVerificationMethodResponse

func (response AddNewVerificationMethod200JSONResponse) VisitAddNewVerificationMethodResponse(w http.ResponseWriter) error

type AddNewVerificationMethodJSONRequestBody

type AddNewVerificationMethodJSONRequestBody = VerificationMethodRelationship

AddNewVerificationMethodJSONRequestBody defines body for AddNewVerificationMethod for application/json ContentType.

type AddNewVerificationMethodRequestObject

type AddNewVerificationMethodRequestObject struct {
	Did  string `json:"did"`
	Body *AddNewVerificationMethodJSONRequestBody
}

type AddNewVerificationMethodResponse

type AddNewVerificationMethodResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *VerificationMethod
	ApplicationproblemJSONDefault *struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
}

func ParseAddNewVerificationMethodResponse

func ParseAddNewVerificationMethodResponse(rsp *http.Response) (*AddNewVerificationMethodResponse, error)

ParseAddNewVerificationMethodResponse parses an HTTP response from a AddNewVerificationMethodWithResponse call

func (AddNewVerificationMethodResponse) Status

Status returns HTTPResponse.Status

func (AddNewVerificationMethodResponse) StatusCode

func (r AddNewVerificationMethodResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AddNewVerificationMethodResponseObject

type AddNewVerificationMethodResponseObject interface {
	VisitAddNewVerificationMethodResponse(w http.ResponseWriter) error
}

type AddNewVerificationMethoddefaultApplicationProblemPlusJSONResponse

type AddNewVerificationMethoddefaultApplicationProblemPlusJSONResponse struct {
	Body struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
	StatusCode int
}

func (AddNewVerificationMethoddefaultApplicationProblemPlusJSONResponse) VisitAddNewVerificationMethodResponse

func (response AddNewVerificationMethoddefaultApplicationProblemPlusJSONResponse) VisitAddNewVerificationMethodResponse(w http.ResponseWriter) error

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

func (c *Client) AddNewVerificationMethod(ctx context.Context, did string, body AddNewVerificationMethodJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AddNewVerificationMethodWithBody

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

func (*Client) ConflictedDIDs

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

func (*Client) CreateDID

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

func (*Client) CreateDIDWithBody

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

func (*Client) DeactivateDID

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

func (*Client) DeleteVerificationMethod

func (c *Client) DeleteVerificationMethod(ctx context.Context, did string, kid string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetDID

func (c *Client) GetDID(ctx context.Context, did string, params *GetDIDParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateDID

func (c *Client) UpdateDID(ctx context.Context, did string, body UpdateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateDIDWithBody

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

type ClientInterface

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

	CreateDID(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ConflictedDIDs request
	ConflictedDIDs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// GetDID request
	GetDID(ctx context.Context, did string, params *GetDIDParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	UpdateDID(ctx context.Context, did string, body UpdateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	AddNewVerificationMethod(ctx context.Context, did string, body AddNewVerificationMethodJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteVerificationMethod request
	DeleteVerificationMethod(ctx context.Context, did string, kid string, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

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

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

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

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

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

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

func (*ClientWithResponses) AddNewVerificationMethodWithBodyWithResponse

func (c *ClientWithResponses) AddNewVerificationMethodWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddNewVerificationMethodResponse, error)

AddNewVerificationMethodWithBodyWithResponse request with arbitrary body returning *AddNewVerificationMethodResponse

func (*ClientWithResponses) AddNewVerificationMethodWithResponse

func (c *ClientWithResponses) AddNewVerificationMethodWithResponse(ctx context.Context, did string, body AddNewVerificationMethodJSONRequestBody, reqEditors ...RequestEditorFn) (*AddNewVerificationMethodResponse, error)

func (*ClientWithResponses) ConflictedDIDsWithResponse

func (c *ClientWithResponses) ConflictedDIDsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConflictedDIDsResponse, error)

ConflictedDIDsWithResponse request returning *ConflictedDIDsResponse

func (*ClientWithResponses) CreateDIDWithBodyWithResponse

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

CreateDIDWithBodyWithResponse request with arbitrary body returning *CreateDIDResponse

func (*ClientWithResponses) CreateDIDWithResponse

func (c *ClientWithResponses) CreateDIDWithResponse(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error)

func (*ClientWithResponses) DeactivateDIDWithResponse

func (c *ClientWithResponses) DeactivateDIDWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*DeactivateDIDResponse, error)

DeactivateDIDWithResponse request returning *DeactivateDIDResponse

func (*ClientWithResponses) DeleteVerificationMethodWithResponse

func (c *ClientWithResponses) DeleteVerificationMethodWithResponse(ctx context.Context, did string, kid string, reqEditors ...RequestEditorFn) (*DeleteVerificationMethodResponse, error)

DeleteVerificationMethodWithResponse request returning *DeleteVerificationMethodResponse

func (*ClientWithResponses) GetDIDWithResponse

func (c *ClientWithResponses) GetDIDWithResponse(ctx context.Context, did string, params *GetDIDParams, reqEditors ...RequestEditorFn) (*GetDIDResponse, error)

GetDIDWithResponse request returning *GetDIDResponse

func (*ClientWithResponses) UpdateDIDWithBodyWithResponse

func (c *ClientWithResponses) UpdateDIDWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDIDResponse, error)

UpdateDIDWithBodyWithResponse request with arbitrary body returning *UpdateDIDResponse

func (*ClientWithResponses) UpdateDIDWithResponse

func (c *ClientWithResponses) UpdateDIDWithResponse(ctx context.Context, did string, body UpdateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDIDResponse, error)

type ClientWithResponsesInterface

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

	CreateDIDWithResponse(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error)

	// ConflictedDIDsWithResponse request
	ConflictedDIDsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConflictedDIDsResponse, error)

	// DeactivateDIDWithResponse request
	DeactivateDIDWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*DeactivateDIDResponse, error)

	// GetDIDWithResponse request
	GetDIDWithResponse(ctx context.Context, did string, params *GetDIDParams, reqEditors ...RequestEditorFn) (*GetDIDResponse, error)

	// UpdateDIDWithBodyWithResponse request with any body
	UpdateDIDWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDIDResponse, error)

	UpdateDIDWithResponse(ctx context.Context, did string, body UpdateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDIDResponse, error)

	// AddNewVerificationMethodWithBodyWithResponse request with any body
	AddNewVerificationMethodWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddNewVerificationMethodResponse, error)

	AddNewVerificationMethodWithResponse(ctx context.Context, did string, body AddNewVerificationMethodJSONRequestBody, reqEditors ...RequestEditorFn) (*AddNewVerificationMethodResponse, error)

	// DeleteVerificationMethodWithResponse request
	DeleteVerificationMethodWithResponse(ctx context.Context, did string, kid string, reqEditors ...RequestEditorFn) (*DeleteVerificationMethodResponse, error)
}

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

type ConflictedDIDs200JSONResponse

type ConflictedDIDs200JSONResponse []DIDResolutionResult

func (ConflictedDIDs200JSONResponse) VisitConflictedDIDsResponse

func (response ConflictedDIDs200JSONResponse) VisitConflictedDIDsResponse(w http.ResponseWriter) error

type ConflictedDIDsRequestObject

type ConflictedDIDsRequestObject struct {
}

type ConflictedDIDsResponse

type ConflictedDIDsResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]DIDResolutionResult
	ApplicationproblemJSONDefault *struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
}

func ParseConflictedDIDsResponse

func ParseConflictedDIDsResponse(rsp *http.Response) (*ConflictedDIDsResponse, error)

ParseConflictedDIDsResponse parses an HTTP response from a ConflictedDIDsWithResponse call

func (ConflictedDIDsResponse) Status

func (r ConflictedDIDsResponse) Status() string

Status returns HTTPResponse.Status

func (ConflictedDIDsResponse) StatusCode

func (r ConflictedDIDsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ConflictedDIDsResponseObject

type ConflictedDIDsResponseObject interface {
	VisitConflictedDIDsResponse(w http.ResponseWriter) error
}

type ConflictedDIDsdefaultApplicationProblemPlusJSONResponse

type ConflictedDIDsdefaultApplicationProblemPlusJSONResponse struct {
	Body struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
	StatusCode int
}

func (ConflictedDIDsdefaultApplicationProblemPlusJSONResponse) VisitConflictedDIDsResponse

func (response ConflictedDIDsdefaultApplicationProblemPlusJSONResponse) VisitConflictedDIDsResponse(w http.ResponseWriter) error

type CreateDID200JSONResponse

type CreateDID200JSONResponse DIDDocument

func (CreateDID200JSONResponse) VisitCreateDIDResponse

func (response CreateDID200JSONResponse) VisitCreateDIDResponse(w http.ResponseWriter) error

type CreateDIDJSONRequestBody

type CreateDIDJSONRequestBody = DIDCreateRequest

CreateDIDJSONRequestBody defines body for CreateDID for application/json ContentType.

type CreateDIDRequestObject

type CreateDIDRequestObject struct {
	Body *CreateDIDJSONRequestBody
}

type CreateDIDResponse

type CreateDIDResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *DIDDocument
	ApplicationproblemJSONDefault *struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
}

func ParseCreateDIDResponse

func ParseCreateDIDResponse(rsp *http.Response) (*CreateDIDResponse, error)

ParseCreateDIDResponse parses an HTTP response from a CreateDIDWithResponse call

func (CreateDIDResponse) Status

func (r CreateDIDResponse) Status() string

Status returns HTTPResponse.Status

func (CreateDIDResponse) StatusCode

func (r CreateDIDResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateDIDResponseObject

type CreateDIDResponseObject interface {
	VisitCreateDIDResponse(w http.ResponseWriter) error
}

type CreateDIDdefaultApplicationProblemPlusJSONResponse

type CreateDIDdefaultApplicationProblemPlusJSONResponse struct {
	Body struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
	StatusCode int
}

func (CreateDIDdefaultApplicationProblemPlusJSONResponse) VisitCreateDIDResponse

type DIDCreateRequest

type DIDCreateRequest struct {
	VerificationMethodRelationship

	// List of DIDs that can control the new DID Document. If selfControl = true and controllers is not empty,
	// the newly generated DID will be added to the list of controllers.
	Controllers *[]string `json:"controllers,omitempty"`

	// whether the generated DID Document can be altered with its own capabilityInvocation key.
	SelfControl *bool `json:"selfControl,omitempty"`
}

DIDCreateRequest defines model for DIDCreateRequest.

type DIDDocument

type DIDDocument = did.Document

DIDDocument is an alias

type DIDDocumentMetadata

type DIDDocumentMetadata = resolver.DocumentMetadata

DIDDocumentMetadata is an alias

type DIDResolutionResult

type DIDResolutionResult struct {
	// Document A DID document according to the W3C spec following the Nuts Method rules as defined in [Nuts RFC006]
	Document DIDDocument `json:"document"`

	// DocumentMetadata The DID document metadata.
	DocumentMetadata DIDDocumentMetadata `json:"documentMetadata"`
}

DIDResolutionResult defines model for DIDResolutionResult.

type DIDUpdateRequest

type DIDUpdateRequest struct {
	// CurrentHash The hash of the document in hex format. No longer used, contents ignored.
	// Deprecated:
	CurrentHash string `json:"currentHash"`

	// Document A DID document according to the W3C spec following the Nuts Method rules as defined in [Nuts RFC006]
	Document DIDDocument `json:"document"`
}

DIDUpdateRequest defines model for DIDUpdateRequest.

type DeactivateDID200Response

type DeactivateDID200Response struct {
}

func (DeactivateDID200Response) VisitDeactivateDIDResponse

func (response DeactivateDID200Response) VisitDeactivateDIDResponse(w http.ResponseWriter) error

type DeactivateDIDRequestObject

type DeactivateDIDRequestObject struct {
	Did string `json:"did"`
}

type DeactivateDIDResponse

type DeactivateDIDResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	ApplicationproblemJSONDefault *struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
}

func ParseDeactivateDIDResponse

func ParseDeactivateDIDResponse(rsp *http.Response) (*DeactivateDIDResponse, error)

ParseDeactivateDIDResponse parses an HTTP response from a DeactivateDIDWithResponse call

func (DeactivateDIDResponse) Status

func (r DeactivateDIDResponse) Status() string

Status returns HTTPResponse.Status

func (DeactivateDIDResponse) StatusCode

func (r DeactivateDIDResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeactivateDIDResponseObject

type DeactivateDIDResponseObject interface {
	VisitDeactivateDIDResponse(w http.ResponseWriter) error
}

type DeactivateDIDdefaultApplicationProblemPlusJSONResponse

type DeactivateDIDdefaultApplicationProblemPlusJSONResponse struct {
	Body struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
	StatusCode int
}

func (DeactivateDIDdefaultApplicationProblemPlusJSONResponse) VisitDeactivateDIDResponse

type DeleteVerificationMethod204Response

type DeleteVerificationMethod204Response struct {
}

func (DeleteVerificationMethod204Response) VisitDeleteVerificationMethodResponse

func (response DeleteVerificationMethod204Response) VisitDeleteVerificationMethodResponse(w http.ResponseWriter) error

type DeleteVerificationMethodRequestObject

type DeleteVerificationMethodRequestObject struct {
	Did string `json:"did"`
	Kid string `json:"kid"`
}

type DeleteVerificationMethodResponse

type DeleteVerificationMethodResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	ApplicationproblemJSONDefault *struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
}

func ParseDeleteVerificationMethodResponse

func ParseDeleteVerificationMethodResponse(rsp *http.Response) (*DeleteVerificationMethodResponse, error)

ParseDeleteVerificationMethodResponse parses an HTTP response from a DeleteVerificationMethodWithResponse call

func (DeleteVerificationMethodResponse) Status

Status returns HTTPResponse.Status

func (DeleteVerificationMethodResponse) StatusCode

func (r DeleteVerificationMethodResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteVerificationMethodResponseObject

type DeleteVerificationMethodResponseObject interface {
	VisitDeleteVerificationMethodResponse(w http.ResponseWriter) error
}

type DeleteVerificationMethoddefaultApplicationProblemPlusJSONResponse

type DeleteVerificationMethoddefaultApplicationProblemPlusJSONResponse struct {
	Body struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
	StatusCode int
}

func (DeleteVerificationMethoddefaultApplicationProblemPlusJSONResponse) VisitDeleteVerificationMethodResponse

func (response DeleteVerificationMethoddefaultApplicationProblemPlusJSONResponse) VisitDeleteVerificationMethodResponse(w http.ResponseWriter) error

type EchoRouter

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 GetDID200JSONResponse

type GetDID200JSONResponse DIDResolutionResult

func (GetDID200JSONResponse) VisitGetDIDResponse

func (response GetDID200JSONResponse) VisitGetDIDResponse(w http.ResponseWriter) error

type GetDIDParams

type GetDIDParams struct {
	// VersionId If a versionId parameter is provided, the DID resolution algorithm returns a specific version of the DID document.
	// The version is the Sha256 hash of the document.
	// The DID parameters versionId and versionTime are mutually exclusive.
	//
	// See [the did resolution spec about versioning](https://w3c-ccg.github.io/did-resolution/#versioning)
	VersionId *string `form:"versionId,omitempty" json:"versionId,omitempty"`

	// VersionTime If a versionTime parameter is provided, the DID resolution algorithm returns a specific version of the DID document.
	// The DID parameters versionId and versionTime are mutually exclusive.
	//
	// See [the did resolution spec about versioning](https://w3c-ccg.github.io/did-resolution/#versioning)
	VersionTime *string `form:"versionTime,omitempty" json:"versionTime,omitempty"`
}

GetDIDParams defines parameters for GetDID.

type GetDIDRequestObject

type GetDIDRequestObject struct {
	Did    string `json:"did"`
	Params GetDIDParams
}

type GetDIDResponse

type GetDIDResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *DIDResolutionResult
	ApplicationproblemJSONDefault *struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
}

func ParseGetDIDResponse

func ParseGetDIDResponse(rsp *http.Response) (*GetDIDResponse, error)

ParseGetDIDResponse parses an HTTP response from a GetDIDWithResponse call

func (GetDIDResponse) Status

func (r GetDIDResponse) Status() string

Status returns HTTPResponse.Status

func (GetDIDResponse) StatusCode

func (r GetDIDResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetDIDResponseObject

type GetDIDResponseObject interface {
	VisitGetDIDResponse(w http.ResponseWriter) error
}

type GetDIDdefaultApplicationProblemPlusJSONResponse

type GetDIDdefaultApplicationProblemPlusJSONResponse struct {
	Body struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
	StatusCode int
}

func (GetDIDdefaultApplicationProblemPlusJSONResponse) VisitGetDIDResponse

type HTTPClient

type HTTPClient struct {
	core.ClientConfig
	TokenGenerator core.AuthorizationTokenGenerator
}

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

func (HTTPClient) AddNewVerificationMethod

func (hb HTTPClient) AddNewVerificationMethod(DID string) (*did.VerificationMethod, error)

AddNewVerificationMethod creates a new verificationMethod and adds it to the DID document It expects a status 200 response from the server, returns an error otherwise

func (HTTPClient) ConflictedDIDs

func (hb HTTPClient) ConflictedDIDs() ([]DIDResolutionResult, error)

ConflictedDIDs returns the conflicted DID Documents and their metadata

func (HTTPClient) Create

func (hb HTTPClient) Create(createRequest DIDCreateRequest) (*did.Document, error)

Create calls the server and creates a new DID Document

func (HTTPClient) Deactivate

func (hb HTTPClient) Deactivate(DID string) error

Deactivate a DID Document given a DID. It expects a status 200 response from the server, returns an error otherwise.

func (HTTPClient) DeleteVerificationMethod

func (hb HTTPClient) DeleteVerificationMethod(DID, kid string) error

DeleteVerificationMethod deletes a specified verificationMethod from the DID document It expects a status 204 response from the server, returns an error otherwise

func (HTTPClient) Get

Get returns a DID document and metadata based on a DID

func (HTTPClient) Update

func (hb HTTPClient) Update(DID string, current string, next did.Document) (*did.Document, error)

Update a DID Document given a DID and its current hash.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

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 {
	// Creates a new Nuts DID
	// (POST /internal/vdr/v1/did)
	CreateDID(ctx echo.Context) error
	// Retrieve the list of conflicted DID documents
	// (GET /internal/vdr/v1/did/conflicted)
	ConflictedDIDs(ctx echo.Context) error
	// Deactivates a Nuts DID document according to the specification.
	// (DELETE /internal/vdr/v1/did/{did})
	DeactivateDID(ctx echo.Context, did string) error
	// Resolves a Nuts DID document
	// (GET /internal/vdr/v1/did/{did})
	GetDID(ctx echo.Context, did string, params GetDIDParams) error
	// Updates a Nuts DID document.
	// (PUT /internal/vdr/v1/did/{did})
	UpdateDID(ctx echo.Context, did string) error
	// Creates and adds a new verificationMethod to the DID document.
	// (POST /internal/vdr/v1/did/{did}/verificationmethod)
	AddNewVerificationMethod(ctx echo.Context, did string) error
	// Delete a specific verification method
	// (DELETE /internal/vdr/v1/did/{did}/verificationmethod/{kid})
	DeleteVerificationMethod(ctx echo.Context, did string, kid string) error
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) AddNewVerificationMethod

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

AddNewVerificationMethod converts echo context to params.

func (*ServerInterfaceWrapper) ConflictedDIDs

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

ConflictedDIDs converts echo context to params.

func (*ServerInterfaceWrapper) CreateDID

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

CreateDID converts echo context to params.

func (*ServerInterfaceWrapper) DeactivateDID

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

DeactivateDID converts echo context to params.

func (*ServerInterfaceWrapper) DeleteVerificationMethod

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

DeleteVerificationMethod converts echo context to params.

func (*ServerInterfaceWrapper) GetDID

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

GetDID converts echo context to params.

func (*ServerInterfaceWrapper) UpdateDID

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

UpdateDID converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc

type StrictMiddlewareFunc

type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc

type StrictServerInterface

type StrictServerInterface interface {
	// Creates a new Nuts DID
	// (POST /internal/vdr/v1/did)
	CreateDID(ctx context.Context, request CreateDIDRequestObject) (CreateDIDResponseObject, error)
	// Retrieve the list of conflicted DID documents
	// (GET /internal/vdr/v1/did/conflicted)
	ConflictedDIDs(ctx context.Context, request ConflictedDIDsRequestObject) (ConflictedDIDsResponseObject, error)
	// Deactivates a Nuts DID document according to the specification.
	// (DELETE /internal/vdr/v1/did/{did})
	DeactivateDID(ctx context.Context, request DeactivateDIDRequestObject) (DeactivateDIDResponseObject, error)
	// Resolves a Nuts DID document
	// (GET /internal/vdr/v1/did/{did})
	GetDID(ctx context.Context, request GetDIDRequestObject) (GetDIDResponseObject, error)
	// Updates a Nuts DID document.
	// (PUT /internal/vdr/v1/did/{did})
	UpdateDID(ctx context.Context, request UpdateDIDRequestObject) (UpdateDIDResponseObject, error)
	// Creates and adds a new verificationMethod to the DID document.
	// (POST /internal/vdr/v1/did/{did}/verificationmethod)
	AddNewVerificationMethod(ctx context.Context, request AddNewVerificationMethodRequestObject) (AddNewVerificationMethodResponseObject, error)
	// Delete a specific verification method
	// (DELETE /internal/vdr/v1/did/{did}/verificationmethod/{kid})
	DeleteVerificationMethod(ctx context.Context, request DeleteVerificationMethodRequestObject) (DeleteVerificationMethodResponseObject, error)
}

StrictServerInterface represents all server handlers.

type UpdateDID200JSONResponse

type UpdateDID200JSONResponse DIDDocument

func (UpdateDID200JSONResponse) VisitUpdateDIDResponse

func (response UpdateDID200JSONResponse) VisitUpdateDIDResponse(w http.ResponseWriter) error

type UpdateDIDJSONRequestBody

type UpdateDIDJSONRequestBody = DIDUpdateRequest

UpdateDIDJSONRequestBody defines body for UpdateDID for application/json ContentType.

type UpdateDIDRequestObject

type UpdateDIDRequestObject struct {
	Did  string `json:"did"`
	Body *UpdateDIDJSONRequestBody
}

type UpdateDIDResponse

type UpdateDIDResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *DIDDocument
	ApplicationproblemJSONDefault *struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
}

func ParseUpdateDIDResponse

func ParseUpdateDIDResponse(rsp *http.Response) (*UpdateDIDResponse, error)

ParseUpdateDIDResponse parses an HTTP response from a UpdateDIDWithResponse call

func (UpdateDIDResponse) Status

func (r UpdateDIDResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateDIDResponse) StatusCode

func (r UpdateDIDResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UpdateDIDResponseObject

type UpdateDIDResponseObject interface {
	VisitUpdateDIDResponse(w http.ResponseWriter) error
}

type UpdateDIDdefaultApplicationProblemPlusJSONResponse

type UpdateDIDdefaultApplicationProblemPlusJSONResponse struct {
	Body struct {
		// Detail A human-readable explanation specific to this occurrence of the problem.
		Detail string `json:"detail"`

		// Status HTTP statuscode
		Status float32 `json:"status"`

		// Title A short, human-readable summary of the problem type.
		Title string `json:"title"`
	}
	StatusCode int
}

func (UpdateDIDdefaultApplicationProblemPlusJSONResponse) VisitUpdateDIDResponse

type VerificationMethod

type VerificationMethod = did.VerificationMethod

VerificationMethod is an alias

type VerificationMethodRelationship

type VerificationMethodRelationship struct {
	// indicates if the generated key pair can be used for assertions.
	AssertionMethod *bool `json:"assertionMethod,omitempty"`

	// indicates if the generated key pair can be used for authentication.
	Authentication *bool `json:"authentication,omitempty"`

	// indicates if the generated key pair can be used for capability delegations.
	CapabilityDelegation *bool `json:"capabilityDelegation,omitempty"`

	// indicates if the generated key pair can be used for altering DID Documents.
	// In combination with selfControl = true, the key can be used to alter the new DID Document.
	// Defaults to true when not given.
	// default: true
	CapabilityInvocation *bool `json:"capabilityInvocation,omitempty"`

	// indicates if the generated key pair can be used for Key agreements.
	KeyAgreement *bool `json:"keyAgreement,omitempty"`
}

VerificationMethodRelationship defines model for VerificationMethodRelationship.

func (VerificationMethodRelationship) ToFlags

ToFlags takes default key flags, and enabled/disables the flags which are set on the VerificationMethodRelationship, and the result is returned.

type Wrapper

type Wrapper struct {
	VDR            vdr.VDR
	SubjectManager didsubject.Manager
}

Wrapper is needed to connect the implementation to the echo ServiceWrapper

func (*Wrapper) AddNewVerificationMethod

AddNewVerificationMethod accepts a DID and adds a new VerificationMethod to that corresponding document.

func (*Wrapper) CreateDID

CreateDID creates a new DID Document and returns it.

func (*Wrapper) DeactivateDID

DeactivateDID deactivates a DID Document given a DID. It returns a 200 and an empty body if the deactivation was successful.

func (*Wrapper) DeleteVerificationMethod

DeleteVerificationMethod accepts a DID and a KeyIdentifier of a verificationMethod and calls the DocManipulator to remove the verificationMethod from the given document.

func (*Wrapper) GetDID

GetDID returns a DID document and DID document metadata based on a DID.

func (*Wrapper) ResolveStatusCode

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

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

func (*Wrapper) Routes

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

func (*Wrapper) UpdateDID

UpdateDID updates a DID Document given a DID and DID Document body. It returns the updated DID Document.

Jump to

Keyboard shortcuts

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