refactor(server): tanant auth (#148)

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-11-06 01:10:08 +08:00
committed by GitHub
parent 22f058aee3
commit 4633dbbd1e
63 changed files with 5949 additions and 400 deletions

View File

@@ -3,4 +3,5 @@ export * from './cn'
export * from './semaphore'
export * from './spring'
export * from './storage-provider'
export * from './tenant'
export * from './u8array'

View File

@@ -0,0 +1,12 @@
const RESERVED_SLUGS = ['admin', 'docs', 'support', 'status', 'api', 'assets', 'static', 'www'] as const
export const RESERVED_TENANT_SLUGS = RESERVED_SLUGS
export type ReservedTenantSlug = (typeof RESERVED_TENANT_SLUGS)[number]
export function isTenantSlugReserved(slug: string): boolean {
const normalized = slug.trim().toLowerCase()
return RESERVED_TENANT_SLUGS.includes(normalized as ReservedTenantSlug)
}
export const DEFAULT_BASE_DOMAIN = 'afilmory.art'