Tighten agent-auth back-compat defaults

Co-Authored-By: madison@stack-auth.com <madison.w.kennedy@gmail.com>
This commit is contained in:
Devin AI 2026-07-08 07:21:54 +00:00
parent a845c87242
commit 99da207c46
3 changed files with 10 additions and 11 deletions

View File

@ -40,7 +40,7 @@ export const ALL_APP_TAGS = {
type ParentAppId = "authentication" | "analytics";
type App = {
export type App = {
displayName: string,
subtitle: string,
tags: (keyof typeof ALL_APP_TAGS)[],

View File

@ -1,14 +1,14 @@
import { ALL_APPS } from "../apps/apps-config";
import { applyOrganizationDefaults } from "./schema";
import { expect } from "vitest";
import { expect, test } from "vitest";
import.meta.vitest?.test("agent-auth is absent from default installed apps", () => {
test("agent-auth is absent from default installed apps", () => {
const defaults = applyOrganizationDefaults({});
expect(Object.keys(defaults.apps.installed)).not.toContain("agent-auth");
});
import.meta.vitest?.test("agent-auth stays explicitly enableable", () => {
test("agent-auth stays explicitly enableable", () => {
const defaults = applyOrganizationDefaults({
apps: {
installed: {

View File

@ -5,7 +5,7 @@
// OTHERWISE THINGS WILL GO BOOM!!
import * as yup from "yup";
import { ALL_APPS } from "../apps/apps-config";
import { ALL_APPS, type App } from "../apps/apps-config";
import { DEFAULT_EMAIL_TEMPLATES, DEFAULT_EMAIL_THEMES, DEFAULT_EMAIL_THEME_ID } from "../helpers/emails";
import * as schemaFields from "../schema-fields";
import { productSchema, userSpecifiedIdSchema, yupBoolean, yupDate, yupMixed, yupNever, yupNumber, yupObject, yupRecord, yupString, yupTuple, yupUnion } from "../schema-fields";
@ -293,13 +293,12 @@ const branchOnboardingSchema = yupObject({
requireEmailVerification: yupBoolean(),
});
function isIncludedInDefaultInstalledApps(app: App) {
return app.includedInDefaultInstalledApps !== false;
}
const installedAppIdsByDefault = typedEntries(ALL_APPS)
.filter(([, app]) => {
if ("includedInDefaultInstalledApps" in app) {
return false;
}
return true;
})
.filter(([, app]) => isIncludedInDefaultInstalledApps(app))
.map(([appId]) => appId);
export const branchConfigSchema = canNoLongerBeOverridden(projectConfigSchema, [