012d819557
## Summary Consolidates three separate PRs (#18260, #18261, #18262) into a single unified branch with all review feedback addressed: ### New features - **ApplicationRegistration entity** — server-level registration for OAuth apps with encrypted server variables - **OAuth 2.0 server** — authorization code, client credentials, refresh token grants with PKCE support - **OAuth discovery endpoint** — `.well-known/oauth-authorization-server` metadata - **Frontend UI** — app registration details page with credential management, redirect URI editing, and server variable configuration - **CLI integration** — `twenty dev` auto-registers apps and stores OAuth credentials locally - **Authorize consent screen** — OAuth consent page at `/authorize` showing requested scopes ### Review feedback addressed **Renames (PR #18260):** - `appRegistration` → `applicationRegistration` (entity, tables, files, imports, GraphQL types) - `appRegistrationVariable` → `applicationRegistrationVariable` - `clientId` → `oAuthClientId`, `clientSecretHash` → `oAuthClientSecretHash`, `redirectUris` → `oAuthRedirectUris`, `scopes` → `oAuthScopes` **Security fixes (PR #18261):** - Fixed redirect URI validation bypass when `oAuthRedirectUris` is an empty array - Fixed workspace isolation in `clientCredentialsGrant` — now uses `find()` with explicit handling for multiple installations - Added error logging in refresh token `catch` block instead of silently swallowing **Code quality (PR #18262):** - Split `VersionDistributionEntry` into its own file (one export per file) - Split GraphQL queries and mutations into individual files with a shared fragment - Removed unused `OAuth` entry from `AuthProviderEnum` - Added loading state to `handleRotateSecret` - Removed 27 narration-style comments from test files - Added proper guards (`PublicEndpointGuard`, `NoPermissionGuard`) to controllers and resolvers ## Test plan - [ ] Verify `twenty dev` registers an app and stores OAuth credentials - [ ] Test OAuth authorization code flow end-to-end (authorize → token → API call) - [ ] Test client credentials grant - [ ] Verify redirect URI validation rejects requests when no URIs are registered - [ ] Verify app registration detail page renders correctly - [ ] Test secret rotation with loading state - [ ] Verify server variable editing and saving - [ ] Run `npx nx database:reset twenty-server` to validate migration Closes #18260, #18261, #18262 Made with [Cursor](https://cursor.com) --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
64 lines
2.3 KiB
TypeScript
64 lines
2.3 KiB
TypeScript
/*
|
|
* _____ _
|
|
*|_ _|_ _____ _ __ | |_ _ _
|
|
* | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
|
|
* | | \ V V / __/ | | | |_| |_| | Any edits to this will be overridden
|
|
* |_| \_/\_/ \___|_| |_|\__|\__, |
|
|
* |___/
|
|
*/
|
|
|
|
export type { ApplicationManifest } from './applicationType';
|
|
export type { ApplicationVariables } from './applicationVariablesType';
|
|
export type { AssetManifest } from './assetManifestType';
|
|
export { API_CLIENT_DIR } from './constants/ApiClientDirectory';
|
|
export { ASSETS_DIR } from './constants/AssetDirectory';
|
|
export { DEFAULT_API_KEY_NAME } from './constants/DefaultApiKeyName';
|
|
export { DEFAULT_API_URL_NAME } from './constants/DefaultApiUrlName';
|
|
export { DEFAULT_APP_ACCESS_TOKEN_NAME } from './constants/DefaultAppAccessTokenName';
|
|
export { GENERATED_DIR } from './constants/GeneratedDirectory';
|
|
export { NODE_ESM_CJS_BANNER } from './constants/NodeEsmCjsBanner';
|
|
export { OUTPUT_DIR } from './constants/OutputDirectory';
|
|
export { SyncableEntity } from './enums/syncable-entities.enum';
|
|
export type {
|
|
RegularFieldManifest,
|
|
RelationFieldManifest,
|
|
FieldManifest,
|
|
} from './fieldManifestType';
|
|
export type {
|
|
CommandMenuItemManifest,
|
|
FrontComponentCommandManifest,
|
|
FrontComponentManifest,
|
|
} from './frontComponentManifestType';
|
|
export type {
|
|
LogicFunctionManifest,
|
|
CronTriggerSettings,
|
|
DatabaseEventTriggerSettings,
|
|
HttpRouteTriggerSettings,
|
|
} from './logicFunctionManifestType';
|
|
export type { Manifest } from './manifestType';
|
|
export type { NavigationMenuItemManifest } from './navigationMenuItemManifestType';
|
|
export type { ObjectFieldManifest } from './objectFieldManifest.type';
|
|
export type { ObjectManifest } from './objectManifestType';
|
|
export type {
|
|
PageLayoutWidgetManifest,
|
|
PageLayoutTabManifest,
|
|
PageLayoutManifest,
|
|
} from './pageLayoutManifestType';
|
|
export type {
|
|
ObjectPermissionManifest,
|
|
FieldPermissionManifest,
|
|
RoleManifest,
|
|
} from './roleManifestType';
|
|
export type { ServerVariables } from './server-variables.type';
|
|
export type { SkillManifest } from './skillManifestType';
|
|
export type { SyncableEntityOptions } from './syncableEntityOptionsType';
|
|
export type {
|
|
ViewManifestFilterValue,
|
|
ViewFieldManifest,
|
|
ViewFilterManifest,
|
|
ViewFilterGroupManifest,
|
|
ViewGroupManifest,
|
|
ViewFieldGroupManifest,
|
|
ViewManifest,
|
|
} from './viewManifestType';
|