chore(examples): bring every example up to server 2.4.0-rc.18 - #15
Open
lakhansamani wants to merge 11 commits into
Open
chore(examples): bring every example up to server 2.4.0-rc.18#15lakhansamani wants to merge 11 commits into
lakhansamani wants to merge 11 commits into
Conversation
- Go examples: import path -> authorizer-go/v2, pin v2.2.0-rc.4; drop local `replace` directives now that the tag ships the client_credentials/client_assertion APIs (pulls authorizer-proto-go). - Python examples: bump authorizer-py to 0.3.0rc3 (pulls authorizer-proto). - with-rag-fga: PaginatedRequest was removed in 0.3.0rc3; use ListUsersRequest. - with-agents-python: switch editable-local install to released authorizer-py. - Refresh stale README/Dockerfile notes about the removed replaces.
Bump every example depending on authorizer-js or authorizer-react to the released RCs, matching each file's existing caret pin style. - authorizer-js ^3.2.1 -> ^3.3.0-rc.4: with-nextjs, with-nextjs-13, with-react-native-expo, with-express-js (direct); with-vanilla-js and with-vanilla-js-custom-ui via the unpkg UMD CDN URL. - authorizer-react ^2.0.7 -> ^2.2.0-rc.3: with-nextjs, with-nextjs-13, with-react, with-gatsbyjs. Transitive authorizer-js dedupes up to 3.3.0-rc.4 in each lockfile. - No code changes needed: no example calls the flattened admin pagination API, sets is_multi_factor_auth_enabled on signup, or composes AuthorizerVerifyOtp directly, so none of the RC breaking changes apply.
# Conflicts: # with-agents-python/README.md # with-agents-python/demo.py # with-express-js/package-lock.json # with-express-js/package.json # with-gatsbyjs/package.json # with-go/go.mod # with-go/go.sum # with-nextjs-13/package-lock.json # with-nextjs-13/package.json # with-nextjs/package-lock.json # with-nextjs/package.json # with-python/README.md # with-react-native-expo/package-lock.json # with-react-native-expo/package.json # with-react/package-lock.json # with-react/package.json # with-vanilla-js-custom-ui/index.html # with-vanilla-js-custom-ui/login.html # with-vanilla-js/index.html
rc.18 DeleteUserRequest dropped `email` for `id` (a phone-only signup has no email). The three raw-GraphQL callers now resolve the id via _user first.
The vendored gen/ stubs predated the DeleteUserRequest email->id change, so they no longer matched rc.18. Depend on authorizer-proto-go v0.2.0-rc.1 -- the same module the Go SDK uses -- and drop ~10k lines of vendored code. Both Go examples hit the 2.4.0 MFA offer and neither settled it: authorizer-go keeps no cookie jar and gRPC has no cookies at all, so skip_mfa_setup could not find its session. Each now relays the mfa_session by hand (net/http response cookies; set-cookie response metadata over gRPC).
0.3.0rc4 has the typed skip_mfa_setup and the flattened admin pagination, so with-python drops both 0.2.0 escape hatches and uses AuthorizerAdminClient .users() directly. with-agents-python and with-rag-fga never settled the 2.4.0 MFA offer, so neither could get a token against a default server: httpx keeps the mfa_session cookie in its jar but will not replay a Secure cookie over plain http (--app-cookie-secure defaults to true). Both now pass it by hand, as with-python already did.
authorizer-js ^4.0.0-rc.0 (deleteUser takes id, matching the server's DeleteUserRequest), authorizer-react ^2.2.0-rc.7 (which requires that js major, and moves @storybook/preset-scss out of runtime deps), authorizer-vue 1.0.0-beta.2. Locks regenerated -- each resolves a single deduped copy.
…not allow Section 8 asserted the pre-2.4.0 behaviour: no agent type in the model and the agent inherits the user's full authority. rc.18 fails closed instead -- the agent half of perms(agent) n perms(user) cannot be evaluated, so the check is denied, and --fga-allow-unconstrained-agents is the opt-out for deployments still migrating. Also make SERVER_DIR overridable in run-server.sh and mcp-agent.mjs, so the demos can be pointed at a specific server checkout.
rc.18 enforces RFC 6238 5.2 -- a code the server already accepted is rejected on a second attempt. Enrollment and the login challenge run seconds apart, inside one 30s step, so the recipe was replaying the same code and failing with 'invalid otp'. Also make SERVER_DIR overridable in run-server.sh.
The authorizer image runs as uid 1000. A named volume mounted at /data is created root-owned, so the process could not create the SQLite file and every one of these stacks died at boot with 'unable to open database file'. Put the db under /authorizer, which the image chowns to that uid. with-microservices: the gateway forwarded X-User-Email from req.auth.email, but an access token carries no email claim -- profile claims are in the ID token and at /userinfo -- so it was always empty. Forward the sub only and say why.
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.
Summary
Rebase onto
main(which had since landed the Go/v2migration and the JS/React bumps) and take every example to the SDK releases that match server 2.4.0-rc.18. Verifying each example against a real rc.18 server turned up six things that were actually broken; those fixes are the bulk of the diff.Versions
authorizer-goreplace)authorizer-proto-gogen/stubs inwith-grpcauthorizer-pyauthorizer-jsauthorizer-reactauthorizer-vueEvery lockfile regenerated; each resolves a single deduped
authorizer-js.authorizer-sveltestays at 0.1.8 (latest published).Fixes found by running each example against rc.18
_delete_usertakes anid, not anemail. The three raw-GraphQL callers (with-agent-delegation,with-agent-permissions,with-fga-advanced) now resolve the id via_userfirst. Same change is whyauthorizer-jsgoes to a new major.skip_mfa_setupis identified by themfa_sessioncookie, which the server marksSecure(--app-cookie-securedefaults to true) — httpx/browsers keep it but will not replay it over plain http, andauthorizer-gokeeps no cookie jar at all.with-go,with-grpc,with-agents-pythonandwith-rag-fganow relay it by hand, aswith-pythonalready did. (gRPC has no cookies: the server serialises them asset-cookieresponse metadata, which the example reads back and replays ascookierequest metadata.)with-grpc's vendored stubs predated the proto change —DeleteUserRequest.GetEmail()no longer exists in rc.18. Replaced by a dependency onauthorizer-proto-go, the same module the Go SDK uses; drops ~16k lines of generated code.with-agent-permissionssection 8 asserted the pre-2.4.0 behaviour. A model with notype agentnow denies a delegated check rather than granting the user's full authority;--fga-allow-unconstrained-agentsis the migration opt-out. Demo and README corrected.with-auth-recipes/2-totp-mfareplayed the enrollment code at the login challenge and failed withinvalid otp; it now waits for the next time step./datais created root-owned, sounable to open database file.with-microservices,with-org-saml,with-org-sso-oidcandwith-spiffekeep the SQLite file under/authorizerinstead.with-microservicesforwarded anX-User-Emailthat was always empty — access tokens carry noemailclaim (it is in the ID token and at/userinfo). Forwards thesubonly, and says why.with-pythondrops both 0.2.0 escape hatches: typedskip_mfa_setupandAuthorizerAdminClient.users()both work on 0.3.0rc4.run-server.sh/mcp-agent.mjstake aSERVER_DIRoverride so the demos can be pointed at a specific server checkout.Testing
Against a server built from tag
2.4.0-rc.18(make devconfig, RS256), end to end unless noted:with-go,with-grpc,with-python,with-rag-fga(seed + all three personas, both strategies),with-agents-python(sync + async),with-m2m-client-credentials,with-token-exchange-delegation,with-fga-permissions,with-fga-advanced(setup + walkthrough + list-permissions),with-agent-delegation,with-agent-permissions(demo +mcp-agent --verify),with-mcp,with-a2a-agent-card,with-scim(all three scripts),with-microservices(docker, rc.18 image),with-microservices-go(5/5),with-openid-connect(full browser round trip + RP-initiated logout),with-auth-recipes1/2/4.with-react,with-nextjs,with-nextjs-13,with-vue,with-svelte-kit,with-svelte-routing,with-react-native-expo(tsc --noEmit);authorizer-js4.0.0-rc.0 UMD exercised in a browser against rc.18 forwith-vanilla-js;validateJWTTokenexercised forwith-express-js.with-auth-recipes/3-webhooks— admin ops and signup pass, the delivery leg needs the documentedsudo ifconfig lo0 aliasloopback alias.with-claude-agents— setup, delegation,audrejection and the FGA prod denial all pass; the happy path needsANTHROPIC_API_KEY.with-agent-permissions/gemini-agent.mjsneeds a Gemini key.with-spiffe,with-org-saml,with-org-sso-oidchard-require a public https tunnel; their compose stacks boot clean on rc.18 and their admin mutations were checked field-by-field against the rc.18 schema.with-k8s-tokenreviewneeds a cluster (app builds and vets).with-gatsbyjs— lockfile resolution verified;gatsby buildcannot run here becauselmdb-storehas no darwin/arm64 prebuild for Node 22.Follow-ups for other repos (not fixable here)
authorizer-gobuilds a freshhttp.Clientper call with no cookie jar, so the cookie-identified flows (skip_mfa_setup,verify_otp) cannot work through the SDK. Every Go example has to hand-roll the relay.mfa_sessionSecureeven when serving plain http, so a conforming client drops it. Any non-browser SDK on a local http dev server hits this.authorizer-vue(1.0.0-beta.2) andauthorizer-svelte(0.1.8) still depend onauthorizer-js ^1.2.x— two majors behind the server they talk to, and predating the MFA-offer flow entirely. Both are already at their latest published version, sowith-vue,with-svelte-kitandwith-svelte-routingcan only be verified as far as "builds" until those SDKs are released againstauthorizer-js4.x.authorizer-vuemain already carries the v3 migration but is unpublished.Please squash-merge
with-grpc/with-grpc— a 17MB binary mygo builddropped in the working tree — was committed by accident and removed two commits later, so the blob is reachable from this branch's history. Squashing keeps it out ofmain's object store; happy to rewrite the branch instead if you'd rather merge-commit.Please review — not self-merging.