Repository navigation
feat(portal): sign-in straight to the IdP; dev store over TLS (#2242) - #2250
Merged
Merged
Conversation
Changes `portal.login_redirect`, `portal.allow_api_key_login`, the `verify` lane order, the dev stack's TLS object store, and 14 acceptance files. 1. #2242: `portal.login_redirect` sends the portal's sign-in page straight to the identity provider when OIDC browser sign-in is on (ignored with a `login_redirect_ignored` config warning otherwise); `portal.allow_api_key_login` hides the API key form. Both are reported on the public branding route and read by `LoginForm`; `?login=api_key` still shows the key form, and a failed sign-in shows "Try again" instead of redirecting again. 2. #2243: `make verify` starts the UI lane after the static lane (`verify-static-ui`), beside the Go and Docker lanes. 3. #2245: the dev stack's TLS store for managed resources is SeaweedFS 4.48, pinned by digest (3.88 drops HTTP/2 over TLS). `dev/start.sh` registers a relocated stack's portal address with Keycloak. 4. #2232: `MCP_PLATFORM_CONNECTION_ALERT_INTERVAL` and `MCP_PLATFORM_SCRIPT_SCHEDULER_INTERVAL` set the connection alert and script scheduler intervals; the dev stack shortens them, the webhook write timeout and the compactor poll, and raises the tool-call rate limit. Fixed sleeps removed from the #1575, #1694, #1738 and #1870 criteria. 5. #2201's criteria updated to the retention rules #2203 introduced. 6. vitest 4.1.12 for the @vitest/mocker advisories. Closes #2242 Closes #2243 Closes #2245 Refs #2232 Refs #2233
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2250 +/- ##
==========================================
- Coverage 94.84% 94.84% -0.01%
==========================================
Files 1381 1381
Lines 111991 112010 +19
==========================================
+ Hits 106220 106233 +13
- Misses 5754 5760 +6
Partials 17 17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two portal settings,
portal.login_redirectandportal.allow_api_key_login. Also changes themake verifylane order, moves the dev stack's TLS object store to SeaweedFS 4.48, and adds two interval environment variables,MCP_PLATFORM_CONNECTION_ALERT_INTERVALandMCP_PLATFORM_SCRIPT_SCHEDULER_INTERVAL. It also updates 14 acceptance files. The fixes cover 3 bugs:Closes #2242
Closes #2243
Closes #2245
Refs #2232
Refs #2233
Sign-in straight to the identity provider (#2242)
Two new
portal:settings:login_redirectfalseallow_api_key_logintruefalsehides the API key form on the sign-in page.login_redirectneeds bothauth.oidc.enabledandauth.browser_session.enabled. Without them it is ignored, and startup logs thelogin_redirect_ignoredconfiguration warning, counted inconfig_validation_warnings_total{code}. The rule lives ininternal/platform/portalcfg(LoginRedirect,APIKeyLoginAllowed).login_redirectandallow_api_key_login, already resolved (pkg/admin/system.go). A deployment without OIDC never reportslogin_redirect: true.LoginFormbehavior:login_redirecton, it shows a loading indicator and replaces the page with the identity provider's sign-in.?login=api_keystill shows the key form, so an administrator can always use a key.ImplementorConfigandPortalRateLimitConfigare now type aliases overportalcfg.Implementorandportalcfg.RateLimit, so existing references compile unchanged. They moved becausepkg/platformwas at its package size budget.docs/server/configuration.md("Sending sign-in straight to the identity provider"),README.md,docs/llms.txtanddocs/llms-full.txt.Readers of this state
The two new branding fields are read by:
ui/src/api/portal/hooks/assets.ts: theBrandingtype.ui/src/components/LoginForm.tsx: the redirect and the key form.ui/src/mocks/handlers.ts: the MSW branding response.No other reader of the branding route uses these fields.
verify's UI lane runs after the static lane (#2243)
make verifynow runsverify-static-ui, which runsverify-staticand thenverify-ui, besideverify-goandverify-docker. Running the UI lane alongside every other lane pushed the load past vitest's 5-second per-test timeout.TestVerifyStartsTheUILaneAfterTheStaticLane(test/gates/verify_order_test.go) pins the order.Dev stack: SeaweedFS over TLS for managed resources (#2245)
dev/docker-compose.ymlreplaces the store service for managed resources withseaweedfs-resources. It runschrislusf/seaweedfs:4.48, pinned by digest, and serves S3 over TLS on 8443 (DEV_S3_TLS_PORT, default 9443). 3.88 is not used because it drops HTTP/2 requests over TLS, and the platform's S3 client sends HTTP/2.dev/start.shwrites the certificate todev/.tls/seaweedfswith the SANseaweedfs-resources, waits for the store, and creates the buckets. Trino trusts the certificate through the keystore import, andscratch_resources.propertiespoints athttps://seaweedfs-resources:8443.DEV_OFFSETother than 0),dev/start.shadds the portal's moved address to the Keycloak portal client's redirect URIs, web origins and post-logout redirect URIs through the Keycloak admin API.Fewer real-clock waits in the acceptance suite (#2232)
New environment variables:
MCP_PLATFORM_CONNECTION_ALERT_INTERVALinternal/httpserver/alertwire)2sMCP_PLATFORM_SCRIPT_SCHEDULER_INTERVALinternal/platform/scriptexec)2sBoth keep their previous defaults when unset, and both are documented in
docs/server/notifications.mdanddocs/scripts/running.md.dev/platform.yamlalso sets:write_timeoutto3s;pollto2s;rate_limitof 12,000 requests per minute with a burst of 2,000.The dev stack keeps the storage scan at 30s, because a faster scan races the criteria that seed storage usage.
Acceptance criteria changes:
waitForLoopPasshelper.Not met: #2232's done condition asks for a measured serial run of the whole suite, which this PR does not include. Two criteria still take longer than 30s, for these reasons:
#2233 (running the criteria in parallel) is not done here. Lanes on one dev stack measured 47-51 minutes with failures caused by the load. The E2E Nightly already splits the suite into eight groups across machines.
Other changes
test/acceptance/issue_2201_test.go: the expectations follow Storage forecast on a fresh install: a first-boot burst becomes a fill date and can raise exhaustion alerts; both replicas sample every tick #2203's rules (48 and 360 hours; the store with no growth spans 16 days). The seed re-inserts usage and reads it back untilused_bytesmatches.ui/package.json: vitest^4.1.12, which fixes the osv advisories against@vitest/mocker4.1.11.test/structure/testdata/allowed_internal_imports.txt: adds the edgepkg/admin -> internal/platform/portalcfg.Acceptance
test/acceptance/issue_2242_test.gohas seven criteria. They run against the dev stack with Keycloak, start replicas withDEV_PORTAL_LOGIN_REDIRECTandDEV_PORTAL_ALLOW_API_KEY_LOGIN, and drive the browser throughui/e2e/login-redirect. Covered:?login=api_key;Transcript:
build/2242/acceptance.md.make acceptance-checkpasses for #1546, #1575, #1631, #1694, #1738, #1862, #1870, #1899, #2068, #2121, #2201 and #2242. The recorded #2242 run predates moving the rule intoportalcfg;portalcfg_test.goandpkg/admin/system_test.gocover the same behavior.make verifypasses.