@void/platform 0.28.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-page.mjs +2 -1
- package/dist/index.d.mts +17 -0
- package/dist/index.mjs +56 -1
- package/dist/runtime/api/assets/admin/client.js +180 -28
- package/dist/runtime/api/assets/admin/style.css +1 -1
- package/dist/runtime/api/index.js +324 -291
- package/dist/runtime/emailGateway/index.js +4 -4
- package/dist/runtime/manifest.json +13 -13
- package/dist/runtime/proxy/index.js +5 -5
- package/dist/runtime/tail/index.js +1 -1
- package/package.json +4 -4
package/dist/browser-page.mjs
CHANGED
|
@@ -37,7 +37,8 @@ html[data-theme="dark"] { color-scheme: dark; }
|
|
|
37
37
|
.void-auth-page p { margin: 0; font: inherit; color: var(--auth-secondary); overflow-wrap: anywhere; }
|
|
38
38
|
.void-auth-page strong { font-weight: 600; color: var(--auth-text); }
|
|
39
39
|
.void-auth-page a:not(.void-auth-button) { color: var(--auth-text); text-underline-offset: 3px; }
|
|
40
|
-
.void-auth-page
|
|
40
|
+
.void-auth-page form { display: grid; gap: 12px; }
|
|
41
|
+
.void-auth-page .void-auth-actions { display: grid; gap: 8px; }
|
|
41
42
|
.void-auth-page .void-auth-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 10px 16px; border: 1px solid var(--auth-border); border-radius: var(--auth-radius-element); background: var(--auth-body); color: var(--auth-text); font: inherit; font-weight: 550; line-height: 1.4; text-align: center; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; }
|
|
42
43
|
.void-auth-page .void-auth-button-primary { background: var(--auth-accent); color: var(--auth-on-accent); border-color: var(--auth-accent); }
|
|
43
44
|
.void-auth-page .void-auth-button:hover { filter: brightness(.92); }
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { BUILD_INSTANCE_FREE, BUILD_INSTANCE_LARGE, BuildInstanceType, BuiltinPlanId, EditablePlanLimit, PLAN_EDITABLE_LIMIT_KEYS, PLAN_LIMITS, PlanId, PlanLimits, PlanLimitsPatch, PlatformPlanCatalog, PlatformPlanDefinition, PlatformPlanReconciliation, createDefaultPlanCatalog, parseBuildInstanceType, parsePlanLimitsPatch, parsePlanName, parsePlatformPlanCatalog, parsePlatformPlanId, validatePlanLimits } from "./plans.mjs";
|
|
2
|
+
//#region src/access-policy.d.ts
|
|
3
|
+
/** An exact email domain, such as `example.com`, without wildcards or an `@`. */
|
|
4
|
+
export declare function isPlatformAccessEmailDomain(value: unknown): value is string;
|
|
5
|
+
/** Whether signing in with this Access identity provider proves a company identity. */
|
|
6
|
+
export declare function isPlatformAccessCompanyIdentityProvider(provider: Readonly<Record<string, unknown>>): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Whether one Access include or require rule restricts people to company
|
|
9
|
+
* identities. The installer checks the policies that protect the platform and
|
|
10
|
+
* the API checks project Zero Trust policies with this same rule list.
|
|
11
|
+
*
|
|
12
|
+
* A `login_method` rule admits everyone who can use the identity provider it
|
|
13
|
+
* names, so it counts only when `companyLoginMethod` accepts that provider ID.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isPlatformAccessIdentityRule(rule: Readonly<Record<string, unknown>>, companyLoginMethod: (identityProviderId: string) => boolean): boolean;
|
|
16
|
+
//#endregion
|
|
2
17
|
//#region src/app-access.d.ts
|
|
3
18
|
export declare const PLATFORM_APP_ACCESS_SETUP_PROOF_PREFIX = "void-platform-app-access-v1";
|
|
19
|
+
/** Uninstall handoff that turns off installer-managed project Zero Trust before any user exists. */
|
|
20
|
+
export declare const PLATFORM_APP_ACCESS_TURN_OFF_PROOF_PREFIX = "void-platform-app-access-turn-off-v1";
|
|
4
21
|
/** Installer handoff. Token values belong only in encrypted recovery and request bodies. */
|
|
5
22
|
type PlatformAppAccessSetup = Readonly<{
|
|
6
23
|
version: 1;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,62 @@
|
|
|
1
1
|
import { a as isSourceRevision, c as requiredString, i as isSandboxDrainProtocol, n as isPrintableText, o as isUsageProtocolVersion, s as record, t as assertRecord } from "./validate-DbJR7Q0Z.mjs";
|
|
2
2
|
import { BUILD_INSTANCE_FREE, BUILD_INSTANCE_LARGE, PLAN_EDITABLE_LIMIT_KEYS, PLAN_LIMITS, createDefaultPlanCatalog, parseBuildInstanceType, parsePlanLimitsPatch, parsePlanName, parsePlatformPlanCatalog, parsePlatformPlanId, validatePlanLimits } from "./plans.mjs";
|
|
3
|
+
//#region src/access-policy.ts
|
|
4
|
+
const COMPANY_IDENTITY_RULES = [
|
|
5
|
+
"email_list",
|
|
6
|
+
"gsuite",
|
|
7
|
+
"github-organization",
|
|
8
|
+
"saml",
|
|
9
|
+
"okta",
|
|
10
|
+
"azureAD",
|
|
11
|
+
"auth_context",
|
|
12
|
+
"group"
|
|
13
|
+
];
|
|
14
|
+
const COMPANY_IDENTITY_PROVIDER_TYPES = /* @__PURE__ */ new Set([
|
|
15
|
+
"azureAD",
|
|
16
|
+
"centrify",
|
|
17
|
+
"google-apps",
|
|
18
|
+
"okta",
|
|
19
|
+
"onelogin",
|
|
20
|
+
"pingone"
|
|
21
|
+
]);
|
|
22
|
+
function plainObject(value) {
|
|
23
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
24
|
+
}
|
|
25
|
+
/** An exact email domain, such as `example.com`, without wildcards or an `@`. */
|
|
26
|
+
function isPlatformAccessEmailDomain(value) {
|
|
27
|
+
return typeof value === "string" && /^(?:[a-z0-9-]+\.)+[a-z]{2,63}$/i.test(value);
|
|
28
|
+
}
|
|
29
|
+
/** Whether signing in with this Access identity provider proves a company identity. */
|
|
30
|
+
function isPlatformAccessCompanyIdentityProvider(provider) {
|
|
31
|
+
if (provider.type === "cloudflare") return plainObject(provider.config) && provider.config.restrict_to_account_members === true;
|
|
32
|
+
return COMPANY_IDENTITY_PROVIDER_TYPES.has(provider.type);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Whether one Access include or require rule restricts people to company
|
|
36
|
+
* identities. The installer checks the policies that protect the platform and
|
|
37
|
+
* the API checks project Zero Trust policies with this same rule list.
|
|
38
|
+
*
|
|
39
|
+
* A `login_method` rule admits everyone who can use the identity provider it
|
|
40
|
+
* names, so it counts only when `companyLoginMethod` accepts that provider ID.
|
|
41
|
+
*/
|
|
42
|
+
function isPlatformAccessIdentityRule(rule, companyLoginMethod) {
|
|
43
|
+
if (rule.email_domain) return plainObject(rule.email_domain) && isPlatformAccessEmailDomain(rule.email_domain.domain);
|
|
44
|
+
if (rule.email) return plainObject(rule.email) && typeof rule.email.email === "string" && /^[^\s*@]+@[^\s*@]+\.[^\s*@]+$/.test(rule.email.email);
|
|
45
|
+
if (rule.login_method) return plainObject(rule.login_method) && typeof rule.login_method.id === "string" && companyLoginMethod(rule.login_method.id);
|
|
46
|
+
if (rule.cloudflare_account_member) {
|
|
47
|
+
const member = rule.cloudflare_account_member;
|
|
48
|
+
return plainObject(member) && (member.account_id === void 0 || typeof member.account_id === "string" && /^[0-9a-f]{32}$/i.test(member.account_id));
|
|
49
|
+
}
|
|
50
|
+
return COMPANY_IDENTITY_RULES.some((key) => {
|
|
51
|
+
const value = Object.hasOwn(rule, key) ? rule[key] : void 0;
|
|
52
|
+
return plainObject(value) && Object.keys(value).length > 0;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
3
56
|
//#region src/app-access.ts
|
|
4
57
|
const PLATFORM_APP_ACCESS_SETUP_PROOF_PREFIX = "void-platform-app-access-v1";
|
|
58
|
+
/** Uninstall handoff that turns off installer-managed project Zero Trust before any user exists. */
|
|
59
|
+
const PLATFORM_APP_ACCESS_TURN_OFF_PROOF_PREFIX = "void-platform-app-access-turn-off-v1";
|
|
5
60
|
function parsePlatformAppAccessSetup(value) {
|
|
6
61
|
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("Invalid app access setup.");
|
|
7
62
|
const input = value;
|
|
@@ -1342,4 +1397,4 @@ function createPlatformWorkerConfigs(input) {
|
|
|
1342
1397
|
};
|
|
1343
1398
|
}
|
|
1344
1399
|
//#endregion
|
|
1345
|
-
export { BUILD_INSTANCE_FREE, BUILD_INSTANCE_LARGE, DEFAULT_PLATFORM_SESSION_SECONDS, GOOGLE_OIDC_ISSUER, PLAN_EDITABLE_LIMIT_KEYS, PLAN_LIMITS, PLATFORM_APPLICATION_KEY, PLATFORM_APP_ACCESS_SETUP_PROOF_PREFIX, PLATFORM_AUTH_SETUP_PROOF_PREFIX, PLATFORM_DEPLOYMENT_SCHEMA_VERSION, PLATFORM_DISABLED_KEY, PLATFORM_DISABLED_VALUE, PLATFORM_DISCOVERY_SCHEMA_VERSION, PLATFORM_HEALTH_HOSTNAME_LABEL, PLATFORM_INSTALLATION_SCHEMA_VERSION, PLATFORM_LOGIN_KINDS, PLATFORM_PROJECT_INGRESS_SOURCE, PLATFORM_R2_OWNERSHIP_MARKER_KEY, PLATFORM_REMOTE_INSTALLATION_MANIFEST_KEY, PLATFORM_RESOURCE_OWNERSHIP_SCHEMA_VERSION, PLATFORM_SANDBOX_DRAIN_KEY, PLATFORM_USAGE_PROTOCOL_VERSION, createApplicationRoutes, createDefaultPlanCatalog, createPlatformDeploymentManifest, createPlatformDiscoveryDocument, createPlatformInstallationManifest, createPlatformResourceNames, createPlatformResourceOwnershipMarker, createPlatformWorkerConfigs, isPlatformSignupAllowed, normalizeApplicationDomain, normalizeInstallationSlug, normalizePlatformDashboardUrl, parseBuildInstanceType, parsePlanLimitsPatch, parsePlanName, parsePlatformAccessProtection, parsePlatformAdmissionPolicy, parsePlatformAppAccessSetup, parsePlatformAuthenticationSetup, parsePlatformDeploymentManifest, parsePlatformDiscoveryDocument, parsePlatformIdentityUrl, parsePlatformInstallationManifest, parsePlatformLifecycleOperation, parsePlatformLoginConfiguration, parsePlatformLoginDescriptor, parsePlatformLoginId, parsePlatformPlanCatalog, parsePlatformPlanId, parsePlatformResourceOwnershipMarker, parsePlatformSignupAllowlistEntry, platformAuthenticationRecoveryMessage, platformDashboardUrl, platformHealthHostname, platformProjectHostname, platformProjectHostnames, platformProjectIngressName, platformProjectIngressPrefix, platformProjectWorkersDevHostname, platformProtectionProofMessage, platformWorkersDevAliasKey, readPlatformApplication, recordInstallationResource, recordInstallationStep, resolvePlatformApplicationEnvironment, setInstallationDesiredState, setInstallationEndpoints, transitionInstallation, validatePlanLimits, validatePlatformAdmissionPolicy };
|
|
1400
|
+
export { BUILD_INSTANCE_FREE, BUILD_INSTANCE_LARGE, DEFAULT_PLATFORM_SESSION_SECONDS, GOOGLE_OIDC_ISSUER, PLAN_EDITABLE_LIMIT_KEYS, PLAN_LIMITS, PLATFORM_APPLICATION_KEY, PLATFORM_APP_ACCESS_SETUP_PROOF_PREFIX, PLATFORM_APP_ACCESS_TURN_OFF_PROOF_PREFIX, PLATFORM_AUTH_SETUP_PROOF_PREFIX, PLATFORM_DEPLOYMENT_SCHEMA_VERSION, PLATFORM_DISABLED_KEY, PLATFORM_DISABLED_VALUE, PLATFORM_DISCOVERY_SCHEMA_VERSION, PLATFORM_HEALTH_HOSTNAME_LABEL, PLATFORM_INSTALLATION_SCHEMA_VERSION, PLATFORM_LOGIN_KINDS, PLATFORM_PROJECT_INGRESS_SOURCE, PLATFORM_R2_OWNERSHIP_MARKER_KEY, PLATFORM_REMOTE_INSTALLATION_MANIFEST_KEY, PLATFORM_RESOURCE_OWNERSHIP_SCHEMA_VERSION, PLATFORM_SANDBOX_DRAIN_KEY, PLATFORM_USAGE_PROTOCOL_VERSION, createApplicationRoutes, createDefaultPlanCatalog, createPlatformDeploymentManifest, createPlatformDiscoveryDocument, createPlatformInstallationManifest, createPlatformResourceNames, createPlatformResourceOwnershipMarker, createPlatformWorkerConfigs, isPlatformAccessCompanyIdentityProvider, isPlatformAccessEmailDomain, isPlatformAccessIdentityRule, isPlatformSignupAllowed, normalizeApplicationDomain, normalizeInstallationSlug, normalizePlatformDashboardUrl, parseBuildInstanceType, parsePlanLimitsPatch, parsePlanName, parsePlatformAccessProtection, parsePlatformAdmissionPolicy, parsePlatformAppAccessSetup, parsePlatformAuthenticationSetup, parsePlatformDeploymentManifest, parsePlatformDiscoveryDocument, parsePlatformIdentityUrl, parsePlatformInstallationManifest, parsePlatformLifecycleOperation, parsePlatformLoginConfiguration, parsePlatformLoginDescriptor, parsePlatformLoginId, parsePlatformPlanCatalog, parsePlatformPlanId, parsePlatformResourceOwnershipMarker, parsePlatformSignupAllowlistEntry, platformAuthenticationRecoveryMessage, platformDashboardUrl, platformHealthHostname, platformProjectHostname, platformProjectHostnames, platformProjectIngressName, platformProjectIngressPrefix, platformProjectWorkersDevHostname, platformProtectionProofMessage, platformWorkersDevAliasKey, readPlatformApplication, recordInstallationResource, recordInstallationStep, resolvePlatformApplicationEnvironment, setInstallationDesiredState, setInstallationEndpoints, transitionInstallation, validatePlanLimits, validatePlatformAdmissionPolicy };
|