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

federation

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package federation is the optional identity provider surface for other systems (OIDC/OAuth 2.0, SCIM, discovery). See schema.go.

Package federation is the optional identity provider surface this application exposes to other systems (OIDC/OAuth 2.0, SCIM, discovery). It has no mandatory core: it is exactly the features the composition root selects. Remove its registration line to build a pure internal-identity binary.

Index

Constants

View Source
const ModuleName = "federation"

ModuleName identifies the federation module in the registry.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIFeature

type APIFeature interface {
	Feature
	APIRoutes(r chi.Router, g RouteGroups)
}

APIFeature mounts endpoints inside the shared /api group. A feature that serves ConnectRPC exclusively implements RPCServiceProvider instead — the two are mutually exclusive.

type Feature

type Feature interface {
	Name() string
}

Feature is one mounted unit chosen at the composition root. A feature left out of New does not exist: no routes, no storage, no lifecycle.

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module is the federation surface: the explicitly wired provider features, mounted in construction order. There is no feature discovery or late registration.

func New

New wires the federation surface. The signing-key service is mandatory; a nil one is a wiring bug.

func (*Module) APIRoutes

func (m *Module) APIRoutes(r chi.Router, g RouteGroups)

APIRoutes mounts the provider feature endpoints inside the shared /api group. The SCIM surface serves ConnectRPC exclusively.

func (*Module) ClientRPCService added in v0.0.12

func (m *Module) ClientRPCService() (string, http.Handler)

ClientRPCService returns the OIDC client administration Connect registration (admin-only surface).

func (*Module) ConsentRPCService added in v0.0.12

func (m *Module) ConsentRPCService() (string, http.Handler)

ConsentRPCService returns the consent Connect registration (mixed self/admin visibility).

func (*Module) Name

func (m *Module) Name() string

func (*Module) Routes

func (m *Module) Routes(r chi.Router)

Routes mounts the root-router routes (OIDC /authorize, discovery) outside /api.

func (*Module) ScimRPCService added in v0.0.12

func (m *Module) ScimRPCService() (string, http.Handler)

ScimRPCService returns the SCIM provider Connect registration (admin-only surface).

func (*Module) Start

func (m *Module) Start(ctx context.Context) error

Start guarantees the signing key exists before token issuance.

func (*Module) Stop

func (m *Module) Stop(ctx context.Context) error

Stop stops the federation features in reverse construction order.

type ProviderFeature

type ProviderFeature interface {
	APIFeature
	RootRoutableFeature
}

ProviderFeature is the OIDC surface: protocol routes on the root router plus client/token management inside /api.

type RPCServiceProvider added in v0.0.12

type RPCServiceProvider interface {
	Feature
	RPCService() (string, http.Handler)
}

RPCServiceProvider exposes a Connect registration instead of REST routes; the composition root mounts it under /rpc.

type RootRoutableFeature

type RootRoutableFeature interface {
	Feature
	Routes(r chi.Router)
}

RootRoutableFeature mounts routes on the root router, outside /api — e.g. the OIDC /authorize endpoint.

type RouteGroups

type RouteGroups struct {
	Admin kernel.Guard // session auth + admin requirement
	Self  kernel.Guard // session auth (cookie)
}

RouteGroups carries the authentication middleware chains a feature applies at mount time; the composition root builds each chain once. A nil group leaves its guarded routes unmounted (fail closed).

type StartableFeature

type StartableFeature interface {
	Feature
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

StartableFeature holds resources with a lifecycle: started in selection order, stopped in reverse.

Directories

Path Synopsis
Package discovery serves RFC 8615 endpoints: /.well-known/openid-configuration and /.well-known/jwks.json.
Package discovery serves RFC 8615 endpoints: /.well-known/openid-configuration and /.well-known/jwks.json.
Package jwks owns signing key material: generation, encrypted storage, rotation with overlap, and the JWKS key provider consumed by token issuance and the discovery endpoints.
Package jwks owns signing key material: generation, encrypted storage, rotation with overlap, and the JWKS key provider consumed by token issuance and the discovery endpoints.
Package oidc is the OpenID Connect / OAuth 2.0 provider surface: /authorize + PAR (root router), /api/oidc/token, userinfo, introspect, revoke, end_session.
Package oidc is the OpenID Connect / OAuth 2.0 provider surface: /authorize + PAR (root router), /api/oidc/token, userinfo, introspect, revoke, end_session.
Package scimsync provisions users and groups to a remote SCIM server.
Package scimsync provisions users and groups to a remote SCIM server.

Jump to

Keyboard shortcuts

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