WeKnora/internal/middleware
sunmh 95ddeae067 feat(auth): add /auth/oidc/start endpoint for direct 302 OIDC login
New endpoint GET /api/v1/auth/oidc/start — unlike /auth/oidc/url which
returns JSON and requires frontend JS to navigate, this endpoint directly
returns a 302 redirect to the OIDC Provider's authorization page. This
enables external platforms (enterprise portals, Nexus, etc.) to give a
single clickable link that triggers the full OIDC authorization code
flow and, when the IdP has an active SSO session, achieves passwordless
login without any frontend involvement.

- backend derives the callback URL from the request origin automatically
  (no caller-supplied redirect_uri needed)
- OIDC nonce cookie is bound identically to /auth/oidc/url (CSRF/replay
  protection)
- registered in the auth middleware public-path whitelist (otherwise
  the global auth middleware returns 401 before routing reaches the
  handler)
- refactored shared nonce-cookie helper out of GetOIDCAuthorizationURL
  for reuse by OIDCStart
2026-08-11 15:41:48 +08:00
..
asynqdl fix: mark knowledge delete failures after retry exhaustion 2026-06-16 16:47:46 +08:00
access.go feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
access_test.go refactor(tenant_member): simplify tenant ID resolution in handlers 2026-05-18 17:28:58 +08:00
api_key_gate.go feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
api_key_gate_test.go feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
audit_provider.go feat(rbac): per-tenant audit log for RBAC events (PR 6, #1303) 2026-05-18 17:28:58 +08:00
auth.go feat(auth): add /auth/oidc/start endpoint for direct 302 OIDC login 2026-08-11 15:41:48 +08:00
auth_api_principal_test.go fix: harden API principal config after review 2026-06-30 20:01:05 +08:00
auth_context.go refactor(auth): unify session-context attachment and split the Auth middleware 2026-07-27 11:25:23 +08:00
auth_context_test.go refactor(auth): unify session-context attachment and split the Auth middleware 2026-07-27 11:25:23 +08:00
auth_platform_api_key_test.go feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
auth_public_ratelimit.go feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
auth_role_test.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
auth_tenantless_test.go refactor(auth): unify OIDC provisioning under shared default_tenant_mode policy 2026-07-13 19:14:49 +08:00
embed_auth.go refactor(auth): unify session-context attachment and split the Auth middleware 2026-07-27 11:25:23 +08:00
embed_auth_test.go refactor: remove Neo4j-based conversation memory feature 2026-07-18 23:41:48 +08:00
error_handler.go init commit 2025-08-05 15:08:07 +08:00
kb_access.go fix: harden shared agent source selector validation 2026-07-30 12:28:23 +08:00
kb_access_test.go fix: harden shared agent source selector validation 2026-07-30 12:28:23 +08:00
language.go fix(i18n): use WEKNORA_LANGUAGE env for prompt language fallback instead of hardcoded zh-CN 2026-04-02 12:01:25 +08:00
logger.go fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
logger_test.go fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
rbac.go feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
rbac_api_key_shortcircuit_test.go feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
rbac_audit_test.go feat(rbac): per-tenant audit log for RBAC events (PR 6, #1303) 2026-05-18 17:28:58 +08:00
rbac_test.go feat(models): let system admins edit builtin model config 2026-07-14 15:56:02 +08:00
recovery.go fix: replace standard log with structured logger in main and recovery middleware 2026-02-06 17:59:15 +08:00