oidc

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package oidc runs an in-process yauth-backed OIDC provider for local dev. It is seeded from oidc config and binds on its own port; no Postgres is required — the backend is the yauth "memory" driver.

yauth v0.39+ is API-first: its /oauth/authorize endpoint speaks JSON, not HTML. To keep a browser OIDC flow working (so SPAs and Playwright can drive a real login), this package mounts the yauth API under /api/auth and serves two small server-rendered pages at the root:

  • GET /login — email/password form (#email/#password/#submit) that POSTs to yauth's JSON login, then returns to the flow.
  • GET /authorize — the consent page the discovery doc's authorization_endpoint points at (via mcpauth.Mount). It drives yauth's JSON authorize+consent and redirects the browser back to the client with the code, auto-approving consent for this local dev provider.

This restores the server-rendered login that the pre-Go (Rust) devrig served from src/oidc/ui.rs, which downstream apps' E2E tests rely on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an in-process OIDC provider.

func New

func New(cfg *config.OIDCConfig, port uint16, logger *slog.Logger) *Server

New creates an OIDC server from the given config and resolved port.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start builds the yauth instance, seeds users and clients, then listens. It blocks until ctx is cancelled.

Jump to

Keyboard shortcuts

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