authattempt

package
v1.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package authattempt holds shared helpers for auth-attempt statement dialects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChecksToJSON

func ChecksToJSON(checks []domain.AuthCheck, ids []string) ([]byte, error)

ChecksToJSON marshals domain checks into the create payload shape. ids must be one dialect-minted check id per check (same length as checks).

func MarshalPayloadJSON

func MarshalPayloadJSON(payload any) (json.RawMessage, error)

MarshalPayloadJSON marshals a challenge or factor payload, returning nil when empty.

func MarshalPayloadString

func MarshalPayloadString(payload any) (*string, error)

MarshalPayloadString marshals a payload to a Spanner JSON string pointer.

func SessionIDArg

func SessionIDArg(sessionID *string) any

SessionIDArg converts an optional session ID string for SQL binding.

Types

type CheckCreate

type CheckCreate struct {
	ID               string          `json:"id"`
	Type             uint8           `json:"type"`
	ChallengePayload json.RawMessage `json:"challenge_payload,omitempty"`
	FactorPayload    json.RawMessage `json:"factor_payload,omitempty"`
	IsChallenge      bool            `json:"is_challenge"`
	IsFactor         bool            `json:"is_factor"`
}

CheckCreate is the JSON shape used when inserting checks alongside an attempt.

Jump to

Keyboard shortcuts

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