Repository navigation
fix: Accept minted tokens when FDS runs from a checkout - #234
Draft
NathanCummings wants to merge 2 commits into
Draft
NathanCummings wants to merge 2 commits into
NathanCummings wants to merge 2 commits into
Conversation
The README's steps for running FDS from a checkout set only the database password, so FDS trusted no issuer and refused every minted token with a 401, and the alembic step before it failed for want of that password. .env.example now trusts the key pair from mint-token.py and carries the development database's password, and the README has you copy it to .env, which FDS and alembic both read. The seed script now exits with the response body FDS sends on an error, which names the issuer, key or claim behind a 401, instead of a traceback without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… database .env.example configured an S3 store at localhost:9000 whose credentials came from minio:9000, a container hostname, though the development stack runs no object store. It now configures none, keeping the S3 entry as an example beside the GCS and Azure ones. README and CONTRIBUTING pointed the tests at the stack's fds database. The tests create records the example catalogue already holds, so once it is seeded over 200 of them fail or error. They now use fds_test, created once on the same server, as CI does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Following the README's steps for running FDS from a checkout (
docker compose up -d postgres,uv run alembic upgrade head,uvicorn ... --reload) and then seeding with a minted token fails with:Those steps set only
FDS_DB_PASSWORD.FDS_TRUSTED_IDPSdefaults to empty, so FDS trusts no issuer and the response body saysUntrusted Issuer: urn:fds:local. With the issuer set but notFDS_OIDC_AUDIENCE, it becomesAudience doesn't match. Thealembic upgrade headstep before it also fails, withfe_sendauth: no password supplied, because the password is only given to uvicorn. The compose stack is not affected: it sets both, and seeding a fresh stack frommainworks.Changes
.env.exampletrusts the key pair fromscripts/mint-token.pyalongside the development Keycloak realm, ascompose.yamldoes, and sets the development database's password. Its header no longer mentions SQLite ordemo/docker-compose.yaml, neither of which exists any more.README: to run from a checkout, copy
.env.exampleto.env, which FDS and alembic both read. It also says that without those settings every token is refused with a 401.README and
docs/operations.md: both said.env.examplelists each setting with its default. It hasn't for a while (the audience and issuer list differ from the defaults), so they now say what it holds.scripts/seed-example-catalogue.py: an HTTP error now exits with the method, URL, status and FDS's response body instead of a traceback. For the case above that readsPOST http://localhost:8000/v1/devices/ returned 401: {"detail":"Untrusted Issuer: urn:fds:local"}..env.examplealso configured an S3 store atlocalhost:9000whose credentials came fromminio:9000, a container hostname, though the development stack runs no object store. It now configures none, ascompose.yamldoesn't, and keeps the S3 entry as an example beside the GCS and Azure ones.README and CONTRIBUTING pointed the tests at the stack's
fdsdatabase. The tests create records the example catalogue already holds (devicemast, for one), so once the stack is seeded, 90 fail and 131 error. They now usefds_test, created once on the same server, as CI does..env.examplenow holds working development values rather than defaults. That matches what its header already said it was for, and the README is the only place that tells you to copy it.Checked
cp .env.example .env, alembic, uvicorn, seed): migrations apply and the seed completes..env: the seed script exits 1 with the message above.uv run --all-extras pytestwith that.envin the checkout: 880 passed.fdsdatabase: 659 passed, 90 failed, 131 errors. Againstfds_test, created with the documented command on the same server: 880 passed.prekhooks andzensical build --strictpass.🤖 Generated with Claude Code