dt-app
Version:
The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.
20 lines (19 loc) • 832 B
TypeScript
/**
* Builds a set of allowed CORS origins based on the environment URL
* and cloud development environment URLs.
*/
export declare function buildAllowedOrigins(environmentUrl: string): Set<string>;
/**
* Extracts the base domain from the environment URL for suffix matching.
* E.g. `https://tenant.sprint.apps.dynatracelabs.com` → `sprint.apps.dynatracelabs.com`
*
* This allows sub-origins like `appId--tenant.sprint.apps.dynatracelabs.com`
* to be accepted by CORS.
*/
export declare function getBaseDomain(environmentUrl: string): string | undefined;
/**
* Creates a CORS origin validation function that checks whether the
* requesting origin is in the allowlist or matches the environment
* base domain suffix.
*/
export declare function createOriginChecker(environmentUrl: string): (origin: string) => boolean;