verify

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

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

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

Index

Constants

View Source
const (
	DpopAccessTokenScopes dpopAccessTokenContextKey = "dpopAccessToken.Scopes"
)

Variables

This section is empty.

Functions

func NewVerifyProofRequest

func NewVerifyProofRequest(server string, params *VerifyProofParams, body VerifyProofJSONRequestBody) (*http.Request, error)

NewVerifyProofRequest calls the generic VerifyProof builder with application/json body

func NewVerifyProofRequestWithBody

func NewVerifyProofRequestWithBody(server string, params *VerifyProofParams, contentType string, body io.Reader) (*http.Request, error)

NewVerifyProofRequestWithBody generates requests for VerifyProof with any type of body

Types

type ApprovalMessage

type ApprovalMessage struct {
	// Bytes Base64-encoded deterministic approval-binding bytes.
	Bytes []byte `json:"bytes"`

	// Format Deterministic approval-binding encoding.
	Format ApprovalMessageFormat `json:"format"`
}

ApprovalMessage defines model for ApprovalMessage.

type ApprovalMessageFormat

type ApprovalMessageFormat string

ApprovalMessageFormat Deterministic approval-binding encoding.

const (
	ApplicationcborProfileNaughtbotApprovalBindingV1 ApprovalMessageFormat = "application/cbor; profile=naughtbot-approval-binding-v1"
)

Defines values for ApprovalMessageFormat.

func (ApprovalMessageFormat) Valid

func (e ApprovalMessageFormat) Valid() bool

Valid indicates whether the value is a known member of the ApprovalMessageFormat enum.

type BadRequest

type BadRequest = ProblemDetails

BadRequest RFC 9457 problem details object.

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

func (c *Client) VerifyProof(ctx context.Context, params *VerifyProofParams, body VerifyProofJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) VerifyProofWithBody

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

type ClientInterface

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

	VerifyProof(ctx context.Context, params *VerifyProofParams, body VerifyProofJSONRequestBody, 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) VerifyProofWithBodyWithResponse

func (c *ClientWithResponses) VerifyProofWithBodyWithResponse(ctx context.Context, params *VerifyProofParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyProofResp, error)

VerifyProofWithBodyWithResponse request with arbitrary body returning *VerifyProofResp

func (*ClientWithResponses) VerifyProofWithResponse

func (c *ClientWithResponses) VerifyProofWithResponse(ctx context.Context, params *VerifyProofParams, body VerifyProofJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyProofResp, error)

type ClientWithResponsesInterface

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

	VerifyProofWithResponse(ctx context.Context, params *VerifyProofParams, body VerifyProofJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyProofResp, error)
}

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

type DPoPHeader

type DPoPHeader = string

DPoPHeader defines model for DPoPHeader.

type Forbidden

type Forbidden = ProblemDetails

Forbidden RFC 9457 problem details object.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type PayloadTooLarge

type PayloadTooLarge = ProblemDetails

PayloadTooLarge RFC 9457 problem details object.

type ProblemDetails

type ProblemDetails struct {
	Detail               *string                `json:"detail,omitempty"`
	Instance             *string                `json:"instance,omitempty"`
	Status               *int                   `json:"status,omitempty"`
	Title                *string                `json:"title,omitempty"`
	Type                 *string                `json:"type,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ProblemDetails RFC 9457 problem details object.

func (ProblemDetails) Get

func (a ProblemDetails) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ProblemDetails. Returns the specified element and whether it was found

func (ProblemDetails) MarshalJSON

func (a ProblemDetails) MarshalJSON() ([]byte, error)

Override default JSON handling for ProblemDetails to handle AdditionalProperties

func (*ProblemDetails) Set

func (a *ProblemDetails) Set(fieldName string, value interface{})

Setter for additional properties for ProblemDetails

func (*ProblemDetails) UnmarshalJSON

func (a *ProblemDetails) UnmarshalJSON(b []byte) error

Override default JSON handling for ProblemDetails to handle AdditionalProperties

type ProofAudience

type ProofAudience struct {
	// Kind Audience namespace.
	Kind ProofAudienceKind `json:"kind"`

	// Value Origin to bind into the proof statement.
	Value string `json:"value"`
}

ProofAudience defines model for ProofAudience.

type ProofAudienceKind

type ProofAudienceKind string

ProofAudienceKind Audience namespace.

const (
	Origin ProofAudienceKind = "origin"
)

Defines values for ProofAudienceKind.

func (ProofAudienceKind) Valid

func (e ProofAudienceKind) Valid() bool

Valid indicates whether the value is a known member of the ProofAudienceKind enum.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ServiceUnavailable

type ServiceUnavailable = ProblemDetails

ServiceUnavailable RFC 9457 problem details object.

type TooManyRequests

type TooManyRequests = ProblemDetails

TooManyRequests RFC 9457 problem details object.

type Unauthorized

type Unauthorized = ProblemDetails

Unauthorized RFC 9457 problem details object.

type UnprocessableEntity

type UnprocessableEntity = ProblemDetails

UnprocessableEntity RFC 9457 problem details object.

type VerifyProofJSONRequestBody

type VerifyProofJSONRequestBody = VerifyProofRequest

VerifyProofJSONRequestBody defines body for VerifyProof for application/json ContentType.

type VerifyProofParams

type VerifyProofParams struct {
	// XRequestID Optional client-supplied correlation identifier.
	XRequestID *XRequestID `json:"X-Request-ID,omitempty"`

	// DPoP RFC 9449 DPoP proof JWT.
	DPoP DPoPHeader `json:"DPoP"`
}

VerifyProofParams defines parameters for VerifyProof.

type VerifyProofRequest

type VerifyProofRequest struct {
	ApprovalMessage ApprovalMessage `json:"approval_message"`
	Audience        ProofAudience   `json:"audience"`

	// ChallengeId Protocol challenge id; hashed as UTF-8 into the AKZK statement.
	ChallengeId string `json:"challenge_id"`

	// Proof Base64-encoded raw ApprovalProofV1 proof bytes.
	Proof []byte `json:"proof"`

	// ProofType Proof system and statement version.
	ProofType VerifyProofRequestProofType `json:"proof_type"`
}

VerifyProofRequest defines model for VerifyProofRequest.

type VerifyProofRequestProofType

type VerifyProofRequestProofType string

VerifyProofRequestProofType Proof system and statement version.

const (
	VerifyProofRequestProofTypeApprovalProofV1 VerifyProofRequestProofType = "approval_proof_v1"
)

Defines values for VerifyProofRequestProofType.

func (VerifyProofRequestProofType) Valid

Valid indicates whether the value is a known member of the VerifyProofRequestProofType enum.

type VerifyProofResp

type VerifyProofResp struct {
	Body                      []byte
	HTTPResponse              *http.Response
	JSON200                   *VerifyProofResponse
	ApplicationproblemJSON400 *BadRequest
	ApplicationproblemJSON401 *Unauthorized
	ApplicationproblemJSON403 *Forbidden
	ApplicationproblemJSON413 *PayloadTooLarge
	ApplicationproblemJSON422 *UnprocessableEntity
	ApplicationproblemJSON429 *TooManyRequests
	ApplicationproblemJSON503 *ServiceUnavailable
}

func ParseVerifyProofResp

func ParseVerifyProofResp(rsp *http.Response) (*VerifyProofResp, error)

ParseVerifyProofResp parses an HTTP response from a VerifyProofWithResponse call

func (VerifyProofResp) ContentType added in v0.20.0

func (r VerifyProofResp) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (VerifyProofResp) Status

func (r VerifyProofResp) Status() string

Status returns HTTPResponse.Status

func (VerifyProofResp) StatusCode

func (r VerifyProofResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VerifyProofResponse

type VerifyProofResponse struct {
	Passed     bool                         `json:"passed"`
	ProofType  VerifyProofResponseProofType `json:"proof_type"`
	VerifiedAt time.Time                    `json:"verified_at"`
}

VerifyProofResponse defines model for VerifyProofResponse.

type VerifyProofResponseProofType

type VerifyProofResponseProofType string

VerifyProofResponseProofType defines model for VerifyProofResponse.ProofType.

const (
	VerifyProofResponseProofTypeApprovalProofV1 VerifyProofResponseProofType = "approval_proof_v1"
)

Defines values for VerifyProofResponseProofType.

func (VerifyProofResponseProofType) Valid

Valid indicates whether the value is a known member of the VerifyProofResponseProofType enum.

type XRequestID

type XRequestID = string

XRequestID defines model for XRequestID.

Jump to

Keyboard shortcuts

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