verifier

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 39 Imported by: 1

Documentation

Overview

Package verifier 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 {
	VerifyCredentialSvc   verifyCredentialSvc
	VerifyPresentationSvc verifyPresentationSvc
	ProfileSvc            profileService
	KMSRegistry           kmsRegistry
	DocumentLoader        ld.DocumentLoader
	VDR                   vdrapi.Registry
	OIDCVPService         oidc4VPService
	ProofChecker          verifiable.CombinedProofChecker
	Metrics               metricsProvider
	Tracer                trace.Tracer
	EventSvc              eventService
	EventTopic            string
}

type Controller

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

Controller for Verifier Profile Management API.

func NewController

func NewController(config *Config) *Controller

NewController creates a new controller for Verifier Profile Management API.

func (*Controller) CheckAuthorizationResponse

func (c *Controller) CheckAuthorizationResponse(e echo.Context) error

CheckAuthorizationResponse is used by verifier applications to initiate OpenID presentation flow through VCS. (POST /verifier/interactions/authorization-response).

func (*Controller) InitiateOidcInteraction

func (c *Controller) InitiateOidcInteraction(e echo.Context, profileID, profileVersion string) error

InitiateOidcInteraction initiates OpenID presentation flow through VCS. POST /verifier/profiles/{profileID}/{profileVersion}/interactions/initiate-oidc.

func (*Controller) PostVerifyCredentials

func (c *Controller) PostVerifyCredentials(e echo.Context, profileID, profileVersion string) error

PostVerifyCredentials Verify credential (POST /verifier/profiles/{profileID}/{profileVersion}/credentials/verify).

func (*Controller) PostVerifyPresentation

func (c *Controller) PostVerifyPresentation(e echo.Context, profileID, profileVersion string) error

PostVerifyPresentation Verify presentation. (POST /verifier/profiles/{profileID}/{profileVersion}/presentations/verify).

func (*Controller) RetrieveInteractionsClaim

func (c *Controller) RetrieveInteractionsClaim(e echo.Context, txID string) error

RetrieveInteractionsClaim is used by verifier applications to get claims obtained during oidc4vp interaction. (GET /verifier/interactions/{txID}/claim).

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 IDTokenClaims

type IDTokenClaims struct {
	// CustomScopeClaims stores claims retrieved using custom scope.
	CustomScopeClaims map[string]oidc4vp.Claims `json:"_scope,omitempty"`
	VPToken           IDTokenVPToken            `json:"_vp_token"`
	AttestationVP     string                    `json:"_attestation_vp"`
	Nonce             string                    `json:"nonce"`
	Aud               string                    `json:"aud"`
	Exp               int64                     `json:"exp"`
}

type IDTokenVPToken

type IDTokenVPToken struct {
	// TODO: use *presexch.PresentationSubmission instead of map[string]interface{}
	PresentationSubmission map[string]interface{} `json:"presentation_submission"`
}

type InitiateOIDC4VPData

type InitiateOIDC4VPData struct {
	PresentationDefinitionFilters *PresentationDefinitionFilters `json:"presentationDefinitionFilters,omitempty"`
	PresentationDefinitionId      *string                        `json:"presentationDefinitionId,omitempty"`
	Purpose                       *string                        `json:"purpose,omitempty"`

	// List of custom scopes that defines additional claims requested from Holder to Verifier.
	Scopes *[]string `json:"scopes,omitempty"`
}

InitiateOIDC4VPData defines model for InitiateOIDC4VPData.

type InitiateOIDC4VPResponse

type InitiateOIDC4VPResponse struct {
	AuthorizationRequest string `json:"authorizationRequest"`
	TxID                 string `json:"txID"`
}

InitiateOIDC4VPResponse defines model for InitiateOIDC4VPResponse.

type InitiateOidcInteractionJSONBody

type InitiateOidcInteractionJSONBody = InitiateOIDC4VPData

InitiateOidcInteractionJSONBody defines parameters for InitiateOidcInteraction.

type InitiateOidcInteractionJSONRequestBody

type InitiateOidcInteractionJSONRequestBody = InitiateOidcInteractionJSONBody

InitiateOidcInteractionJSONRequestBody defines body for InitiateOidcInteraction for application/json ContentType.

type PostVerifyCredentialsJSONBody

type PostVerifyCredentialsJSONBody = VerifyCredentialData

PostVerifyCredentialsJSONBody defines parameters for PostVerifyCredentials.

type PostVerifyCredentialsJSONRequestBody

type PostVerifyCredentialsJSONRequestBody = PostVerifyCredentialsJSONBody

PostVerifyCredentialsJSONRequestBody defines body for PostVerifyCredentials for application/json ContentType.

type PostVerifyPresentationJSONBody

type PostVerifyPresentationJSONBody = VerifyPresentationData

PostVerifyPresentationJSONBody defines parameters for PostVerifyPresentation.

type PostVerifyPresentationJSONRequestBody

type PostVerifyPresentationJSONRequestBody = PostVerifyPresentationJSONBody

PostVerifyPresentationJSONRequestBody defines body for PostVerifyPresentation for application/json ContentType.

type PresentationDefinition

type PresentationDefinition = json.RawMessage

type PresentationDefinitionFilters

type PresentationDefinitionFilters struct {
	Fields *[]string `json:"fields,omitempty"`
}

PresentationDefinitionFilters defines model for PresentationDefinitionFilters.

type ServerInterface

type ServerInterface interface {
	// Used by verifier applications to initiate OpenID presentation flow through VCS
	// (POST /verifier/interactions/authorization-response)
	CheckAuthorizationResponse(ctx echo.Context) error
	// Used by verifier applications to get claims obtained during oidc4vp interaction.
	// (GET /verifier/interactions/{txID}/claim)
	RetrieveInteractionsClaim(ctx echo.Context, txID string) error
	// Verify credential
	// (POST /verifier/profiles/{profileID}/{profileVersion}/credentials/verify)
	PostVerifyCredentials(ctx echo.Context, profileID string, profileVersion string) error
	// Used by verifier applications to initiate OpenID presentation flow through VCS
	// (POST /verifier/profiles/{profileID}/{profileVersion}/interactions/initiate-oidc)
	InitiateOidcInteraction(ctx echo.Context, profileID string, profileVersion string) error
	// Verify presentation
	// (POST /verifier/profiles/{profileID}/{profileVersion}/presentations/verify)
	PostVerifyPresentation(ctx echo.Context, profileID string, profileVersion string) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CheckAuthorizationResponse

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

CheckAuthorizationResponse converts echo context to params.

func (*ServerInterfaceWrapper) InitiateOidcInteraction

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

InitiateOidcInteraction converts echo context to params.

func (*ServerInterfaceWrapper) PostVerifyCredentials

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

PostVerifyCredentials converts echo context to params.

func (*ServerInterfaceWrapper) PostVerifyPresentation

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

PostVerifyPresentation converts echo context to params.

func (*ServerInterfaceWrapper) RetrieveInteractionsClaim

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

RetrieveInteractionsClaim converts echo context to params.

type VPTokenClaims

type VPTokenClaims struct {
	Nonce         string
	Aud           string
	SignerDIDID   string
	VpTokenFormat vcsverifiable.Format
	VP            *verifiable.Presentation
}

type VerifyCredentialCheckResult

type VerifyCredentialCheckResult struct {
	// Check title.
	Check string `json:"check"`

	// Error message.
	Error string `json:"error"`

	// Verification method.
	VerificationMethod string `json:"verificationMethod"`
}

Verify credential response containing failure check details.

type VerifyCredentialData

type VerifyCredentialData struct {
	// Credential in jws(string) or jsonld(object) formats.
	Credential interface{} `json:"credential"`

	// Options for verify credential.
	Options *VerifyCredentialOptions `json:"options,omitempty"`
}

Model for credential verification.

type VerifyCredentialOptions

type VerifyCredentialOptions struct {
	// Chalange is added to the proof.
	Challenge *string `json:"challenge,omitempty"`

	// Domain is added to the proof.
	Domain *string `json:"domain,omitempty"`
}

Options for verify credential.

type VerifyCredentialResponse

type VerifyCredentialResponse struct {
	Checks *[]VerifyCredentialCheckResult `json:"checks,omitempty"`
}

Model for response of credentials verification.

type VerifyPresentationCheckResult

type VerifyPresentationCheckResult struct {
	// Check title.
	Check string `json:"check"`

	// Error message.
	Error string `json:"error"`
}

Verify presentation response containing failure check details.

type VerifyPresentationData

type VerifyPresentationData struct {
	// Options for verify presentation.
	Options *VerifyPresentationOptions `json:"options,omitempty"`

	// Presentation in jws(string) or jsonld(object) formats.
	Presentation interface{} `json:"presentation"`
}

Model for presentation verification.

type VerifyPresentationOptions

type VerifyPresentationOptions struct {
	// Challenge is added to the proof.
	Challenge *string `json:"challenge,omitempty"`

	// Domain is added to the proof.
	Domain *string `json:"domain,omitempty"`
}

Options for verify presentation.

type VerifyPresentationResponse

type VerifyPresentationResponse struct {
	Checks *[]VerifyPresentationCheckResult `json:"checks,omitempty"`
}

Model for response of presentation verification.

Jump to

Keyboard shortcuts

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