auth: rehearsing authentication locally takes ten steps and four refusals — a trust policy cannot hold keys inline, `flow keys public` prints a JWK where a JWKS is needed, and no dev posture stands up a local issuer
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 9
- Forks
- 0
- Avg merge
- 3h 3m
- Merged PRs (30d)
- 509
Description
Observed behavior
What it took at eb8172f to run one workflow as an authenticated caller on this machine, with two tenants, so that tenancy, the signal policy and the audit trail could be seen doing their jobs:
flow keys generate --out idp.pem.flow keys public --in idp.pemprints one JWK; ajwks_urlserves a JWKS ({"keys": [...]}), so the JWK was wrapped by hand.- A web server on loopback to serve the file, because
TrustedIssuerhasjwks_urland nojwks_fileor inlinekeys(pkg/flowstate/v1/auth/policy.go, fieldsname kind issuer client_ca_file subject_from audiences algorithms require role namespace namespace_claim namespace_map jwks_url max_token_age). - A trust policy, refused once for a missing
name(#1693 reports the refusal's wording). - Refused again by the identity egress boundary for
httpon loopback, then again for loopback itself, fixed by anegress:section documented nowhere (#1694). flow server devrefuses ambient authentication by design, so a Temporal had to be started through it and a secondflow server --auth-policy --listen --rpc-resource --identity-claim --temporal-addressbeside it.- Tokens signed with
flow jwt signagainst the exact--rpc-resourceaudience, twice, because the first ones expired at the default five minutes before the server came up. --identity-claim roleon the server, without which the Flowfile'ssignals: claims: {role: customer}rule can never match (#1300).
Once there, everything worked and worked well: alice's runs invisible to bob, a wrong-audience token refused, an anonymous caller refused, a cross-tenant Get denied with an audit record naming the subject, a same-tenant caller without the claim refused at the gate, the entitled caller delivered, and the run completed confirmed: true. The security posture is real. The path to it is the problem, and it is the path every operator walks before their first production deployment and every contributor walks before touching auth/.
Desired outcome
Two small additions and one posture:
- Keys in the file.
TrustedIssuergainsjwks_file(a path) andjwks(an inline key set), mutually exclusive withjwks_url, so a rehearsal and an air-gapped deployment need no fetch and no egress section.flow keys public --jwksprints the wrapped document. - A local issuer posture.
flow server dev --auth(orflow auth dev) generates a key under the dev database's directory, writes a trust policy with the inline key, an issuer of its own naming, andnamespace_claim: namespace, binds--rpc-resourceto its loopback address, and prints theflow jwt signline that mints a token for a subject and namespace.flow server devkeeps refusing ambient auth configuration; this is a posture it assembles itself and states at start-up like the other three. - Longer default rehearsal tokens.
flow jwt signdefaults to a lifetime that survives standing up a server, with the cap unchanged.
Acceptance criteria
flow server dev --authfollowed by the printed sign command andflow run --token-filecompletes a run as a named subject in a named namespace, with no web server, no hand-written policy, and no egress section.- A trust policy with
jwks:inline verifies a token with no network, pinned by a test that runs the verifier with a nil egress client. docs/DEPLOYMENT.md's recipe starts from the dev posture and shows the diff to a real issuer.
Constraints and dependencies
- Inline keys are for rehearsal and air-gapped deployments; rotation for a
jwksentry is a file change and a restart, which the doc says plainly beside #1019's rotation story. - Adjacent: #1693, #1694, #1300, #110 (
flow loginand profiles), #557 (human identity), #1649 (flow doctor).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pkg/flowstate/v1/auth/policy.go and the flow keys, flow server dev, and flow jwt sign entry points. Review the acceptance criteria and docs/DEPLOYMENT.md, including the nil-egress verifier test requirement. Done means local authenticated runs work without a web server or egress policy, inline JWKS verifies offline, and the deployment recipe explains the dev-to-real-issuer transition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- authentication, cli, documentation, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100