refresh

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 Config

type Config struct {
	RefreshService      CredentialRefreshService
	ProfileService      ProfileService
	ProofChecker        ProofChecker
	DocumentLoader      ld.DocumentLoader
	IssuerVCSPublicHost string
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(cfg *Config) *Controller

func (*Controller) GetRefreshedCredential

func (c *Controller) GetRefreshedCredential(
	ctx echo.Context,
	profileID string,
	profileVersion string,
	_ GetRefreshedCredentialParams,
) error

GetRefreshedCredential gets refreshed credentials (POST /refresh/{profileID}/{profileVersion}).

func (*Controller) RequestRefreshStatus

func (c *Controller) RequestRefreshStatus(
	ctx echo.Context,
	issuerID string,
	profileVersion string,
	params RequestRefreshStatusParams,
) error

RequestRefreshStatus gets refresh status (GET /refresh/{profileID}/{profileVersion}).

type CredentialRefreshAvailableResponse

type CredentialRefreshAvailableResponse struct {
	VerifiablePresentationRequest VerifiablePresentationRequest `json:"verifiablePresentationRequest"`
}

Model for Credential Update Response.

type CredentialRefreshService

type CredentialRefreshService interface {
	RequestRefreshStatus(
		ctx context.Context,
		credentialID string,
		issuer profileapi.Issuer,
	) (*refresh.GetRefreshStateResponse, error)

	GetRefreshedCredential(
		ctx context.Context,
		presentation *verifiable.Presentation,
		issuer profileapi.Issuer,
	) (*refresh.GetRefreshedCredentialResponse, error)
}

CredentialRefreshService defines credential refresh service interface.

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 GetRefreshedCredentialJSONBody

type GetRefreshedCredentialJSONBody = GetRefreshedCredentialReq

GetRefreshedCredentialJSONBody defines parameters for GetRefreshedCredential.

type GetRefreshedCredentialJSONRequestBody

type GetRefreshedCredentialJSONRequestBody = GetRefreshedCredentialJSONBody

GetRefreshedCredentialJSONRequestBody defines body for GetRefreshedCredential for application/json ContentType.

type GetRefreshedCredentialParams

type GetRefreshedCredentialParams struct {
	// Credential ID
	CredentialID string `form:"credentialID" json:"credentialID"`
}

GetRefreshedCredentialParams defines parameters for GetRefreshedCredential.

type GetRefreshedCredentialReq

type GetRefreshedCredentialReq struct {
	// Verifiable Presentation.
	VerifiablePresentation []byte `json:"verifiable_presentation"`
}

Model for getting refreshed credential.

type GetRefreshedCredentialResp

type GetRefreshedCredentialResp struct {
	IssuerURI            string      `json:"issuerURI"`
	VerifiableCredential interface{} `json:"verifiable_credential"`
}

Model for getting refreshed credential.

type ProfileService

type ProfileService interface {
	GetProfile(profileID profileapi.ID, profileVersion profileapi.Version) (*profileapi.Issuer, error)
}

ProfileService defines issuer profile service interface.

type ProofChecker

type ProofChecker interface {
	CheckLDProof(proof *proof.Proof, expectedProofIssuer string, msg, signature []byte) error

	// GetLDPCanonicalDocument will return normalized/canonical version of the document
	GetLDPCanonicalDocument(proof *proof.Proof, doc map[string]interface{}, opts ...processor.Opts) ([]byte, error)

	// GetLDPDigest returns document digest
	GetLDPDigest(proof *proof.Proof, doc []byte) ([]byte, error)

	CheckJWTProof(headers jose.Headers, expectedProofIssuer string, msg, signature []byte) error
	CheckCWTProof(
		checkCWTRequest checker.CheckCWTProofRequest,
		expectedProofIssuer string,
		msg []byte,
		signature []byte,
	) error
}

type RefreshService

type RefreshService struct {
	// Service endpoint.
	ServiceEndpoint string `json:"serviceEndpoint"`

	// Service type.
	Type string `json:"type"`
}

RefreshService defines model for RefreshService.

type RefreshServiceInteract

type RefreshServiceInteract struct {
	Service []RefreshService `json:"service"`
}

RefreshServiceInteract defines model for RefreshServiceInteract.

type RequestRefreshStatusParams

type RequestRefreshStatusParams struct {
	// Credential ID
	CredentialID string `form:"credentialID" json:"credentialID"`
}

RequestRefreshStatusParams defines parameters for RequestRefreshStatus.

type ServerInterface

type ServerInterface interface {
	// Get refresh status for credential.
	// (GET /refresh/{profileID}/{profileVersion})
	RequestRefreshStatus(ctx echo.Context, profileID string, profileVersion string, params RequestRefreshStatusParams) error
	// Receive updated (refreshed) credentials.
	// (POST /refresh/{profileID}/{profileVersion})
	GetRefreshedCredential(ctx echo.Context, profileID string, profileVersion string, params GetRefreshedCredentialParams) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) GetRefreshedCredential

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

GetRefreshedCredential converts echo context to params.

func (*ServerInterfaceWrapper) RequestRefreshStatus

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

RequestRefreshStatus converts echo context to params.

type VerifiablePresentationRequest

type VerifiablePresentationRequest struct {
	// Challenge value.
	Challenge string `json:"challenge"`

	// Domain value.
	Domain   string                 `json:"domain"`
	Interact RefreshServiceInteract `json:"interact"`

	// Credential Presentation Query.
	Query map[string]interface{} `json:"query"`
}

VerifiablePresentationRequest defines model for VerifiablePresentationRequest.

Jump to

Keyboard shortcuts

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