Fixes from the Leantime rehearsal: unhealthy apps, signin links and errors
Deploy now waits while an image's own HEALTHCHECK says "starting" and stops on "unhealthy" with the check and its result, since traefik doesn't route unhealthy containers (it used to say "Updated"); an update rolls back, a first install says it stays installed, and a rollback waits until the old version is routed again. coreapp signin follows a page's one "Core SSO" or "Authelia" link, prints the app's visible error when it doesn't end signed in, and has --help. The skill covers 127.0.0.1 among trusted proxies, the image's HEALTHCHECK, COPY --chmod, $TMPDIR outside the sandbox, patching an app's OIDC code for userinfo claims, and testing a new account's first sign-in. PLAN: ID-token claims for Federated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,14 @@ standard-library Python example of the whole flow (`oidc.py`).
|
||||
(the account's uid, e.g. `coreapp.test`), `preferred_username` (the
|
||||
email address, which is what people sign in with), `groups`. The ID token
|
||||
has none of them, so an app that reads the person only from the ID token
|
||||
gets no email or name: turn on its "use userinfo" setting.
|
||||
gets no email or name: turn on its "use userinfo" setting. Requesting
|
||||
fewer scopes doesn't help (without `openid`, userinfo answers 403). If
|
||||
the app has no such setting, a small patch to its OIDC code that fills
|
||||
missing claims from userinfo (when its `sub` matches the ID token's) is
|
||||
fine: keep it as a patch file applied in the Dockerfile, say why in a
|
||||
comment, and name it in your report, since it's the app's own code. (The
|
||||
Core could put these claims in the ID token; that's Federated's to
|
||||
change.)
|
||||
- `groups` is `null` on today's Cores, not a list: they have two groups,
|
||||
`admins` and `everybody`, but Authelia's settings don't find them yet
|
||||
(for Federated to fix). Don't turn on an app's group-to-role mapping:
|
||||
@@ -119,6 +126,7 @@ says whether it got back to the app signed in. Run it in the app's folder
|
||||
coreapp signin # starts at /login
|
||||
coreapp signin /auth/login # the app's own page that starts sign-in
|
||||
coreapp signin /signin # a page whose button starts sign-in: pressed
|
||||
coreapp signin /auth/login # or whose "Sign in with Core SSO" link starts it: followed
|
||||
jar=$(mktemp) && coreapp signin --cookies "$jar" /login && curl -b "$jar" https://<name>.<domain>/api/me
|
||||
```
|
||||
|
||||
@@ -126,14 +134,21 @@ jar=$(mktemp) && coreapp signin --cookies "$jar" /login && curl -b "$jar" https:
|
||||
CSRF token) is submitted as a person pressing it would. Forms with fields
|
||||
to fill (a password form beside the button) are ignored, so a page with
|
||||
one button and a password form needs nothing more; only with several
|
||||
buttons, pick one with `--form <action>`. Don't add routes to the app just
|
||||
for the test.
|
||||
buttons, pick one with `--form <action>`. Without such a form, its one
|
||||
link whose text names Core SSO or Authelia is followed. Don't add routes
|
||||
to the app just for the test.
|
||||
- With `--cookies`, check what the test account may do: it should land as
|
||||
a read-only member. Keep the jar's path in one command, as above
|
||||
(`$TMPDIR` can differ between a sandboxed shell and `coreapp`'s).
|
||||
- "Signed in" needs the app to have kept the person: if its page offers
|
||||
sign-in again (its callback failed quietly), `coreapp signin` says "Not
|
||||
signed in ... offers sign-in again"; `coreapp logs` has the app's reason.
|
||||
signed in ... offers sign-in again", with the error or notice the app's
|
||||
page shows; `coreapp logs` may have more.
|
||||
- Test a brand-new account's first sign-in too, not only the second: apps
|
||||
often do extra work for a new person (a sample project, onboarding) that
|
||||
a read-only role isn't allowed. The test account stays in the app after
|
||||
its first sign-in, so to repeat it, delete its user in the app (as the
|
||||
app's admin, or in its database with `coreapp shell`) and sign in again.
|
||||
- Apps whose sign-in starts in the browser's JavaScript (single-page apps:
|
||||
the page builds the authorize URL itself): `coreapp signin --code` starts
|
||||
at Authelia with the app's client and stops at the app's callback,
|
||||
|
||||
Reference in New Issue
Block a user