Help us shape the future of Go! Take the 2026 Go Developer Survey

contract

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package contract registers the password plugin's forge-dashboard contract surface: three intents (password.settings, password.policy, password.settingsUpdate) backed by the settings.Manager, plus a standalone /auth/password page that extends the auth contributor's /settings page with a password-policy panel.

Wiring lives in plugins/password/dashboard.go's RegisterContract method (added when the plugin opts into the contract surface via the authsome plugin.ContractContributor interface). The bootstrap loop in authsome/extension/extension.go's RegisterContractContributor invokes RegisterContract on every plugin that implements the interface after the auth contributor itself registers.

handlers.go: read-only policy projection for the password plugin's contract surface.

Reads and writes of the underlying password.* settings now flow through the auth contributor's settings.namespace / settings.update intents — the settings.panel renderer auto-discovers them because password.DeclareSettings registers the keys under the "password" namespace at plugin init time. This file only houses password.policy, a small "live policy" projection (algo + min length + special-char requirement) that other surfaces (security overview widget) can bind to with a single query instead of three settings.* reads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(
	d *dispatcher.Dispatcher,
	reg contract.Registry,
	wreg contract.WardenRegistry,
	deps Deps,
) error

Register loads the embedded manifest, registers it against the dashboard's contract registry (applying any `extends` blocks against previously-registered contributors — `auth` must register first), and binds the three intent handlers against the dispatcher.

Types

type Deps

type Deps struct {
	Engine *authsome.Engine
}

Deps is the typed dependency bundle the password contract handlers need at registration time. Engine is required — it gives access to the settings.Manager. AppID is the app whose policy is being read / edited; defaults to the engine's platform app when zero.

type PasswordPolicy

type PasswordPolicy struct {
	MinLength      int    `json:"minLength"`
	RequireSpecial bool   `json:"requireSpecial"`
	HashAlgorithm  string `json:"hashAlgorithm"`
}

PasswordPolicy is the live policy projection. Hash algorithm is engine-level (not per-app); the two settings cascade through the usual settings.Manager resolution.

Jump to

Keyboard shortcuts

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