experimental

package
v0.16.0 Latest Latest
Warning

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

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

Documentation

Overview

Package experimental 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

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router 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
}, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

Types

type ContractLanguage

type ContractLanguage string

ContractLanguage defines model for ContractLanguage.

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 ContractType

type ContractType string

ContractType defines model for ContractType.

type ContractVersion

type ContractVersion string

ContractVersion defines model for ContractVersion.

type CreateSignSessionJSONBody

type CreateSignSessionJSONBody CreateSignSessionRequest

CreateSignSessionJSONBody defines parameters for CreateSignSession.

type CreateSignSessionJSONRequestBody

type CreateSignSessionJSONRequestBody CreateSignSessionJSONBody

CreateSignSessionRequestBody defines body for CreateSignSession for application/json ContentType.

type CreateSignSessionRequest

type CreateSignSessionRequest struct {
	Means string `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"`
}

CreateSignSessionRequest defines model for CreateSignSessionRequest.

type CreateSignSessionResponse

type CreateSignSessionResponse struct {

	// The means this session uses to sign.
	Means string `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"`
}

CreateSignSessionResponse defines model for CreateSignSessionResponse.

type DrawUpContractJSONBody

type DrawUpContractJSONBody DrawUpContractRequest

DrawUpContractJSONBody defines parameters for DrawUpContract.

type DrawUpContractJSONRequestBody

type DrawUpContractJSONRequestBody DrawUpContractJSONBody

DrawUpContractRequestBody defines body for DrawUpContract for application/json ContentType.

type DrawUpContractRequest

type DrawUpContractRequest struct {

	// Language of the contract in all caps.
	Language ContractLanguage `json:"language"`

	// Identifier of the legalEntity 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 GetSignSessionStatusResponse

type GetSignSessionStatusResponse 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"`
}

GetSignSessionStatusResponse defines model for GetSignSessionStatusResponse.

type LegalEntity

type LegalEntity string

LegalEntity defines model for LegalEntity.

type ServerInterface

type ServerInterface interface {
	// Draw up a contract using a specified contract template, language and version
	// (PUT /internal/auth/experimental/contract/drawup)
	DrawUpContract(ctx echo.Context) error
	// Create a signing session for a supported means.
	// (POST /internal/auth/experimental/signature/session)
	CreateSignSession(ctx echo.Context) error
	// Get the current status of a signing session
	// (GET /internal/auth/experimental/signature/session/{sessionID})
	GetSignSessionStatus(ctx echo.Context, sessionID string) error
	// Verify a signature in the form of a verifiable presentation
	// (PUT /internal/auth/experimental/signature/verify)
	VerifySignature(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

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

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

GetSignSessionStatus converts echo context to params.

func (*ServerInterfaceWrapper) VerifySignature

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

VerifySignature converts echo context to params.

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"`
}

SignatureVerificationResponse defines model for SignatureVerificationResponse.

type VerifiablePresentation

type VerifiablePresentation struct {
	Context []string               `json:"@context"`
	Proof   map[string]interface{} `json:"proof"`
	Type    []string               `json:"type"`
}

VerifiablePresentation defines model for VerifiablePresentation.

type VerifySignatureJSONBody

type VerifySignatureJSONBody SignatureVerificationRequest

VerifySignatureJSONBody defines parameters for VerifySignature.

type VerifySignatureJSONRequestBody

type VerifySignatureJSONRequestBody VerifySignatureJSONBody

VerifySignatureRequestBody defines body for VerifySignature for application/json ContentType.

type Wrapper

type Wrapper struct {
	Auth pkg.AuthClient
}

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 AuthClient. Converts internal results back to the generated Api types. Handles errors and returns the correct http response. It does not perform any business logic.

This is the experimental API. It is used to tests APIs is the wild.

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) 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) 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 ContractClient to verify the VP.

Jump to

Keyboard shortcuts

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