Repository navigation
Add API keys and an in-app API reference - #1412
Merged
Merged
Conversation
API keys
- Sanctum personal access tokens owned by a user and scoped to one
account. A key acts as that member (role, grants, permission
overrides) and never more. Read-only keys carry only the `read`
ability and get 403 API_KEY_READ_ONLY on writes.
- Signed-in routes are split into `auth:api,sanctum` (keys allowed) and
a session-only `auth:api` group: auth, profile and sign-in security,
team, account settings, payouts and key management, which return 403
API_KEY_NOT_ALLOWED to keys. ApiKeyRouteExposureTest snapshots it.
- JWT claim reads go through AuthUserService so they work under both
guards; the access cache keys key requests as api-key:{id}.
- Keys work only while the owner is an ACTIVE member. Deactivation,
password resets and SSO changes revoke them (scoped to the affected
account), and account deletion removes them. The account's 2FA
requirement and pending deletion still apply.
- Creating a key needs a verified email and identity confirmation
(password or SSO re-auth), is refused while impersonating, and is
capped at 25 active keys. Only the hash and last four characters
are stored. Keys can't add Google Tag Manager containers, and
last_used_at is written at most every five minutes.
- Emails when a key is created, when an admin revokes it, and a week
before it expires. Expired keys are pruned after 30 days.
- Settings > API keys: create with access level and expiry, copy once
with a copy-failure fallback, admins see and revoke everyone's keys,
expired keys grouped. Works from phone to desktop.
In-app API reference
- Settings > API keys > API reference renders a committed, generated
resources/api-reference/openapi.json with Scalar, branded to match
the app, with its AI agent, MCP and telemetry switched off.
- `php artisan api-reference:export` regenerates it; a Feature test
fails when it drifts, so API changes show up in PR diffs. It leaves
out session-only operations, /auth/* and licensing endpoints.
- The docs intro covers API keys, an error-code table, rate limits and
backward compatibility. AGENTS.md gains a "Public API compatibility"
section.
SSO follow-ups
- While a connection enforces SSO, nobody can sign up with an email on
its domains; they're sent to SSO sign-in instead.
- /users/me exposes password_reset_allowed, and the 2FA status keeps
"required by the account" apart from "the account enforces SSO".
Also: the registration e2e page object waits for hydration before
filling the form, which fixes an intermittent failure.
railway-app
Bot
temporarily deployed
to
Hi.Events / Hi.Events-pr-1412
October 17, 2026 20:43
Destroyed
Contributor
|
| Mode | Result | ✅ Passed | ❌ Failed | ⏭️ Skipped | ⏱️ Duration | |
|---|---|---|---|---|---|---|
| Self-hosted | 106 | 0 | 1 | 0 | 3m 28s |
⚠️ Flaky tests: failed first, then passed on retry (1)
- Self-hosted ·
organizer/organizer-management.spec.ts:7· organizer management › an organizer creates a second organizer from the global menu
This branch was successfully 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
API keys
Organizers can create API keys under Settings → API keys to connect Zapier, CRMs and their own scripts.
personal_access_tokens.account_id). A key acts as that member, with their role, grants and permission overrides, and can never do more. Changes to the member's role apply straight away.GETendpoints and exports; other requests get403 API_KEY_READ_ONLY.auth:api,sanctum(keys allowed) or a session-onlyauth:apigroup. The session-only group covers auth, profile and sign-in security, team, account settings, payouts (Stripe Connect, terminal readers, VAT) and key management; keys get403 API_KEY_NOT_ALLOWEDthere.ApiKeyRouteExposureTestsnapshots that group and fails if anyMANAGE_TEAM,MANAGE_ACCOUNTorMANAGE_PAYMENTSaction becomes reachable with a key.jti) now goes throughAuthUserService, so it works under both guards.last_used_atis written at most every 5 minutes.In-app API reference
Settings → API keys → API reference renders the OpenAPI spec inside the app with Scalar, themed to match Hi.Events. Scalar's AI agent, MCP and telemetry are switched off, and it's loaded client-only in its own lazy chunk, so the main bundle doesn't change.
backend/resources/api-reference/openapi.json, and served from a session-onlyGET /api-reference. Generating it at request time takes about 4s and roughly 214MB, so that was ruled out.php artisan api-reference:exportregenerates the file, andIntegrationApiReferenceTestfails when it's out of date. Every change to the API surface therefore shows up as a diff in review./auth/*and the licensing endpoints (licensing is now excluded from/docs/apitoo).SSO follow-ups
These were finished after #1411 merged:
password_reset_allowed: exposed on/users/me, so Security settings stops offering a reset link that would never arrive.required_by_accountslists only accounts that require 2FA, as it does on develop. The newrequired_by_sso_accountslists accounts you own that enforce SSO.Testing
scramble:analyzeis clean.tests/accountandtests/authpass against the dev stack: 51 passed, 6 SSO specs skipped because no mock provider was set. That includes 12 API key specs covering: