[Feature] Canopy auth 2/2: SSO (OIDC/OAuth2), break-glass and the auth design doc
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- authentication, backend-api-design, documentation, testing
Hướng nghiên cứu
Start with the referenced Horizon authentication files under apps/bff/src/user/oidc/, roles.ts and break-glass.ts, then read leaf issue #14159 for the required auth and session interfaces. Implementing this issue spans SSO flows, role mapping, break-glass behavior, web login, docs and tests, so first map those entry points and the acceptance oracles. Done means the mock IdP and login tests pass, config keys and examples are documented, and the design doc and README cover the listed requirements.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary (executable leaf 2/2 of #14001)
Canopy's SSO authentication, plus break-glass and the design doc, following Horizon's apps/bff/src/user/oidc/ (discovery.ts, flows.ts, identity.ts, route.ts, userinfo.ts), roles.ts and break-glass.ts. It has three parts:
- Part 1: the
ssobackend with role mapping. - Part 2: break-glass gated by SSO health.
- Part 3:
canopy/docs/auth-design.mdand the remaining README.
It depends on leaf 1/2 (#14159): the auth config, argon2id verifier, session store, middleware and tokens.
Part 1: sso backend
auth.backend: ssowithauth.sso.providers[], in Horizon's provider shape: an OIDC provider (issuer discovery, e.g. Google) and an OAuth2 provider (explicit authorize/token/userinfo endpoints, e.g. GitHub). Authorization-code flow with PKCE andstate/nonce; the client secret comes from env or a file, never the config file in clear.- Routes: start (
GET /auth/sso/:provider/start) and callback (GET /auth/sso/:provider/callback) create a #14159 session for the resolved principal.GET /auth/meta(or the existing meta) lists the configured providers for the web login page. - Role mapping
auth.sso.roles:defaultRoles,roleByEmail(exact, case-insensitive),roleByDomain, mapped to Canopy roles via #14159's role mapping. With no matching role, the login is refused, not given a default admin. - The resolution order in the middleware becomes Horizon's: IdP bearer token, if supported by the provider (see out of scope), → API token (#14159) → cookie session.
- Web: the login page shows a button per provider when
backend: sso. - An SSO health probe (discovery or token endpoint reachable) exposed internally for Part 2.
Part 2: break-glass
auth.breakGlass:{enabled, users[]}with argon2id hashes (#14159's argon2id verifier, with the same dummy-hash timing).- With
auth.backend: sso,POST /auth/loginagainst break-glass users is accepted only while Part 1's SSO health probe reports unhealthy. Otherwise it gets the same 401 as a wrong password. - Every break-glass success logs at WARN with username and client IP. Failures log at INFO without the password.
- The web login page shows the break-glass form only when the server reports SSO unhealthy and break-glass enabled.
Part 3: design doc and README
canopy/docs/auth-design.mdcovering:- the
auth.*/session.*config schema and its parity with Horizon's; - the resolution order (IdP bearer → API token → cookie session);
- role re-resolution and caching (30 s success, never failure);
- username as the credential anchor;
- break-glass gating;
- the argon2id (WASM) choice and bcrypt compatibility;
- in-memory sessions and their restart behavior;
- what is out of scope (LDAP/SAML, multi-IdP).
- the
canopy/README.md: everyCANOPY_AUTH_*/ config key with defaults, plus minimal working examples forlocal,sso(GitHub OAuth2 and a generic OIDC), tokens, and break-glass. Remove obsolete LDAP-centric orCANOPY_USERS-only notes, keeping the alias documented as deprecated.- A link from the main BanyanDB docs where Canopy is described, if such a page exists.
Concrete oracle (against an in-process mock IdP; no live provider)
Part 1
- Mock OIDC issuer: start → redirect with PKCE
code_challenge,state,nonce→ callback with a valid code → session cookie,/auth/sessionshows the mapped role. roleByEmail: {[email protected]: admin},roleByDomain: {x.com: viewer}→ alice is admin and [email protected] readonly. [email protected] with nodefaultRoles→ refused (403 page/JSON).- A wrong
stateor replayed code → 400, no session. An ID token with a wrongnonce,audor issuer → refused. - Mock GitHub-style OAuth2 (userinfo plus emails endpoint) → email resolved, role mapped.
Part 2
- SSO healthy (mock) + correct break-glass password → 401
invalid_credentials. - SSO unhealthy + correct password → session, and exactly one WARN containing the username and IP.
- SSO unhealthy + wrong password → 401, one argon2id verify ran.
backend: local→breakGlassis ignored and the startup log says so.
Acceptance criteria
- Vitest tests with an in-process mock IdP (no network), a controllable SSO health probe and log capture cover every oracle line, through
app.inject. Web login-page tests cover the provider buttons and the break-glass form. - The #14001 acceptance "GitHub OAuth2 end-to-end (consent screen)" is covered by the mock flow, plus a documented manual check with a real GitHub OAuth app; the manual check isn't automated.
- Every config key the code reads appears in the README with its default. A test run by
npm testcompares the schema's keys to the README table, and the README examples parse with the real config loader. - Existing tests pass; links are valid; license artifacts are regenerated if dependencies change.
Out of scope
LDAP/SAML, multi-IdP failover, accepting IdP access tokens as bearers unless Horizon does (follow Horizon; note the choice), health-probe tuning beyond Horizon's defaults.
- Ngôn ngữ chính
- Java
- Star
- 25k
- Fork
- 6.6k
- Merge trung bình
- 12 giờ 41 phút
- Pull request đã merge (30 ngày)
- 48
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/skywalking
-
[Bug] [BanyanDB] MCP HTTP server rejects a lowercase "bearer" Authorization schemeCó thể đã có người làm @UchihaIthachi đã nhận hôm nay. Đang mởbug database
apache/skywalking#14199 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Standalone multi-group Measure aggregation returns one row per groupCó thể đã có người làm @hanahmily đã nhận 1 ngày trước. Đang mởbug database
apache/skywalking#14198 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] [BanyanDB] MCP server ignores .env values and silently accepts malformed numeric/TRANSPORT settingsCó thể đã có người làm @wanjinhao1 đã nhận 2 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
apache/skywalking#14194 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] BanyanDB trace block metadata format changed in 0.11 without a file format version bumpCó thể đã có người làm @hanahmily đã nhận 11 ngày trước. Đang mởbug database
apache/skywalking#14169 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore CLI database
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/skywalking#14168 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/skywalking
Issue tương tự
-
hermes-queue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
chrisalunlloyd2-sudo/mindpalace#337 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Regression][98.0.0] Android I/flutter logs are automatically folded by FlutterConsoleFoldingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
flutter/flutter-intellij#9221 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ucsb-cs156/proj-frontiers#844 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
AllTheMods/ATM10-Aeronautics#159 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Update spring-ldap to 4.0.7Đang mởtype: dependency-upgrade
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
spring-projects/spring-security#20057 ·
Maintainer thường phản hồi trong vòng 1 ngày