@private.me/xbind 1.2.17 → 1.3.5
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/README.md +97 -7
- package/dist-standalone/_deps/crypto/base64.js +212 -87
- package/dist-standalone/_deps/crypto/cjs/base64.js +653 -91
- package/dist-standalone/_deps/crypto/cjs/errors.js +658 -102
- package/dist-standalone/_deps/crypto/cjs/hmac.js +468 -66
- package/dist-standalone/_deps/crypto/cjs/index.js +848 -82
- package/dist-standalone/_deps/crypto/cjs/package.json +1 -0
- package/dist-standalone/_deps/crypto/cjs/padding.js +504 -50
- package/dist-standalone/_deps/crypto/cjs/share-header.js +369 -65
- package/dist-standalone/_deps/crypto/cjs/shares.js +865 -143
- package/dist-standalone/_deps/crypto/cjs/tlv.js +1005 -183
- package/dist-standalone/_deps/crypto/cjs/uuid.js +437 -55
- package/dist-standalone/_deps/crypto/cjs/verify.js +414 -24
- package/dist-standalone/_deps/crypto/cjs/xorida.js +888 -186
- package/dist-standalone/_deps/crypto/errors.js +179 -89
- package/dist-standalone/_deps/crypto/hmac.js +129 -61
- package/dist-standalone/_deps/crypto/index.js +140 -40
- package/dist-standalone/_deps/crypto/padding.js +151 -45
- package/dist-standalone/_deps/crypto/share-header.js +89 -60
- package/dist-standalone/_deps/crypto/shares.js +280 -133
- package/dist-standalone/_deps/crypto/tlv.js +348 -179
- package/dist-standalone/_deps/crypto/uuid.js +130 -50
- package/dist-standalone/_deps/crypto/verify.js +71 -15
- package/dist-standalone/_deps/crypto/xorida.js +332 -181
- package/dist-standalone/_deps/shared/cjs/errors.js +582 -525
- package/dist-standalone/_deps/shared/cjs/index.js +413 -409
- package/dist-standalone/_deps/shared/cjs/types.js +262 -348
- package/dist-standalone/_deps/shared/errors.d.ts +7 -1
- package/dist-standalone/_deps/shared/errors.d.ts.map +1 -1
- package/dist-standalone/_deps/shared/errors.js +229 -166
- package/dist-standalone/_deps/shared/errors.js.map +1 -1
- package/dist-standalone/_deps/shared/index.js +50 -54
- package/dist-standalone/_deps/shared/types.js +61 -60
- package/dist-standalone/_deps/ux-helpers/cjs/errors.js +1 -1
- package/dist-standalone/_deps/ux-helpers/cjs/pagination.js +1 -1
- package/dist-standalone/_deps/ux-helpers/cjs/progress.js +1 -1
- package/dist-standalone/_deps/ux-helpers/cjs/search.js +1 -1
- package/dist-standalone/_deps/ux-helpers/errors.js +1 -1
- package/dist-standalone/_deps/ux-helpers/pagination.js +1 -1
- package/dist-standalone/_deps/ux-helpers/progress.js +1 -1
- package/dist-standalone/_deps/ux-helpers/search.js +1 -1
- package/dist-standalone/_deps/xchange/auto-accept.js +1 -1
- package/dist-standalone/_deps/xchange/cjs/auto-accept.js +1 -1
- package/dist-standalone/_deps/xchange/cjs/errors.js +1 -1
- package/dist-standalone/_deps/xchange/cjs/index.js +1 -1
- package/dist-standalone/_deps/xchange/cjs/invite-client.js +1 -1
- package/dist-standalone/_deps/xchange/cjs/lazy-init.js +1 -1
- package/dist-standalone/_deps/xchange/cjs/trust-integration.js +1 -1
- package/dist-standalone/_deps/xchange/cjs/xchange.js +1 -1
- package/dist-standalone/_deps/xchange/errors.js +1 -1
- package/dist-standalone/_deps/xchange/index.js +1 -1
- package/dist-standalone/_deps/xchange/invite-client.js +1 -1
- package/dist-standalone/_deps/xchange/lazy-init.js +1 -1
- package/dist-standalone/_deps/xchange/trust-integration.js +1 -1
- package/dist-standalone/_deps/xchange/xchange.js +1 -1
- package/dist-standalone/_deps/xregistry/cjs/discovery.js +1 -1
- package/dist-standalone/_deps/xregistry/cjs/errors.js +1 -1
- package/dist-standalone/_deps/xregistry/cjs/index.js +1 -1
- package/dist-standalone/_deps/xregistry/cjs/registry.js +1 -1
- package/dist-standalone/_deps/xregistry/cjs/schema.js +1 -1
- package/dist-standalone/_deps/xregistry/cjs/types.js +1 -1
- package/dist-standalone/_deps/xregistry/discovery.js +1 -1
- package/dist-standalone/_deps/xregistry/errors.js +1 -1
- package/dist-standalone/_deps/xregistry/index.js +1 -1
- package/dist-standalone/_deps/xregistry/registry.js +1 -1
- package/dist-standalone/_deps/xregistry/schema.js +1 -1
- package/dist-standalone/_deps/xregistry/types.js +1 -1
- package/dist-standalone/cjs/identity.js +2 -3
- package/dist-standalone/cli/setup.d.ts +52 -0
- package/dist-standalone/cli/setup.js +515 -0
- package/dist-standalone/cli/types.d.ts +79 -0
- package/dist-standalone/cli/types.js +27 -0
- package/dist-standalone/cli/xbind.d.ts +20 -0
- package/dist-standalone/cli/xbind.js +149 -0
- package/dist-standalone/identity.js +2 -3
- package/package.json +3 -2
- package/share1.dat +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
/**
|
|
4
|
+
* @module cli/xbind
|
|
5
|
+
* Main xBind CLI router - dispatches to subcommands.
|
|
6
|
+
*
|
|
7
|
+
* Supports 12 commands (v2.0.0 spec):
|
|
8
|
+
* 1. setup - Create deployment identity
|
|
9
|
+
* 2. connect - Connect to a service (TODO)
|
|
10
|
+
* 3. invite - Generate invite link (TODO)
|
|
11
|
+
* 4. list - List connections (TODO)
|
|
12
|
+
* 5. status - Display connection status (TODO)
|
|
13
|
+
* 6. migrate - Scan for API keys (TODO)
|
|
14
|
+
* 7. trial - Activate free trial (TODO)
|
|
15
|
+
* 8. deploy - Deploy algorithms (TODO)
|
|
16
|
+
* 9. server - Start relay server (TODO)
|
|
17
|
+
* 10. revoke - Revoke connection (TODO)
|
|
18
|
+
* 11. backup - Export/import identity (TODO)
|
|
19
|
+
* 12. debug - Diagnostics (TODO)
|
|
20
|
+
*/
|
|
21
|
+
import { parseArgs } from 'node:util';
|
|
22
|
+
import { ExitCode, Colors } from './types.js';
|
|
23
|
+
/**
|
|
24
|
+
* Show help message.
|
|
25
|
+
*/
|
|
26
|
+
function showHelp() {
|
|
27
|
+
console.log(`
|
|
28
|
+
xBind CLI - Identity-Based M2M Authentication
|
|
29
|
+
|
|
30
|
+
Usage:
|
|
31
|
+
xbind <command> [options]
|
|
32
|
+
|
|
33
|
+
Commands:
|
|
34
|
+
setup Create deployment identity (DID + DeploymentID)
|
|
35
|
+
connect Connect to a service (TODO)
|
|
36
|
+
invite Generate viral invite link (TODO)
|
|
37
|
+
list List all active connections (TODO)
|
|
38
|
+
status Display connection status (TODO)
|
|
39
|
+
migrate Scan codebase for API keys (TODO)
|
|
40
|
+
trial Activate 3-month free trial (TODO)
|
|
41
|
+
deploy Deploy proprietary algorithms (TODO)
|
|
42
|
+
server Start agent relay server (TODO)
|
|
43
|
+
revoke Revoke connection (TODO)
|
|
44
|
+
backup Export/import identity (TODO)
|
|
45
|
+
debug Diagnostic information (TODO)
|
|
46
|
+
|
|
47
|
+
Global Options:
|
|
48
|
+
--json Output JSON only (no human-readable text)
|
|
49
|
+
--no-color Disable colored output
|
|
50
|
+
--debug Show detailed error information
|
|
51
|
+
-h, --help Show this help message
|
|
52
|
+
|
|
53
|
+
Examples:
|
|
54
|
+
xbind setup --name my-service
|
|
55
|
+
xbind setup --email user@example.com --force
|
|
56
|
+
xbind connect payments-service
|
|
57
|
+
xbind status
|
|
58
|
+
|
|
59
|
+
Documentation:
|
|
60
|
+
https://private.me/docs/xbind
|
|
61
|
+
`.trim());
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Show version.
|
|
65
|
+
*/
|
|
66
|
+
function showVersion() {
|
|
67
|
+
// Read from package.json
|
|
68
|
+
console.log('xBind CLI v1.3.0');
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Main CLI entry point.
|
|
72
|
+
*/
|
|
73
|
+
async function main() {
|
|
74
|
+
const args = process.argv.slice(2);
|
|
75
|
+
// No arguments - show help
|
|
76
|
+
if (args.length === 0) {
|
|
77
|
+
showHelp();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// Parse global flags
|
|
81
|
+
const { values, positionals } = parseArgs({
|
|
82
|
+
args,
|
|
83
|
+
options: {
|
|
84
|
+
help: { type: 'boolean', short: 'h' },
|
|
85
|
+
version: { type: 'boolean', short: 'v' },
|
|
86
|
+
json: { type: 'boolean' },
|
|
87
|
+
'no-color': { type: 'boolean' },
|
|
88
|
+
debug: { type: 'boolean' },
|
|
89
|
+
},
|
|
90
|
+
allowPositionals: true,
|
|
91
|
+
strict: false, // Allow command-specific flags
|
|
92
|
+
});
|
|
93
|
+
// Global flags
|
|
94
|
+
if (values.help) {
|
|
95
|
+
showHelp();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (values.version) {
|
|
99
|
+
showVersion();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// Get command
|
|
103
|
+
const command = positionals[0];
|
|
104
|
+
if (!command) {
|
|
105
|
+
showHelp();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
// Route to command handler
|
|
109
|
+
switch (command) {
|
|
110
|
+
case 'setup': {
|
|
111
|
+
const { main: setupMain } = await import('./setup.js');
|
|
112
|
+
await setupMain(args.slice(1)); // Pass remaining args to setup command
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
case 'connect':
|
|
116
|
+
case 'invite':
|
|
117
|
+
case 'list':
|
|
118
|
+
case 'status':
|
|
119
|
+
case 'migrate':
|
|
120
|
+
case 'trial':
|
|
121
|
+
case 'deploy':
|
|
122
|
+
case 'server':
|
|
123
|
+
case 'revoke':
|
|
124
|
+
case 'backup':
|
|
125
|
+
case 'debug': {
|
|
126
|
+
const useColors = !values['no-color'] && process.stderr.isTTY;
|
|
127
|
+
const yellow = useColors ? Colors.YELLOW : '';
|
|
128
|
+
const reset = useColors ? Colors.RESET : '';
|
|
129
|
+
console.error(`${yellow}⚠️ Command "${command}" not yet implemented${reset}`);
|
|
130
|
+
console.error(`\nAvailable commands:`);
|
|
131
|
+
console.error(` • setup - Create deployment identity (IMPLEMENTED)`);
|
|
132
|
+
console.error(`\nComing soon: connect, invite, list, status, migrate, trial, deploy, server, revoke, backup, debug`);
|
|
133
|
+
process.exit(ExitCode.USER_ERROR);
|
|
134
|
+
}
|
|
135
|
+
default: {
|
|
136
|
+
const useColors = !values['no-color'] && process.stderr.isTTY;
|
|
137
|
+
const red = useColors ? Colors.RED : '';
|
|
138
|
+
const reset = useColors ? Colors.RESET : '';
|
|
139
|
+
console.error(`${red}❌ Error: Unknown command "${command}"${reset}`);
|
|
140
|
+
console.error(`\nRun "xbind --help" to see available commands.`);
|
|
141
|
+
process.exit(ExitCode.USER_ERROR);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Run main
|
|
146
|
+
main().catch((error) => {
|
|
147
|
+
console.error('Fatal error:', error instanceof Error ? error.message : String(error));
|
|
148
|
+
process.exit(ExitCode.SYSTEM_ERROR);
|
|
149
|
+
});
|
|
@@ -394,10 +394,9 @@ export async function identityFromSeed(seed, opts) {
|
|
|
394
394
|
let mlKemPublicKey;
|
|
395
395
|
let mlKemSecretKey;
|
|
396
396
|
try {
|
|
397
|
-
//
|
|
398
|
-
// Generate new random keypair instead (identityFromSeed will have non-deterministic PQ keys)
|
|
397
|
+
// Use deterministic key generation from 64-byte seed (FIPS 203 compliant)
|
|
399
398
|
const mlkem = new MlKem768();
|
|
400
|
-
const [publicKey, secretKey] = await mlkem.
|
|
399
|
+
const [publicKey, secretKey] = await mlkem.deriveKeyPair(mlKemBits);
|
|
401
400
|
mlKemPublicKey = publicKey;
|
|
402
401
|
mlKemSecretKey = secretKey;
|
|
403
402
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@private.me/xbind",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "Identity-based M2M authentication (Contains encryption - export restrictions apply)",
|
|
5
5
|
"license": "Proprietary",
|
|
6
6
|
"author": "Private.Me Contributors",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"./_deps/*": "./dist-standalone/_deps/*/index.js"
|
|
31
31
|
},
|
|
32
32
|
"bin": {
|
|
33
|
-
"xbind": "./dist-standalone/cli/
|
|
33
|
+
"xbind": "./dist-standalone/cli/xbind.js",
|
|
34
34
|
"xbind-init": "./dist-standalone/cli/init.js",
|
|
35
35
|
"xbind-onboard": "./dist-standalone/cli/init.js"
|
|
36
36
|
},
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"prepublishOnly": "node -e \"const pkg=require('./package.json');if(pkg.license!=='Proprietary'){console.error('❌ package.json license must be: Proprietary');process.exit(1)}\" && bash ../../scripts/gold-automation.sh $(pwd) && bash ../../scripts/hooks/prepublish-crypto-check.sh && bash ../../scripts/hooks/prepublish-tarball-validation.sh $(pwd)"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
+
"@private.me/xbind": "^1.3.0",
|
|
63
64
|
"bonjour-service": "^1.3.0",
|
|
64
65
|
"mlkem": "^2.7.0",
|
|
65
66
|
"nodemailer": "8.0.7"
|
package/share1.dat
CHANGED
|
Binary file
|