protocol

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadRequest

type BadRequest = ProblemDetails

BadRequest RFC 9457 problem details object.

type Conflict

type Conflict = ProblemDetails

Conflict RFC 9457 problem details object.

type DPoPProof

type DPoPProof = string

DPoPProof A DPoP proof JWT, presented in the `DPoP` HTTP header per RFC 9449. The header value is the compact-serialization JWT itself; this schema is documentary and cross-referenced by ApiKeySecurityScheme docs only.

type Forbidden

type Forbidden = ProblemDetails

Forbidden RFC 9457 problem details object.

type InternalServerError

type InternalServerError = ProblemDetails

InternalServerError RFC 9457 problem details object.

type JWK

type JWK struct {
	Alg                  *string                `json:"alg,omitempty"`
	Crv                  *string                `json:"crv,omitempty"`
	E                    *string                `json:"e,omitempty"`
	Kid                  *string                `json:"kid,omitempty"`
	Kty                  string                 `json:"kty"`
	N                    *string                `json:"n,omitempty"`
	Use                  *string                `json:"use,omitempty"`
	X                    *string                `json:"x,omitempty"`
	Y                    *string                `json:"y,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

JWK A JSON Web Key as defined by RFC 7517.

func (JWK) Get

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

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

func (JWK) MarshalJSON

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

Override default JSON handling for JWK to handle AdditionalProperties

func (*JWK) Set

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

Setter for additional properties for JWK

func (*JWK) UnmarshalJSON

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

Override default JSON handling for JWK to handle AdditionalProperties

type MailboxCaptchaRequestPayloadV1

type MailboxCaptchaRequestPayloadV1 struct {
	// Action Relying-party action label.
	Action string `json:"action"`

	// ChallengeId Captcha challenge id.
	ChallengeId string `json:"challenge_id"`

	// ExpiresAt Captcha request expiry as a Unix timestamp in seconds.
	ExpiresAt int64 `json:"expires_at"`

	// Origin Canonical relying-party origin. The captcha request producer MUST canonicalize this value before sending; approval bindings copy this exact string without further normalization.
	Origin string `json:"origin"`
}

MailboxCaptchaRequestPayloadV1 Documentary schema for `MailboxEnvelopeV1` payload when `type` is `captcha_request`.

type MailboxCaptchaResponsePayloadV1

type MailboxCaptchaResponsePayloadV1 struct {
	// ApprovalBinding RFC 4648 standard base64 with `=` padding for the deterministic CBOR `NaughtBotApprovalBindingV1` bytes whose SHA-256 is signed as the approval hash. This is not the HPKE transport's base64url encoding.
	ApprovalBinding []byte `json:"approval_binding"`

	// Proof RFC 4648 standard base64 with `=` padding for the attested-key-zk approval proof bytes. This is not the HPKE transport's base64url encoding.
	Proof []byte `json:"proof"`

	// ProofType Attested-key-zk approval proof type.
	ProofType MailboxCaptchaResponsePayloadV1ProofType `json:"proof_type"`

	// RequestEnvelopeId Source captcha request `MailboxEnvelopeV1.id`.
	RequestEnvelopeId openapi_types.UUID `json:"request_envelope_id"`
}

MailboxCaptchaResponsePayloadV1 Documentary schema for `MailboxEnvelopeV1` payload when `type` is `captcha_response`.

type MailboxCaptchaResponsePayloadV1ProofType

type MailboxCaptchaResponsePayloadV1ProofType string

MailboxCaptchaResponsePayloadV1ProofType Attested-key-zk approval proof type.

const (
	ApprovalProofV1 MailboxCaptchaResponsePayloadV1ProofType = "approval_proof_v1"
)

Defines values for MailboxCaptchaResponsePayloadV1ProofType.

func (MailboxCaptchaResponsePayloadV1ProofType) Valid

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

type MailboxEnvelopeV1

type MailboxEnvelopeV1 struct {
	// Id Canonical lower-case RFC 4122 UUID string for idempotency / dedup on receiver.
	Id openapi_types.UUID `json:"id"`

	// IssuedAt RFC 3339 UTC timestamp with the canonical `Z` suffix. Senders SHOULD emit fractional seconds (`2026-05-03T05:00:00.123Z`); receivers MUST also accept the plain second-precision form (`2026-05-03T05:00:00Z`). Times outside UTC and timestamps lacking the `T` delimiter are rejected. See `memories/mailbox-envelope.md` § "Timestamp format" for the full rule.
	IssuedAt time.Time `json:"issued_at"`

	// Payload Type-specific payload, MUST be a JSON object (`{...}`); scalar / array / string roots are not valid envelopes. Internal schema is validated by the per-`type` handler, not by the envelope codec.
	Payload map[string]interface{} `json:"payload"`

	// Type Registered type discriminator. Receivers may decode the envelope successfully but log+drop on unknown values. Registered v1 values: `link_request`, `link_approval`, `link_rejection`, `captcha_request`, and `captcha_response`.
	Type string `json:"type"`

	// V Envelope version. Receivers reject unknown versions.
	V MailboxEnvelopeV1V `json:"v"`
}

MailboxEnvelopeV1 Typed plaintext envelope for NaughtBot mailbox payloads. Lives inside the HPKE-decrypted bytes (after `{enc, ct, aad}` HPKE open). Receivers dispatch on `type`. This schema is documentary — the auth/mailbox backend never sees the envelope (it is inside HPKE plaintext) and no endpoint accepts it directly. See `memories/mailbox-envelope.md` for the canonical spec including registered `type` values and decode rules.

type MailboxEnvelopeV1V

type MailboxEnvelopeV1V int

MailboxEnvelopeV1V Envelope version. Receivers reject unknown versions.

const (
	MailboxEnvelopeV1VN1 MailboxEnvelopeV1V = 1
)

Defines values for MailboxEnvelopeV1V.

func (MailboxEnvelopeV1V) Valid

func (e MailboxEnvelopeV1V) Valid() bool

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

type NaughtBotApprovalBindingV1

type NaughtBotApprovalBindingV1 struct {
	// EnvelopeId Source `MailboxEnvelopeV1.id` as a canonical lower-case RFC 4122 UUID string.
	EnvelopeId openapi_types.UUID `json:"envelope_id"`

	// EnvelopeType Source `MailboxEnvelopeV1.type`; only captcha requests are signed.
	EnvelopeType NaughtBotApprovalBindingV1EnvelopeType `json:"envelope_type"`

	// EnvelopeV Source `MailboxEnvelopeV1.v`.
	EnvelopeV NaughtBotApprovalBindingV1EnvelopeV `json:"envelope_v"`

	// IssuedAt Source `MailboxEnvelopeV1.issued_at`, preserved as a string.
	IssuedAt string `json:"issued_at"`
	Payload  struct {
		// Action Relying-party action label from the captcha request payload.
		Action string `json:"action"`

		// ChallengeId Captcha challenge id from the captcha request payload.
		ChallengeId string `json:"challenge_id"`

		// ExpiresAt Captcha request expiry as a Unix timestamp in seconds.
		ExpiresAt int64 `json:"expires_at"`

		// Origin Already-canonical relying-party origin from the captcha request payload, copied byte-for-byte with no approval-binding normalization.
		Origin string `json:"origin"`
	} `json:"payload"`
}

NaughtBotApprovalBindingV1 Deterministic CBOR projection mobile signs for captcha approval proofs and verifiers hash as `approval_hash = SHA256(binding bytes)`. Encode this object with RFC 8949 core deterministic CBOR; do not hash raw JSON or a service-specific JSON canonicalization. The `origin` field in the payload is copied exactly from the already-canonical `captcha_request.payload.origin`.

type NaughtBotApprovalBindingV1EnvelopeType

type NaughtBotApprovalBindingV1EnvelopeType string

NaughtBotApprovalBindingV1EnvelopeType Source `MailboxEnvelopeV1.type`; only captcha requests are signed.

const (
	CaptchaRequest NaughtBotApprovalBindingV1EnvelopeType = "captcha_request"
)

Defines values for NaughtBotApprovalBindingV1EnvelopeType.

func (NaughtBotApprovalBindingV1EnvelopeType) Valid

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

type NaughtBotApprovalBindingV1EnvelopeV

type NaughtBotApprovalBindingV1EnvelopeV int

NaughtBotApprovalBindingV1EnvelopeV Source `MailboxEnvelopeV1.v`.

const (
	NaughtBotApprovalBindingV1EnvelopeVN1 NaughtBotApprovalBindingV1EnvelopeV = 1
)

Defines values for NaughtBotApprovalBindingV1EnvelopeV.

func (NaughtBotApprovalBindingV1EnvelopeV) Valid

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

type NotFound

type NotFound = ProblemDetails

NotFound RFC 9457 problem details object.

type NotImplemented

type NotImplemented = ProblemDetails

NotImplemented RFC 9457 problem details object.

type Pagination

type Pagination struct {
	// NextCursor Opaque cursor for the next page; null when no more pages.
	NextCursor *string `json:"next_cursor,omitempty"`
	PageSize   *int    `json:"page_size,omitempty"`
}

Pagination Cursor-based pagination metadata.

type PayloadTooLarge

type PayloadTooLarge = ProblemDetails

PayloadTooLarge RFC 9457 problem details object.

type ProblemDetails

type ProblemDetails struct {
	// Detail Human-readable explanation specific to this occurrence.
	Detail *string `json:"detail,omitempty"`

	// Instance URI reference identifying the specific occurrence.
	Instance *string `json:"instance,omitempty"`

	// Status HTTP status code generated by the origin server.
	Status *int `json:"status,omitempty"`

	// Title Short, human-readable summary of the problem type.
	Title *string `json:"title,omitempty"`

	// Type A URI reference identifying the problem type.
	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 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 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