consent

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceCodeEntryPage

func DeviceCodeEntryPage(data CodeEntryPageData) g.Node

DeviceCodeEntryPage renders the device code entry page using ForgeUI.

func DeviceSuccessPage

func DeviceSuccessPage(approved bool, branding BrandingConfig) g.Node

DeviceSuccessPage renders the authorization success/denial page using ForgeUI.

func DeviceVerificationPage

func DeviceVerificationPage(data VerificationPageData) g.Node

DeviceVerificationPage renders the device verification and consent page using ForgeUI.

func OAuthConsentPage

func OAuthConsentPage(data ConsentPageData) g.Node

OAuthConsentPage renders the OAuth consent page using ForgeUI.

Types

type BrandingConfig

type BrandingConfig struct {
	PrimaryColor    string // Main brand color (e.g., "#4F46E5")
	BackgroundColor string // Page background color (e.g., "#F9FAFB")
	CardBackground  string // Card background color (e.g., "#FFFFFF")
	TextColor       string // Primary text color (e.g., "#111827")
	AppName         string // Display name (e.g., "Acme Inc")
}

BrandingConfig contains branding configuration for consent pages.

func DefaultBranding

func DefaultBranding() BrandingConfig

DefaultBranding returns the default branding configuration.

func ExtractBranding

func ExtractBranding(client *schema.OAuthClient, app *schema.App) BrandingConfig

ExtractBranding extracts branding configuration from OAuth client or app metadata Priority: 1. Client metadata, 2. App metadata, 3. Defaults.

type CodeEntryPageData

type CodeEntryPageData struct {
	UserCode    string
	ErrorMsg    string
	Branding    BrandingConfig
	BasePath    string // Base path for URLs (e.g., "/oauth2")
	RedirectURL string // Optional redirect URL after authorization
}

CodeEntryPageData contains data for the device code entry page.

type ConsentPageData

type ConsentPageData struct {
	ClientName          string
	ClientID            string
	LogoURI             string
	Scopes              []ScopeInfo
	RedirectURI         string
	ResponseType        string
	State               string
	CodeChallenge       string
	CodeChallengeMethod string
	Nonce               string
	Branding            BrandingConfig
}

ConsentPageData contains all data needed for the consent page.

type ScopeInfo

type ScopeInfo struct {
	Scope       string
	Description string
}

ScopeInfo represents a scope with its description.

type VerificationPageData

type VerificationPageData struct {
	UserCode          string // Normalized code (stored in DB, used in form field)
	UserCodeFormatted string // Formatted code (displayed to user)
	ClientName        string
	LogoURI           string
	Scopes            []ScopeInfo
	Branding          BrandingConfig
	BasePath          string // Base path for URLs (e.g., "/oauth2")
	RedirectURL       string // Optional redirect URL after authorization
}

VerificationPageData contains data for the device verification/consent page.

Jump to

Keyboard shortcuts

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