Voeg Api.AndreaSlopFotografie toe met setup-token, proxy-bewuste limiters en ASF-admin-thema
- Core: opt-in ForwardedHeaders:KnownProxies en rate limiters per clientadres (zonder configuratie ongewijzigd gedrag) - Identity: optioneel setup-token (X-Setup-Token), beide setup-endpoints onder de login-limiter, beveiligingsgebeurtenis setup_token_rejected (5007) - Nieuw client-project SlpModularCms.Api.AndreaSlopFotografie (Identity + Availability) met bijbehorende tests - Frontend: thema asf (VITE_THEME), VITE_DEFAULT_LANGUAGE, tokenveld op de setup-pagina - CI: jobs publish/deploy-asf-test achter ASF_TEST_DEPLOY_ENABLED - Fix U1: 301-Location wordt nu percent-encoded (gevonden door de property-test) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+12
-2
@@ -31,10 +31,15 @@ async function fetchSetupStatus(): Promise<SetupStatus> {
|
||||
if (_setupStatusCache !== null) return _setupStatusCache;
|
||||
if (_setupStatusPromise === null) {
|
||||
_setupStatusPromise = api
|
||||
.get<{ initialized?: boolean; Initialized?: boolean }>('/api/v1/Setup/status')
|
||||
.get<{ initialized?: boolean; Initialized?: boolean; tokenRequired?: boolean; TokenRequired?: boolean }>(
|
||||
'/api/v1/Setup/status',
|
||||
)
|
||||
.then((raw) => {
|
||||
// Backend may return PascalCase (Initialized) if no camelCase policy is set.
|
||||
const s: SetupStatus = { initialized: raw.initialized ?? raw.Initialized ?? false };
|
||||
const s: SetupStatus = {
|
||||
initialized: raw.initialized ?? raw.Initialized ?? false,
|
||||
tokenRequired: raw.tokenRequired ?? raw.TokenRequired ?? false,
|
||||
};
|
||||
_setupStatusCache = s;
|
||||
return s;
|
||||
})
|
||||
@@ -52,6 +57,11 @@ export function _resetSetupStatusCache(): void {
|
||||
_setupStatusPromise = null;
|
||||
}
|
||||
|
||||
/** Whether the setup page must ask for the setup token (known once the InitGuard fetched the status). */
|
||||
export function isSetupTokenRequired(): boolean {
|
||||
return _setupStatusCache?.tokenRequired === true;
|
||||
}
|
||||
|
||||
export function _markSystemInitialized(): void {
|
||||
_setupStatusCache = { initialized: true };
|
||||
_setupStatusPromise = null;
|
||||
|
||||
Reference in New Issue
Block a user