@ibgib/space-gib 0.0.14 → 0.0.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibgib/space-gib",
3
- "version": "0.0.14",
3
+ "version": "0.0.17",
4
4
  "type": "module",
5
5
  "description": "ibgib storage and provider service — SaaS at ibgib.space",
6
6
  "scripts": {
@@ -12,11 +12,11 @@
12
12
  "build:test": "tsc -p tsconfig.test.json"
13
13
  },
14
14
  "dependencies": {
15
- "@ibgib/core-gib": "^0.1.71",
16
- "@ibgib/helper-gib": "^0.0.36",
15
+ "@ibgib/core-gib": "^0.1.73",
16
+ "@ibgib/helper-gib": "^0.0.37",
17
17
  "@ibgib/ts-gib": "^0.5.33",
18
- "@ibgib/web-gib": "^0.0.57",
19
- "@ibgib/node-gib": "^0.0.15"
18
+ "@ibgib/web-gib": "^0.0.59",
19
+ "@ibgib/node-gib": "^0.0.18"
20
20
  },
21
21
  "engines": {
22
22
  "node": ">=20.0.0"
@@ -8,4 +8,4 @@
8
8
  /**
9
9
  * Version of space-gib, auto-updated by the build process.
10
10
  */
11
- export const AUTO_GENERATED_VERSION = '0.0.14';
11
+ export const AUTO_GENERATED_VERSION = '0.0.17';
@@ -34,8 +34,24 @@ if (urlParams.has('code') && urlParams.has('state') && window.opener) {
34
34
 
35
35
  console.log(`[space-gib bootstrap] version: ${AUTO_GENERATED_VERSION}`);
36
36
 
37
- if ((process.env.KEYSTONE_PROFILE || '').toLowerCase() === 'test') {
38
- console.warn(`%c⚠️ WARNING: KEYSTONE_PROFILE IS SET TO 'test'!\nALL GENERATED KEYSTONES USE LOW-SECURITY TEST PARAMETERS (12 CHALLENGES).\nFOR LOCAL TESTING ONLY — DO NOT USE FOR REAL SECRETS OR PRODUCTION DATA!`, 'background: #990000; color: #ffffff; font-size: 14px; font-weight: bold; padding: 8px; border-radius: 4px;');
37
+ const clientProfiles = [
38
+ process.env.KEYSTONE_PROFILE_SOVEREIGN_PRIMARY,
39
+ process.env.KEYSTONE_PROFILE_SOVEREIGN_SYNC,
40
+ process.env.KEYSTONE_PROFILE_CUSTODIAN_SYNC,
41
+ ].filter(Boolean) as string[];
42
+
43
+ const isProdEnv = process.env.NODE_ENV === 'production';
44
+ const hasDevProfile = clientProfiles.some(p => p.endsWith('.dev'));
45
+ const hasStagingProfile = clientProfiles.some(p => p.endsWith('.staging'));
46
+
47
+ if (isProdEnv && (hasDevProfile || hasStagingProfile)) {
48
+ throw new Error(`Security Violation: Non-production keystone profiles are prohibited when NODE_ENV=production. Active client profiles: ${clientProfiles.join(', ')}. (E: 7a8b9c0d1e2f3456789abcdef0123456)`);
49
+ }
50
+
51
+ if (hasDevProfile) {
52
+ console.warn(`%c⚠️ WARNING: DEVELOPMENT KEYSTONE PROFILE ACTIVE (.dev)!\nGENERATED KEYSTONES USE LOW-SECURITY DEV PARAMETERS FOR RAPID TESTING.\nFOR LOCAL TESTING ONLY — DO NOT USE FOR REAL SECRETS OR PRODUCTION DATA!`, 'background: #990000; color: #ffffff; font-size: 14px; font-weight: bold; padding: 8px; border-radius: 4px;');
53
+ } else if (hasStagingProfile) {
54
+ console.info(`%cℹ️ STAGING KEYSTONE PROFILE ACTIVE (.staging)`, 'background: #005599; color: #ffffff; font-size: 13px; font-weight: bold; padding: 6px; border-radius: 4px;');
39
55
  }
40
56
 
41
57
  // ---------------------------------------------------------------------------
@@ -38,10 +38,22 @@ async function main(): Promise<void> {
38
38
  console.log(`${lc} starting...`);
39
39
  console.log(`${lc} dataDir: ${DATA_DIR}`);
40
40
 
41
- if ((process.env.KEYSTONE_PROFILE || '').toLowerCase() === 'test') {
42
- console.warn(`\n==========================================================\n⚠️ WARNING: KEYSTONE_PROFILE IS SET TO 'test'!\nALL GENERATED KEYSTONES USE LOW-SECURITY TEST PARAMETERS (12 CHALLENGES).\nFOR LOCAL TESTING ONLY — DO NOT USE FOR REAL SECRETS OR PRODUCTION DATA!\n==========================================================\n (W: 890123456789abcdef0123456789a123)`);
43
- } else {
44
- console.log(`process.env.KEYSTONE_PROFILE: ${process.env.KEYSTONE_PROFILE || ''} (I: 961014e2dd082293b83b917835c97e26)`)
41
+ const custodianPrimaryProfile = (process.env.KEYSTONE_PROFILE_CUSTODIAN_PRIMARY || '').trim();
42
+ if (!custodianPrimaryProfile) {
43
+ throw new Error(`${lc} Fatal Error: KEYSTONE_PROFILE_CUSTODIAN_PRIMARY environment variable is missing or blank. (E: 8a9b0c1d2e3f4567890123456789abcd)`);
44
+ }
45
+
46
+ const isProdEnv = process.env.NODE_ENV === 'production';
47
+ if (isProdEnv && !custodianPrimaryProfile.endsWith('.prod')) {
48
+ throw new Error(`${lc} Security Violation: Non-production keystone profile '${custodianPrimaryProfile}' is prohibited when NODE_ENV=production. (E: 9b0c1d2e3f4567890123456789abcdef)`);
49
+ }
50
+
51
+ console.log(`${lc} KEYSTONE_PROFILE_CUSTODIAN_PRIMARY: ${custodianPrimaryProfile} (I: 961014e2dd082293b83b917835c97e26)`);
52
+
53
+ if (custodianPrimaryProfile.endsWith('.dev')) {
54
+ console.warn(`\n==========================================================\n⚠️ WARNING: CUSTODIAN KEYSTONE PROFILE IS SET TO DEVELOPMENT ('${custodianPrimaryProfile}')!\nCUSTODIAL KEYSTONES WILL USE LOW-SECURITY DEV PARAMETERS.\nFOR LOCAL TESTING ONLY — DO NOT USE FOR REAL SECRETS OR PRODUCTION DATA!\n==========================================================\n (W: 890123456789abcdef0123456789a123)`);
55
+ } else if (custodianPrimaryProfile.endsWith('.staging')) {
56
+ console.info(`${lc} ℹ️ STAGING CUSTODIAN KEYSTONE PROFILE ACTIVE ('${custodianPrimaryProfile}')`);
45
57
  }
46
58
 
47
59
  const syncUpgradeHandler = new SyncUpgradeHandler();