1id 0.1.0
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/LICENSE +190 -0
- package/README.md +151 -0
- package/dist/auth.d.ts +55 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +188 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +57 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +224 -0
- package/dist/client.js.map +1 -0
- package/dist/credentials.d.ts +84 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +155 -0
- package/dist/credentials.js.map +1 -0
- package/dist/enroll.d.ts +44 -0
- package/dist/enroll.d.ts.map +1 -0
- package/dist/enroll.js +226 -0
- package/dist/enroll.js.map +1 -0
- package/dist/exceptions.d.ts +109 -0
- package/dist/exceptions.d.ts.map +1 -0
- package/dist/exceptions.js +168 -0
- package/dist/exceptions.js.map +1 -0
- package/dist/helper.d.ts +57 -0
- package/dist/helper.d.ts.map +1 -0
- package/dist/helper.js +387 -0
- package/dist/helper.js.map +1 -0
- package/dist/identity.d.ts +106 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +76 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +124 -0
- package/dist/index.js.map +1 -0
- package/dist/keys.d.ts +56 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/keys.js +105 -0
- package/dist/keys.js.map +1 -0
- package/dist/test/test_declared_enrollment.d.ts +11 -0
- package/dist/test/test_declared_enrollment.d.ts.map +1 -0
- package/dist/test/test_declared_enrollment.js +256 -0
- package/dist/test/test_declared_enrollment.js.map +1 -0
- package/package.json +53 -0
package/dist/helper.js
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Go binary helper for the 1id.com Node.js SDK.
|
|
3
|
+
*
|
|
4
|
+
* Manages the oneid-enroll Go binary:
|
|
5
|
+
* - Locates the binary (cached or PATH)
|
|
6
|
+
* - Downloads it from GitHub releases if not present
|
|
7
|
+
* - Spawns it for HSM operations (detect, extract, activate, sign)
|
|
8
|
+
* - Parses JSON output
|
|
9
|
+
*
|
|
10
|
+
* The binary handles all platform-specific HSM operations:
|
|
11
|
+
* - TPM access (Windows TBS.dll, Linux /dev/tpm*)
|
|
12
|
+
* - YubiKey/PIV access (PCSC)
|
|
13
|
+
* - Privilege elevation (UAC, sudo, pkexec)
|
|
14
|
+
*/
|
|
15
|
+
import * as child_process from "node:child_process";
|
|
16
|
+
import * as crypto from "node:crypto";
|
|
17
|
+
import * as fs from "node:fs";
|
|
18
|
+
import * as https from "node:https";
|
|
19
|
+
import * as http from "node:http";
|
|
20
|
+
import * as os from "node:os";
|
|
21
|
+
import * as path from "node:path";
|
|
22
|
+
import { BinaryNotFoundError, HSMAccessError, NoHSMError, UACDeniedError, } from "./exceptions.js";
|
|
23
|
+
// -- GitHub release URL for auto-download --
|
|
24
|
+
const GITHUB_RELEASE_DOWNLOAD_URL_TEMPLATE = "https://github.com/AuraFriday/oneid-enroll/releases/latest/download/{binary_name}";
|
|
25
|
+
// -- Binary naming convention --
|
|
26
|
+
const BINARY_NAME_PREFIX = "oneid-enroll";
|
|
27
|
+
/**
|
|
28
|
+
* Return the platform-specific binary filename.
|
|
29
|
+
*/
|
|
30
|
+
function get_platform_binary_name() {
|
|
31
|
+
const system = os.platform();
|
|
32
|
+
let machine = os.arch();
|
|
33
|
+
// Normalize architecture names
|
|
34
|
+
if (machine === "x64") {
|
|
35
|
+
machine = "amd64";
|
|
36
|
+
}
|
|
37
|
+
else if (machine === "arm64") { /* already correct */ }
|
|
38
|
+
if (system === "win32") {
|
|
39
|
+
return `${BINARY_NAME_PREFIX}-windows-${machine}.exe`;
|
|
40
|
+
}
|
|
41
|
+
else if (system === "darwin") {
|
|
42
|
+
return `${BINARY_NAME_PREFIX}-darwin-${machine}`;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return `${BINARY_NAME_PREFIX}-linux-${machine}`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Return the directory where downloaded binaries are cached.
|
|
50
|
+
*/
|
|
51
|
+
function get_binary_cache_directory() {
|
|
52
|
+
if (os.platform() === "win32") {
|
|
53
|
+
const base = process.env["APPDATA"] ?? path.join(os.homedir(), "AppData", "Roaming");
|
|
54
|
+
return path.join(base, "oneid", "bin");
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return path.join(os.homedir(), ".local", "share", "oneid", "bin");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Check if a file exists and is executable.
|
|
62
|
+
*/
|
|
63
|
+
function file_exists_and_is_executable(file_path) {
|
|
64
|
+
try {
|
|
65
|
+
fs.accessSync(file_path, fs.constants.X_OK);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Locate the oneid-enroll binary.
|
|
74
|
+
*
|
|
75
|
+
* Search order:
|
|
76
|
+
* 1. Binary cache directory (~/.local/share/oneid/bin/ or %APPDATA%/oneid/bin/)
|
|
77
|
+
* 2. Current working directory
|
|
78
|
+
* 3. System PATH
|
|
79
|
+
*
|
|
80
|
+
* @returns Path to the binary if found, null otherwise.
|
|
81
|
+
*/
|
|
82
|
+
export function find_binary() {
|
|
83
|
+
const binary_name = get_platform_binary_name();
|
|
84
|
+
// 1. Check cache directory
|
|
85
|
+
const cache_dir = get_binary_cache_directory();
|
|
86
|
+
const cached_binary_path = path.join(cache_dir, binary_name);
|
|
87
|
+
if (file_exists_and_is_executable(cached_binary_path)) {
|
|
88
|
+
return cached_binary_path;
|
|
89
|
+
}
|
|
90
|
+
// 2. Check current working directory
|
|
91
|
+
const local_binary_path = path.join(process.cwd(), binary_name);
|
|
92
|
+
if (file_exists_and_is_executable(local_binary_path)) {
|
|
93
|
+
return local_binary_path;
|
|
94
|
+
}
|
|
95
|
+
// Also check generic name
|
|
96
|
+
const generic_name = os.platform() === "win32" ? `${BINARY_NAME_PREFIX}.exe` : BINARY_NAME_PREFIX;
|
|
97
|
+
const local_generic_path = path.join(process.cwd(), generic_name);
|
|
98
|
+
if (file_exists_and_is_executable(local_generic_path)) {
|
|
99
|
+
return local_generic_path;
|
|
100
|
+
}
|
|
101
|
+
// 3. Check PATH
|
|
102
|
+
const which_command = os.platform() === "win32" ? "where" : "which";
|
|
103
|
+
for (const name_to_search of [binary_name, generic_name]) {
|
|
104
|
+
try {
|
|
105
|
+
const result = child_process.execSync(`${which_command} ${name_to_search}`, {
|
|
106
|
+
encoding: "utf-8",
|
|
107
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
108
|
+
});
|
|
109
|
+
const found_path = result.trim().split("\n")[0]?.trim();
|
|
110
|
+
if (found_path && fs.existsSync(found_path)) {
|
|
111
|
+
return found_path;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
// Not found in PATH
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Download a file from a URL to a local path. Follows redirects (up to 5).
|
|
122
|
+
*/
|
|
123
|
+
function download_file_to_path(url, destination, max_redirects = 5) {
|
|
124
|
+
return new Promise((resolve, reject) => {
|
|
125
|
+
if (max_redirects <= 0) {
|
|
126
|
+
reject(new BinaryNotFoundError("Too many redirects while downloading binary"));
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const transport = url.startsWith("https:") ? https : http;
|
|
130
|
+
transport.get(url, { headers: { "User-Agent": "oneid-sdk-node/0.1.0" } }, (res) => {
|
|
131
|
+
// Handle redirects (GitHub releases redirect to S3)
|
|
132
|
+
if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
133
|
+
download_file_to_path(res.headers.location, destination, max_redirects - 1)
|
|
134
|
+
.then(resolve)
|
|
135
|
+
.catch(reject);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (res.statusCode !== 200) {
|
|
139
|
+
reject(new BinaryNotFoundError(`Failed to download from ${url}: HTTP ${res.statusCode}`));
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const file_stream = fs.createWriteStream(destination);
|
|
143
|
+
res.pipe(file_stream);
|
|
144
|
+
file_stream.on("finish", () => {
|
|
145
|
+
file_stream.close();
|
|
146
|
+
resolve();
|
|
147
|
+
});
|
|
148
|
+
file_stream.on("error", (err) => {
|
|
149
|
+
reject(new BinaryNotFoundError(`Failed to write binary to ${destination}: ${err.message}`));
|
|
150
|
+
});
|
|
151
|
+
}).on("error", (err) => {
|
|
152
|
+
reject(new BinaryNotFoundError(`Failed to download from ${url}: ${err.message}`));
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Download the content of a URL as a string. Follows redirects.
|
|
158
|
+
*/
|
|
159
|
+
function download_text_from_url(url, max_redirects = 5) {
|
|
160
|
+
return new Promise((resolve, reject) => {
|
|
161
|
+
if (max_redirects <= 0) {
|
|
162
|
+
reject(new Error("Too many redirects"));
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const transport = url.startsWith("https:") ? https : http;
|
|
166
|
+
transport.get(url, { headers: { "User-Agent": "oneid-sdk-node/0.1.0" } }, (res) => {
|
|
167
|
+
if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
168
|
+
download_text_from_url(res.headers.location, max_redirects - 1)
|
|
169
|
+
.then(resolve)
|
|
170
|
+
.catch(reject);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (res.statusCode !== 200) {
|
|
174
|
+
reject(new Error(`HTTP ${res.statusCode}`));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const chunks = [];
|
|
178
|
+
res.on("data", (chunk) => { chunks.push(chunk); });
|
|
179
|
+
res.on("end", () => { resolve(Buffer.concat(chunks).toString("utf-8")); });
|
|
180
|
+
}).on("error", reject);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Download the oneid-enroll binary from the GitHub 'latest' release.
|
|
185
|
+
*
|
|
186
|
+
* Downloads to a temporary file first, verifies the SHA-256 checksum,
|
|
187
|
+
* then moves to the final location.
|
|
188
|
+
*/
|
|
189
|
+
async function download_binary_from_github_release(binary_name, destination_path) {
|
|
190
|
+
const binary_download_url = GITHUB_RELEASE_DOWNLOAD_URL_TEMPLATE.replace("{binary_name}", binary_name);
|
|
191
|
+
const checksum_download_url = GITHUB_RELEASE_DOWNLOAD_URL_TEMPLATE.replace("{binary_name}", binary_name + ".sha256");
|
|
192
|
+
const destination_dir = path.dirname(destination_path);
|
|
193
|
+
fs.mkdirSync(destination_dir, { recursive: true });
|
|
194
|
+
// Use a temp file for atomic download
|
|
195
|
+
const temp_file_path = path.join(destination_dir, `oneid-enroll-download-${Date.now()}.tmp`);
|
|
196
|
+
try {
|
|
197
|
+
// Step 1: Download binary
|
|
198
|
+
await download_file_to_path(binary_download_url, temp_file_path);
|
|
199
|
+
const downloaded_size = fs.statSync(temp_file_path).size;
|
|
200
|
+
if (downloaded_size < 100_000) {
|
|
201
|
+
throw new BinaryNotFoundError(`Downloaded binary is suspiciously small (${downloaded_size} bytes). ` +
|
|
202
|
+
"The download URL may be incorrect or the release may be empty.");
|
|
203
|
+
}
|
|
204
|
+
// Step 2: Verify SHA-256 checksum
|
|
205
|
+
try {
|
|
206
|
+
const checksum_text = await download_text_from_url(checksum_download_url);
|
|
207
|
+
const expected_sha256_hash = checksum_text.trim().split(/\s+/)[0]?.toLowerCase();
|
|
208
|
+
const file_buffer = fs.readFileSync(temp_file_path);
|
|
209
|
+
const actual_sha256_hash = crypto.createHash("sha256").update(file_buffer).digest("hex").toLowerCase();
|
|
210
|
+
if (actual_sha256_hash !== expected_sha256_hash) {
|
|
211
|
+
throw new BinaryNotFoundError(`SHA-256 checksum mismatch for ${binary_name}. ` +
|
|
212
|
+
`Expected: ${expected_sha256_hash}, got: ${actual_sha256_hash}. ` +
|
|
213
|
+
"The binary may have been tampered with or the download was corrupted.");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
catch (checksum_error) {
|
|
217
|
+
if (checksum_error instanceof BinaryNotFoundError) {
|
|
218
|
+
throw checksum_error;
|
|
219
|
+
}
|
|
220
|
+
// Checksum download failed -- proceed without verification (warn)
|
|
221
|
+
console.warn(`[oneid] Could not download checksum file (${checksum_error}). ` +
|
|
222
|
+
"Proceeding without verification.");
|
|
223
|
+
}
|
|
224
|
+
// Step 3: Move temp file to final destination
|
|
225
|
+
if (fs.existsSync(destination_path)) {
|
|
226
|
+
fs.unlinkSync(destination_path);
|
|
227
|
+
}
|
|
228
|
+
fs.renameSync(temp_file_path, destination_path);
|
|
229
|
+
// Step 4: Set executable permission on non-Windows
|
|
230
|
+
if (os.platform() !== "win32") {
|
|
231
|
+
fs.chmodSync(destination_path, 0o755);
|
|
232
|
+
}
|
|
233
|
+
return destination_path;
|
|
234
|
+
}
|
|
235
|
+
finally {
|
|
236
|
+
// Clean up temp file on failure
|
|
237
|
+
try {
|
|
238
|
+
if (fs.existsSync(temp_file_path)) {
|
|
239
|
+
fs.unlinkSync(temp_file_path);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
catch { /* best effort */ }
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Ensure the oneid-enroll binary is available, downloading if needed.
|
|
247
|
+
*
|
|
248
|
+
* @returns Path to the available binary.
|
|
249
|
+
* @throws BinaryNotFoundError if the binary cannot be found or downloaded.
|
|
250
|
+
*/
|
|
251
|
+
export async function ensure_binary_available() {
|
|
252
|
+
const found_binary_path = find_binary();
|
|
253
|
+
if (found_binary_path != null) {
|
|
254
|
+
return found_binary_path;
|
|
255
|
+
}
|
|
256
|
+
// Binary not found locally -- attempt auto-download
|
|
257
|
+
const binary_name = get_platform_binary_name();
|
|
258
|
+
const cache_dir = get_binary_cache_directory();
|
|
259
|
+
const destination = path.join(cache_dir, binary_name);
|
|
260
|
+
try {
|
|
261
|
+
return await download_binary_from_github_release(binary_name, destination);
|
|
262
|
+
}
|
|
263
|
+
catch (download_error) {
|
|
264
|
+
throw new BinaryNotFoundError(`oneid-enroll binary not found in cache, current directory, or PATH, ` +
|
|
265
|
+
`and auto-download failed: ${download_error}. ` +
|
|
266
|
+
`Expected filename: ${binary_name}. ` +
|
|
267
|
+
`Manual download: https://github.com/AuraFriday/oneid-enroll/releases/latest`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Run an oneid-enroll subcommand and parse its JSON output.
|
|
272
|
+
*/
|
|
273
|
+
export async function run_binary_command(command, args, json_mode = true, timeout_milliseconds = 30_000) {
|
|
274
|
+
const binary_path = await ensure_binary_available();
|
|
275
|
+
const cmd_args = [command];
|
|
276
|
+
if (json_mode) {
|
|
277
|
+
cmd_args.push("--json");
|
|
278
|
+
}
|
|
279
|
+
if (args) {
|
|
280
|
+
cmd_args.push(...args);
|
|
281
|
+
}
|
|
282
|
+
return new Promise((resolve, reject) => {
|
|
283
|
+
let stdout_data = "";
|
|
284
|
+
let stderr_data = "";
|
|
285
|
+
const spawned_process = child_process.spawn(binary_path, cmd_args, {
|
|
286
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
287
|
+
timeout: timeout_milliseconds,
|
|
288
|
+
});
|
|
289
|
+
spawned_process.stdout?.on("data", (chunk) => { stdout_data += chunk.toString(); });
|
|
290
|
+
spawned_process.stderr?.on("data", (chunk) => { stderr_data += chunk.toString(); });
|
|
291
|
+
spawned_process.on("error", (err) => {
|
|
292
|
+
if (err.code === "ENOENT") {
|
|
293
|
+
reject(new BinaryNotFoundError(`Could not execute ${binary_path}: file not found`));
|
|
294
|
+
}
|
|
295
|
+
else if (err.code === "EACCES") {
|
|
296
|
+
reject(new BinaryNotFoundError(`Could not execute ${binary_path}: permission denied`));
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
reject(new HSMAccessError(`Error spawning ${binary_path}: ${err.message}`));
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
spawned_process.on("close", (exit_code) => {
|
|
303
|
+
let output;
|
|
304
|
+
if (json_mode && stdout_data.trim()) {
|
|
305
|
+
try {
|
|
306
|
+
output = JSON.parse(stdout_data.trim());
|
|
307
|
+
}
|
|
308
|
+
catch {
|
|
309
|
+
reject(new HSMAccessError(`oneid-enroll returned invalid JSON: ${stdout_data.slice(0, 500)}`));
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
output = { stdout: stdout_data, stderr: stderr_data, returncode: exit_code };
|
|
315
|
+
}
|
|
316
|
+
if (exit_code !== 0) {
|
|
317
|
+
const error_code = output.error_code ?? "UNKNOWN";
|
|
318
|
+
const error_message = output.error ?? (stderr_data.trim() || `Exit code ${exit_code}`);
|
|
319
|
+
if (error_code === "NO_HSM_FOUND" || /no.*hsm/i.test(error_message) || /no.*tpm/i.test(error_message)) {
|
|
320
|
+
reject(new NoHSMError(error_message));
|
|
321
|
+
}
|
|
322
|
+
else if (error_code === "UAC_DENIED" || /denied/i.test(error_message)) {
|
|
323
|
+
reject(new UACDeniedError(error_message));
|
|
324
|
+
}
|
|
325
|
+
else if (error_code === "HSM_ACCESS_ERROR") {
|
|
326
|
+
reject(new HSMAccessError(error_message));
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
reject(new HSMAccessError(`oneid-enroll '${command}' failed: ${error_message}`));
|
|
330
|
+
}
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
resolve(output);
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Detect available hardware security modules via the Go binary.
|
|
339
|
+
*
|
|
340
|
+
* Runs 'oneid-enroll detect --json' which does NOT require elevation.
|
|
341
|
+
*/
|
|
342
|
+
export async function detect_available_hsms() {
|
|
343
|
+
try {
|
|
344
|
+
const output = await run_binary_command("detect");
|
|
345
|
+
return output.hsms ?? [];
|
|
346
|
+
}
|
|
347
|
+
catch (error) {
|
|
348
|
+
if (error instanceof NoHSMError) {
|
|
349
|
+
return [];
|
|
350
|
+
}
|
|
351
|
+
if (error instanceof BinaryNotFoundError) {
|
|
352
|
+
throw error;
|
|
353
|
+
}
|
|
354
|
+
return [];
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Extract attestation data from an HSM (requires elevation).
|
|
359
|
+
*/
|
|
360
|
+
export async function extract_attestation_data(hsm) {
|
|
361
|
+
const hsm_type = hsm.type ?? "tpm";
|
|
362
|
+
return run_binary_command("extract", ["--type", hsm_type, "--elevated"]);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Decrypt a credential activation challenge via the HSM (requires elevation).
|
|
366
|
+
*/
|
|
367
|
+
export async function activate_credential(_hsm, credential_blob_b64, encrypted_secret_b64, ak_handle) {
|
|
368
|
+
const output = await run_binary_command("activate", [
|
|
369
|
+
"--credential-blob", credential_blob_b64,
|
|
370
|
+
"--encrypted-secret", encrypted_secret_b64,
|
|
371
|
+
"--ak-handle", ak_handle,
|
|
372
|
+
"--elevated",
|
|
373
|
+
]);
|
|
374
|
+
return output.decrypted_credential ?? "";
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Sign a challenge nonce using the TPM AK -- NO ELEVATION NEEDED.
|
|
378
|
+
*
|
|
379
|
+
* This is the core of ongoing TPM-backed authentication.
|
|
380
|
+
*/
|
|
381
|
+
export async function sign_challenge_with_tpm(nonce_b64, ak_handle) {
|
|
382
|
+
return run_binary_command("sign", [
|
|
383
|
+
"--nonce", nonce_b64,
|
|
384
|
+
"--ak-handle", ak_handle,
|
|
385
|
+
]);
|
|
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oBAA4B,EAC5B,SAAiB;IAEjB,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,UAAU,EAAE;QAClD,mBAAmB,EAAE,mBAAmB;QACxC,oBAAoB,EAAE,oBAAoB;QAC1C,aAAa,EAAE,SAAS;QACxB,YAAY;KACb,CAAC,CAAC;IACH,OAAQ,MAAM,CAAC,oBAA+B,IAAI,EAAE,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,SAAiB,EACjB,SAAiB;IAEjB,OAAO,kBAAkB,CAAC,MAAM,EAAE;QAChC,SAAS,EAAE,SAAS;QACpB,aAAa,EAAE,SAAS;KACzB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity and Token data models for the 1id.com Node.js SDK.
|
|
3
|
+
*
|
|
4
|
+
* These types represent the agent's enrolled identity and OAuth2 tokens.
|
|
5
|
+
* They are returned by enroll(), whoami(), and getToken() respectively.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Trust tiers assigned by 1id.com based on hardware attestation.
|
|
9
|
+
*
|
|
10
|
+
* Ordered from highest to lowest Sybil resistance:
|
|
11
|
+
* - sovereign: Non-portable hardware (TPM), manufacturer-attested, current cert
|
|
12
|
+
* - sovereign-portable: Portable hardware (YubiKey/Nitrokey), manufacturer-attested
|
|
13
|
+
* - legacy: Was sovereign/sovereign-portable, but manufacturer cert expired
|
|
14
|
+
* - virtual: Virtual TPM (VMware/Hyper-V), hypervisor-attested
|
|
15
|
+
* - enclave: Apple Secure Enclave, TOFU (no attestation PKI)
|
|
16
|
+
* - declared: Software-only, no hardware proof, self-asserted
|
|
17
|
+
*/
|
|
18
|
+
export declare enum TrustTier {
|
|
19
|
+
SOVEREIGN = "sovereign",
|
|
20
|
+
SOVEREIGN_PORTABLE = "sovereign-portable",
|
|
21
|
+
LEGACY = "legacy",
|
|
22
|
+
VIRTUAL = "virtual",
|
|
23
|
+
ENCLAVE = "enclave",
|
|
24
|
+
DECLARED = "declared"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Supported key algorithms for declared-tier software keys.
|
|
28
|
+
*/
|
|
29
|
+
export declare enum KeyAlgorithm {
|
|
30
|
+
ED25519 = "ed25519",
|
|
31
|
+
ECDSA_P256 = "ecdsa-p256",
|
|
32
|
+
ECDSA_P384 = "ecdsa-p384",
|
|
33
|
+
RSA_2048 = "rsa-2048",
|
|
34
|
+
RSA_4096 = "rsa-4096"
|
|
35
|
+
}
|
|
36
|
+
/** The default key algorithm for declared-tier enrollment. */
|
|
37
|
+
export declare const DEFAULT_KEY_ALGORITHM = KeyAlgorithm.ED25519;
|
|
38
|
+
/**
|
|
39
|
+
* Types of hardware security modules supported by 1id.com.
|
|
40
|
+
*/
|
|
41
|
+
export declare enum HSMType {
|
|
42
|
+
TPM = "tpm",
|
|
43
|
+
YUBIKEY = "yubikey",
|
|
44
|
+
NITROKEY = "nitrokey",
|
|
45
|
+
FEITIAN = "feitian",
|
|
46
|
+
SOLOKEYS = "solokeys",
|
|
47
|
+
SECURE_ENCLAVE = "secure_enclave",
|
|
48
|
+
SOFTWARE = "software"
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Represents an enrolled 1id.com agent identity.
|
|
52
|
+
*
|
|
53
|
+
* Returned by enroll() and whoami(). All fields are readonly.
|
|
54
|
+
*/
|
|
55
|
+
export interface Identity {
|
|
56
|
+
/** Permanent unique identifier (e.g., '1id_a7b3c9d2'). Never changes. */
|
|
57
|
+
readonly internal_id: string;
|
|
58
|
+
/** Display name (e.g., '@clawdia' or '@1id_a7b3c9d2'). */
|
|
59
|
+
readonly handle: string;
|
|
60
|
+
/** The trust level assigned based on hardware attestation. */
|
|
61
|
+
readonly trust_tier: TrustTier;
|
|
62
|
+
/** Type of HSM used for enrollment, or null for declared tier. */
|
|
63
|
+
readonly hsm_type: HSMType | null;
|
|
64
|
+
/** Manufacturer code (e.g., 'INTC', 'Yubico'), or null. */
|
|
65
|
+
readonly hsm_manufacturer: string | null;
|
|
66
|
+
/** When this identity was first created. */
|
|
67
|
+
readonly enrolled_at: Date;
|
|
68
|
+
/** Number of HSMs currently linked to this identity. */
|
|
69
|
+
readonly device_count: number;
|
|
70
|
+
/** The key algorithm used for this identity's signing key. */
|
|
71
|
+
readonly key_algorithm: KeyAlgorithm;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Represents an OAuth2 access token from 1id.com / Keycloak.
|
|
75
|
+
*
|
|
76
|
+
* Returned by getToken(). The accessToken is a signed JWT
|
|
77
|
+
* containing the agent's identity claims (sub, handle, trust_tier, etc.).
|
|
78
|
+
*/
|
|
79
|
+
export interface Token {
|
|
80
|
+
/** The JWT access token string (Bearer token). */
|
|
81
|
+
readonly access_token: string;
|
|
82
|
+
/** Always 'Bearer'. */
|
|
83
|
+
readonly token_type: string;
|
|
84
|
+
/** When this token expires (UTC). */
|
|
85
|
+
readonly expires_at: Date;
|
|
86
|
+
/** Refresh token for obtaining new access tokens, or null. */
|
|
87
|
+
readonly refresh_token: string | null;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Check whether a token is still valid based on its expiry time.
|
|
91
|
+
*
|
|
92
|
+
* Returns true if the token's expiry time is in the future.
|
|
93
|
+
* Does NOT verify the JWT signature or check revocation.
|
|
94
|
+
*/
|
|
95
|
+
export declare function this_token_has_not_yet_expired(token: Token): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Format a token for use in an HTTP Authorization header.
|
|
98
|
+
*
|
|
99
|
+
* Returns a string in the format 'Bearer <access_token>'.
|
|
100
|
+
*/
|
|
101
|
+
export declare function format_authorization_header_value(token: Token): string;
|
|
102
|
+
/**
|
|
103
|
+
* Format an Identity as a human-readable string.
|
|
104
|
+
*/
|
|
105
|
+
export declare function format_identity_as_display_string(identity: Identity): string;
|
|
106
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0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CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,uBAAuB;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAEtE;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE5E"}
|
package/dist/identity.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity and Token data models for the 1id.com Node.js SDK.
|
|
3
|
+
*
|
|
4
|
+
* These types represent the agent's enrolled identity and OAuth2 tokens.
|
|
5
|
+
* They are returned by enroll(), whoami(), and getToken() respectively.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Trust tiers assigned by 1id.com based on hardware attestation.
|
|
9
|
+
*
|
|
10
|
+
* Ordered from highest to lowest Sybil resistance:
|
|
11
|
+
* - sovereign: Non-portable hardware (TPM), manufacturer-attested, current cert
|
|
12
|
+
* - sovereign-portable: Portable hardware (YubiKey/Nitrokey), manufacturer-attested
|
|
13
|
+
* - legacy: Was sovereign/sovereign-portable, but manufacturer cert expired
|
|
14
|
+
* - virtual: Virtual TPM (VMware/Hyper-V), hypervisor-attested
|
|
15
|
+
* - enclave: Apple Secure Enclave, TOFU (no attestation PKI)
|
|
16
|
+
* - declared: Software-only, no hardware proof, self-asserted
|
|
17
|
+
*/
|
|
18
|
+
export var TrustTier;
|
|
19
|
+
(function (TrustTier) {
|
|
20
|
+
TrustTier["SOVEREIGN"] = "sovereign";
|
|
21
|
+
TrustTier["SOVEREIGN_PORTABLE"] = "sovereign-portable";
|
|
22
|
+
TrustTier["LEGACY"] = "legacy";
|
|
23
|
+
TrustTier["VIRTUAL"] = "virtual";
|
|
24
|
+
TrustTier["ENCLAVE"] = "enclave";
|
|
25
|
+
TrustTier["DECLARED"] = "declared";
|
|
26
|
+
})(TrustTier || (TrustTier = {}));
|
|
27
|
+
/**
|
|
28
|
+
* Supported key algorithms for declared-tier software keys.
|
|
29
|
+
*/
|
|
30
|
+
export var KeyAlgorithm;
|
|
31
|
+
(function (KeyAlgorithm) {
|
|
32
|
+
KeyAlgorithm["ED25519"] = "ed25519";
|
|
33
|
+
KeyAlgorithm["ECDSA_P256"] = "ecdsa-p256";
|
|
34
|
+
KeyAlgorithm["ECDSA_P384"] = "ecdsa-p384";
|
|
35
|
+
KeyAlgorithm["RSA_2048"] = "rsa-2048";
|
|
36
|
+
KeyAlgorithm["RSA_4096"] = "rsa-4096";
|
|
37
|
+
})(KeyAlgorithm || (KeyAlgorithm = {}));
|
|
38
|
+
/** The default key algorithm for declared-tier enrollment. */
|
|
39
|
+
export const DEFAULT_KEY_ALGORITHM = KeyAlgorithm.ED25519;
|
|
40
|
+
/**
|
|
41
|
+
* Types of hardware security modules supported by 1id.com.
|
|
42
|
+
*/
|
|
43
|
+
export var HSMType;
|
|
44
|
+
(function (HSMType) {
|
|
45
|
+
HSMType["TPM"] = "tpm";
|
|
46
|
+
HSMType["YUBIKEY"] = "yubikey";
|
|
47
|
+
HSMType["NITROKEY"] = "nitrokey";
|
|
48
|
+
HSMType["FEITIAN"] = "feitian";
|
|
49
|
+
HSMType["SOLOKEYS"] = "solokeys";
|
|
50
|
+
HSMType["SECURE_ENCLAVE"] = "secure_enclave";
|
|
51
|
+
HSMType["SOFTWARE"] = "software";
|
|
52
|
+
})(HSMType || (HSMType = {}));
|
|
53
|
+
/**
|
|
54
|
+
* Check whether a token is still valid based on its expiry time.
|
|
55
|
+
*
|
|
56
|
+
* Returns true if the token's expiry time is in the future.
|
|
57
|
+
* Does NOT verify the JWT signature or check revocation.
|
|
58
|
+
*/
|
|
59
|
+
export function this_token_has_not_yet_expired(token) {
|
|
60
|
+
return new Date() < token.expires_at;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Format a token for use in an HTTP Authorization header.
|
|
64
|
+
*
|
|
65
|
+
* Returns a string in the format 'Bearer <access_token>'.
|
|
66
|
+
*/
|
|
67
|
+
export function format_authorization_header_value(token) {
|
|
68
|
+
return `${token.token_type} ${token.access_token}`;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Format an Identity as a human-readable string.
|
|
72
|
+
*/
|
|
73
|
+
export function format_identity_as_display_string(identity) {
|
|
74
|
+
return `${identity.handle} (tier: ${identity.trust_tier}, id: ${identity.internal_id})`;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,sDAAyC,CAAA;IACzC,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,gCAAmB,CAAA;IACnB,kCAAqB,CAAA;AACvB,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,yCAAyB,CAAA;IACzB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;AACvB,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB;AAED,8DAA8D;AAC9D,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC,OAAO,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAN,IAAY,OAQX;AARD,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,8BAAmB,CAAA;IACnB,gCAAqB,CAAA;IACrB,8BAAmB,CAAA;IACnB,gCAAqB,CAAA;IACrB,4CAAiC,CAAA;IACjC,gCAAqB,CAAA;AACvB,CAAC,EARW,OAAO,KAAP,OAAO,QAQlB;AA2CD;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,KAAY;IACzD,OAAO,IAAI,IAAI,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,KAAY;IAC5D,OAAO,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iCAAiC,CAAC,QAAkB;IAClE,OAAO,GAAG,QAAQ,CAAC,MAAM,WAAW,QAAQ,CAAC,UAAU,SAAS,QAAQ,CAAC,WAAW,GAAG,CAAC;AAC1F,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 1id.com SDK -- Hardware-anchored identity for AI agents.
|
|
3
|
+
*
|
|
4
|
+
* Quick start:
|
|
5
|
+
*
|
|
6
|
+
* import oneid from "1id";
|
|
7
|
+
*
|
|
8
|
+
* // Enroll at declared tier (no HSM, always works)
|
|
9
|
+
* const identity = await oneid.enroll({ request_tier: "declared" });
|
|
10
|
+
* console.log(`Enrolled as ${identity.handle}`);
|
|
11
|
+
*
|
|
12
|
+
* // Get an OAuth2 token for authentication
|
|
13
|
+
* const token = await oneid.getToken();
|
|
14
|
+
* console.log(`Bearer ${token.access_token}`);
|
|
15
|
+
*
|
|
16
|
+
* // Check current identity
|
|
17
|
+
* const me = oneid.whoami();
|
|
18
|
+
*
|
|
19
|
+
* Trust tiers (request_tier parameter):
|
|
20
|
+
* 'sovereign' -- TPM hardware, manufacturer-attested
|
|
21
|
+
* 'sovereign-portable' -- YubiKey/Nitrokey, manufacturer-attested
|
|
22
|
+
* 'declared' -- Software keys, no hardware proof
|
|
23
|
+
*
|
|
24
|
+
* CRITICAL: request_tier is a REQUIREMENT, not a preference.
|
|
25
|
+
* You get exactly what you ask for, or an exception. No fallbacks.
|
|
26
|
+
*/
|
|
27
|
+
import { clear_cached_token, get_token, authenticate_with_tpm } from "./auth.js";
|
|
28
|
+
import { credentials_exist } from "./credentials.js";
|
|
29
|
+
import { enroll, type EnrollOptions } from "./enroll.js";
|
|
30
|
+
import { sign_challenge_with_private_key } from "./keys.js";
|
|
31
|
+
import { DEFAULT_KEY_ALGORITHM, HSMType, type Identity, KeyAlgorithm, type Token, TrustTier, this_token_has_not_yet_expired, format_authorization_header_value, format_identity_as_display_string } from "./identity.js";
|
|
32
|
+
export { OneIDError, EnrollmentError, NoHSMError, UACDeniedError, HSMAccessError, AlreadyEnrolledError, HandleTakenError, HandleInvalidError, HandleRetiredError, AuthenticationError, NetworkError, NotEnrolledError, BinaryNotFoundError, RateLimitExceededError, } from "./exceptions.js";
|
|
33
|
+
export { TrustTier, KeyAlgorithm, HSMType, DEFAULT_KEY_ALGORITHM, type Identity, type Token, type EnrollOptions, this_token_has_not_yet_expired, format_authorization_header_value, format_identity_as_display_string, };
|
|
34
|
+
export { enroll, get_token as getToken, get_token, clear_cached_token, authenticate_with_tpm, credentials_exist, sign_challenge_with_private_key, };
|
|
35
|
+
/** SDK version string. */
|
|
36
|
+
export declare const VERSION = "0.1.0";
|
|
37
|
+
/**
|
|
38
|
+
* Check the current enrolled identity.
|
|
39
|
+
*
|
|
40
|
+
* Reads the local credentials file and returns the identity information
|
|
41
|
+
* stored during enrollment. Does NOT make a network request.
|
|
42
|
+
*
|
|
43
|
+
* @throws NotEnrolledError if no credentials exist.
|
|
44
|
+
*/
|
|
45
|
+
export declare function whoami(): Identity;
|
|
46
|
+
/**
|
|
47
|
+
* Force-refresh the cached OAuth2 token.
|
|
48
|
+
*
|
|
49
|
+
* Discards the in-memory cached token and fetches a new one
|
|
50
|
+
* on the next getToken() call.
|
|
51
|
+
*/
|
|
52
|
+
export declare function refresh(): void;
|
|
53
|
+
declare const oneid: {
|
|
54
|
+
enroll: typeof enroll;
|
|
55
|
+
getToken: typeof get_token;
|
|
56
|
+
get_token: typeof get_token;
|
|
57
|
+
whoami: typeof whoami;
|
|
58
|
+
refresh: typeof refresh;
|
|
59
|
+
credentials_exist: typeof credentials_exist;
|
|
60
|
+
authenticate_with_tpm: typeof authenticate_with_tpm;
|
|
61
|
+
sign_challenge_with_private_key: typeof sign_challenge_with_private_key;
|
|
62
|
+
clear_cached_token: typeof clear_cached_token;
|
|
63
|
+
VERSION: string;
|
|
64
|
+
TrustTier: typeof TrustTier;
|
|
65
|
+
KeyAlgorithm: typeof KeyAlgorithm;
|
|
66
|
+
HSMType: typeof HSMType;
|
|
67
|
+
DEFAULT_KEY_ALGORITHM: KeyAlgorithm;
|
|
68
|
+
};
|
|
69
|
+
export default oneid;
|
|
70
|
+
//# sourceMappingURL=index.d.ts.map
|