@secretstore/cli 0.10.0 → 0.13.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/dist/secretstore.js +81 -52
- package/package.json +10 -6
package/dist/secretstore.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// secretstore 0.
|
|
3
|
-
// apps/cli/src/runtime.ts
|
|
2
|
+
// secretstore 0.13.0: readable bundle of apps/cli for Node.js 20+. Proprietary: see LICENSE and https://secretstore.sh/terms-and-conditions.
|
|
3
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/runtime.ts
|
|
4
4
|
import { spawn as nodeSpawn } from "node:child_process";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { open } from "node:fs/promises";
|
|
@@ -94,7 +94,7 @@ async function fileWriter(path) {
|
|
|
94
94
|
return { write: (chunk) => handle.write(chunk), end: () => handle.close() };
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
// apps/cli/src/browser.ts
|
|
97
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/browser.ts
|
|
98
98
|
async function openInBrowser(url) {
|
|
99
99
|
if (!/^https?:\/\//.test(url))
|
|
100
100
|
throw new Error("not an http(s) URL");
|
|
@@ -104,11 +104,11 @@ async function openInBrowser(url) {
|
|
|
104
104
|
throw new Error(`${argv[0]} exited with ${code}`);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
// apps/cli/src/config.ts
|
|
107
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/config.ts
|
|
108
108
|
import { existsSync, readFileSync } from "node:fs";
|
|
109
109
|
import { dirname, join } from "node:path";
|
|
110
110
|
|
|
111
|
-
// apps/cli/src/errors.ts
|
|
111
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/errors.ts
|
|
112
112
|
var EXIT = { error: 1, usage: 2, auth: 3, notFound: 4, denied: 4, approval: 5, cannotRun: 127 };
|
|
113
113
|
|
|
114
114
|
class CliError extends Error {
|
|
@@ -128,12 +128,12 @@ function classify(message) {
|
|
|
128
128
|
return EXIT.error;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
// apps/cli/src/is-record.ts
|
|
131
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/is-record.ts
|
|
132
132
|
function isRecord(value) {
|
|
133
133
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
// apps/cli/src/mcp.ts
|
|
136
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/mcp.ts
|
|
137
137
|
var TOOLS = {
|
|
138
138
|
whoami: "whoami",
|
|
139
139
|
listProjects: "list_projects",
|
|
@@ -260,13 +260,42 @@ async function allProjects(client) {
|
|
|
260
260
|
return rows;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
// apps/cli/src/config.ts
|
|
263
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/config.ts
|
|
264
264
|
var DEFAULT_URL = "https://secretstore.sh";
|
|
265
265
|
var PIN_FILE = ".secret-store.json";
|
|
266
266
|
var LOOPBACK = new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
267
|
-
function resolveUrl(flag, env) {
|
|
267
|
+
function resolveUrl(flag, env, cwd) {
|
|
268
|
+
if (!flag && env.SECRET_STORE_URL && cwd && process.versions.bun) {
|
|
269
|
+
const file = dotenvNaming("SECRET_STORE_URL", env.SECRET_STORE_URL, cwd);
|
|
270
|
+
if (file)
|
|
271
|
+
throw new CliError(`SECRET_STORE_URL is set in ${file}, which this command does not trust (a cloned repository could redirect your credentials). Remove it from the file, or pass --url.`, EXIT.usage);
|
|
272
|
+
}
|
|
268
273
|
return secureOrigin(flag || env.SECRET_STORE_URL || DEFAULT_URL);
|
|
269
274
|
}
|
|
275
|
+
var DOTENV_FILES = [".env", ".env.local", ".env.development", ".env.development.local", ".env.production", ".env.production.local"];
|
|
276
|
+
function dotenvNaming(name, value, cwd) {
|
|
277
|
+
for (const file of DOTENV_FILES) {
|
|
278
|
+
const path = join(cwd, file);
|
|
279
|
+
if (!existsSync(path))
|
|
280
|
+
continue;
|
|
281
|
+
let text;
|
|
282
|
+
try {
|
|
283
|
+
text = readFileSync(path, "utf8");
|
|
284
|
+
} catch {
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
for (const line of text.split(/\r?\n/)) {
|
|
288
|
+
const match = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*?)\s*$/.exec(line);
|
|
289
|
+
if (!match || match[1] !== name)
|
|
290
|
+
continue;
|
|
291
|
+
const raw = match[2] ?? "";
|
|
292
|
+
const unquoted = /^(["'`])(.*)\1\s*(?:#.*)?$/.exec(raw)?.[2] ?? raw.replace(/\s+#.*$/, "");
|
|
293
|
+
if (unquoted === value)
|
|
294
|
+
return file;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
270
299
|
function secureOrigin(raw) {
|
|
271
300
|
let url;
|
|
272
301
|
try {
|
|
@@ -350,10 +379,10 @@ async function readTarget(ctx, args, need) {
|
|
|
350
379
|
confirmPinned(ctx, target.source, `${target.project}/${target.environment}`, "Read");
|
|
351
380
|
return target;
|
|
352
381
|
}
|
|
353
|
-
// apps/cli/package.json
|
|
382
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/package.json
|
|
354
383
|
var package_default = {
|
|
355
384
|
name: "cli",
|
|
356
|
-
version: "0.
|
|
385
|
+
version: "0.13.0",
|
|
357
386
|
private: true,
|
|
358
387
|
license: "SEE LICENSE IN LICENSE",
|
|
359
388
|
type: "module",
|
|
@@ -375,7 +404,7 @@ var package_default = {
|
|
|
375
404
|
}
|
|
376
405
|
};
|
|
377
406
|
|
|
378
|
-
// apps/cli/src/args.ts
|
|
407
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/args.ts
|
|
379
408
|
var VALUE_FLAGS = ["url", "token", "out", "format", "kind", "scopes", "keys", "reason", "duration", "status"];
|
|
380
409
|
var SWITCHES = {
|
|
381
410
|
json: "json",
|
|
@@ -429,7 +458,7 @@ function parseArgs(argv) {
|
|
|
429
458
|
return { command, args, rest, flags };
|
|
430
459
|
}
|
|
431
460
|
|
|
432
|
-
// apps/cli/src/help.ts
|
|
461
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/help.ts
|
|
433
462
|
var USAGE = {
|
|
434
463
|
login: "secretstore login [--url <origin>] [--write] [--no-browser]",
|
|
435
464
|
logout: "secretstore logout",
|
|
@@ -498,7 +527,7 @@ read it from stdin.
|
|
|
498
527
|
Exit codes: 0 ok, 1 error, 2 usage, 3 auth, 4 not found (or sign-in denied), 5 needs approval (protected or sealed item), 127 run could not start the command
|
|
499
528
|
`;
|
|
500
529
|
|
|
501
|
-
// apps/cli/src/commands/access.ts
|
|
530
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/access.ts
|
|
502
531
|
var POLL_MS = 2000;
|
|
503
532
|
var DURATIONS = ["once", "15m", "1h", "8h"];
|
|
504
533
|
var DEFAULT_REASON = "Requested from the secretstore CLI";
|
|
@@ -600,13 +629,13 @@ Run again with --request-access to ask for it and wait for the answer.`, error.c
|
|
|
600
629
|
}
|
|
601
630
|
}
|
|
602
631
|
|
|
603
|
-
// packages/auth/src/first-party.ts
|
|
632
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/packages/auth/src/first-party.ts
|
|
604
633
|
var CLI_CLIENT_PATH = "/.well-known/oauth-client/cli.json";
|
|
605
634
|
function cliClientId(origin) {
|
|
606
635
|
return origin + CLI_CLIENT_PATH;
|
|
607
636
|
}
|
|
608
637
|
|
|
609
|
-
// apps/cli/src/dpop.ts
|
|
638
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/dpop.ts
|
|
610
639
|
var ES256 = { name: "ECDSA", namedCurve: "P-256" };
|
|
611
640
|
var base64url = (data) => Buffer.from(typeof data === "string" ? data : new Uint8Array(data)).toString("base64url");
|
|
612
641
|
var sha2562 = async (text) => new Uint8Array(await crypto.subtle.digest("SHA-256", Buffer.from(text)));
|
|
@@ -631,7 +660,7 @@ async function dpopProof(key, request) {
|
|
|
631
660
|
return `${input}.${base64url(signature)}`;
|
|
632
661
|
}
|
|
633
662
|
|
|
634
|
-
// apps/cli/src/oauth.ts
|
|
663
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/oauth.ts
|
|
635
664
|
class OAuthError extends CliError {
|
|
636
665
|
oauthCode;
|
|
637
666
|
constructor(oauthCode, message, code) {
|
|
@@ -759,7 +788,7 @@ async function revokeToken(login, fetcher = fetch) {
|
|
|
759
788
|
throw refusal(response.status, await response.text());
|
|
760
789
|
}
|
|
761
790
|
|
|
762
|
-
// apps/cli/src/callback.ts
|
|
791
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/callback.ts
|
|
763
792
|
var PAGE = '<!doctype html><meta charset="utf-8"><title>Secret Store CLI</title><p>You can close this tab and return to the terminal.</p>';
|
|
764
793
|
function refusal2(error, description) {
|
|
765
794
|
if (error === "access_denied")
|
|
@@ -804,7 +833,7 @@ async function listenForCallback(state, timeoutMs) {
|
|
|
804
833
|
return { port: server.port, code, close: () => stop(true) };
|
|
805
834
|
}
|
|
806
835
|
|
|
807
|
-
// apps/cli/src/keystore.ts
|
|
836
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/keystore.ts
|
|
808
837
|
import { mkdirSync, readFileSync as readFileSync2, renameSync, writeFileSync } from "node:fs";
|
|
809
838
|
import { homedir } from "node:os";
|
|
810
839
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
@@ -932,7 +961,7 @@ function openKeystore(env, warn, secrets2 = secrets ?? null) {
|
|
|
932
961
|
};
|
|
933
962
|
}
|
|
934
963
|
|
|
935
|
-
// apps/cli/src/commands/auth.ts
|
|
964
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/auth.ts
|
|
936
965
|
var LOGIN_TIMEOUT_MS = 5 * 60000;
|
|
937
966
|
var READ_SCOPES = ["projects:read", "secrets:read"];
|
|
938
967
|
var reason = (error) => error instanceof Error ? error.message : String(error);
|
|
@@ -940,7 +969,7 @@ var login = async ({ args, flags, io }) => {
|
|
|
940
969
|
if (args.length > 0)
|
|
941
970
|
throw usage("login");
|
|
942
971
|
const store = openKeystore(io.env, io.stderr);
|
|
943
|
-
const name = resolveUrl(flags.url, io.env);
|
|
972
|
+
const name = resolveUrl(flags.url, io.env, io.cwd);
|
|
944
973
|
const meta = await discover(name);
|
|
945
974
|
const { verifier, challenge } = await pkce();
|
|
946
975
|
const state = randomState();
|
|
@@ -1006,7 +1035,7 @@ var logout = async ({ args, flags, io }) => {
|
|
|
1006
1035
|
if (args.length > 0)
|
|
1007
1036
|
throw usage("logout");
|
|
1008
1037
|
const store = openKeystore(io.env, io.stderr);
|
|
1009
|
-
const name = resolveUrl(flags.url, io.env);
|
|
1038
|
+
const name = resolveUrl(flags.url, io.env, io.cwd);
|
|
1010
1039
|
const stored = await store.get(name);
|
|
1011
1040
|
if (!stored) {
|
|
1012
1041
|
io.stdout(`Not signed in to ${name}.
|
|
@@ -1051,7 +1080,7 @@ var keystoreSelftest = async ({ io }) => {
|
|
|
1051
1080
|
`);
|
|
1052
1081
|
};
|
|
1053
1082
|
|
|
1054
|
-
// apps/cli/src/commands/completion.ts
|
|
1083
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/completion.ts
|
|
1055
1084
|
var byCommand = () => Object.entries(USAGE).map(([name, line]) => [name, [...new Set([...line.match(/--[a-z][a-z-]*/g) ?? [], ...GLOBAL_FLAGS])]]);
|
|
1056
1085
|
var bash = (commands) => `# bash completion for secretstore. In ~/.bashrc: source <(secretstore completion bash)
|
|
1057
1086
|
_secretstore() {
|
|
@@ -1110,11 +1139,11 @@ var completion = async ({ args, io }) => {
|
|
|
1110
1139
|
io.stdout(script(byCommand()));
|
|
1111
1140
|
};
|
|
1112
1141
|
|
|
1113
|
-
// apps/cli/src/commands/doctor.ts
|
|
1142
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/doctor.ts
|
|
1114
1143
|
var SKEW_WARN_MS = 30000;
|
|
1115
1144
|
var LOGIN_HINT = 'Run "secretstore login", or export SECRET_STORE_TOKEN for a personal token.';
|
|
1116
1145
|
var doctor = async ({ io, flags, client }) => {
|
|
1117
|
-
const origin = resolveUrl(flags.url, io.env);
|
|
1146
|
+
const origin = resolveUrl(flags.url, io.env, io.cwd);
|
|
1118
1147
|
const results = [];
|
|
1119
1148
|
const check = async (name, hint, test) => {
|
|
1120
1149
|
try {
|
|
@@ -1187,13 +1216,13 @@ var doctor = async ({ io, flags, client }) => {
|
|
|
1187
1216
|
return results.some((r) => r.status === "fail") ? EXIT.error : 0;
|
|
1188
1217
|
};
|
|
1189
1218
|
|
|
1190
|
-
// apps/cli/src/commands/env.ts
|
|
1219
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/env.ts
|
|
1191
1220
|
import { randomUUID } from "node:crypto";
|
|
1192
1221
|
import { chmodSync, lstatSync, renameSync as renameSync2, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
1193
1222
|
import { constants } from "node:os";
|
|
1194
1223
|
import { resolve } from "node:path";
|
|
1195
1224
|
|
|
1196
|
-
// apps/cli/src/format.ts
|
|
1225
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/format.ts
|
|
1197
1226
|
var KEY = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
1198
1227
|
var BARE = /^[A-Za-z0-9_./:@+=,-]+$/;
|
|
1199
1228
|
function assertKeys(env) {
|
|
@@ -1230,7 +1259,7 @@ function table(header, rows) {
|
|
|
1230
1259
|
}
|
|
1231
1260
|
var red = (text, on) => on ? `\x1B[31m${text}\x1B[0m` : text;
|
|
1232
1261
|
|
|
1233
|
-
// apps/cli/src/commands/env.ts
|
|
1262
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/env.ts
|
|
1234
1263
|
var signalNumber = (signal) => {
|
|
1235
1264
|
const signals = constants.signals;
|
|
1236
1265
|
return (typeof signal === "string" ? signals[signal] : undefined) ?? 0;
|
|
@@ -1242,7 +1271,7 @@ function requireTty({ io, flags }) {
|
|
|
1242
1271
|
throw new CliError('Refusing to print secrets to a pipe or file because an agent or a log can read it; pass --allow-non-tty if you mean it (or use "run" or "pull").', EXIT.usage);
|
|
1243
1272
|
}
|
|
1244
1273
|
}
|
|
1245
|
-
var OVERRIDES = /^(PATH|PATHEXT|COMSPEC|SYSTEMROOT|NODE_OPTIONS|NODE_PATH|SHELLOPTS|BASH_ENV|ENV|PERL5OPT|PERL5LIB|RUBYOPT|RUBYLIB|PROMPT_COMMAND|NODE_EXTRA_CA_CERTS|NODE_TLS_REJECT_UNAUTHORIZED|AWS_CA_BUNDLE|GCONV_PATH|CLASSPATH|ZDOTDIR|GOPROXY|HOME|XDG_CONFIG_HOME|SSL_CERT_FILE|SSL_CERT_DIR|REQUESTS_CA_BUNDLE|CURL_CA_BUNDLE|HTTP_PROXY|HTTPS_PROXY|ALL_PROXY|NO_PROXY|JAVA_TOOL_OPTIONS|_JAVA_OPTIONS|DOTNET_STARTUP_HOOKS|LESSOPEN|LESSCLOSE|PAGER|MANPAGER|EDITOR|VISUAL|BROWSER|ERL_AFLAGS|ERL_FLAGS|ERL_ZFLAGS|ELIXIR_ERL_OPTIONS|JDK_JAVA_OPTIONS|RUSTC.*|PSMODULEPATH|PHPRC|PHP_INI_SCAN_DIR|GOTOOLCHAIN|GOFLAGS|PS4|PYTHON.*|(LD|DYLD|BUN|GIT|SSH|NPM_CONFIG|CARGO|YARN|PIP|LUA|GEM)_.*|.*_PRELOAD)$/i;
|
|
1274
|
+
var OVERRIDES = /^(PATH|PATHEXT|COMSPEC|SYSTEMROOT|NODE_OPTIONS|NODE_PATH|SHELLOPTS|BASH_ENV|ENV|PERL5OPT|PERL5LIB|RUBYOPT|RUBYLIB|PROMPT_COMMAND|NODE_EXTRA_CA_CERTS|NODE_TLS_REJECT_UNAUTHORIZED|AWS_CA_BUNDLE|GCONV_PATH|CLASSPATH|ZDOTDIR|GOPROXY|HOME|XDG_CONFIG_HOME|SSL_CERT_FILE|SSL_CERT_DIR|REQUESTS_CA_BUNDLE|CURL_CA_BUNDLE|HTTP_PROXY|HTTPS_PROXY|ALL_PROXY|NO_PROXY|JAVA_TOOL_OPTIONS|_JAVA_OPTIONS|DOTNET_STARTUP_HOOKS|LESSOPEN|LESSCLOSE|PAGER|MANPAGER|EDITOR|VISUAL|BROWSER|ERL_AFLAGS|ERL_FLAGS|ERL_ZFLAGS|ELIXIR_ERL_OPTIONS|JDK_JAVA_OPTIONS|RUSTC.*|COREPACK_.*|UV_.*|CORECLR_.*|COR_.*|MAKEFLAGS|(MAVEN|GRADLE|SBT|ANT)_OPTS|R_PROFILE_USER|R_ENVIRON_USER|R_LIBS.*|DOCKER_HOST|PSMODULEPATH|PHPRC|PHP_INI_SCAN_DIR|GOTOOLCHAIN|GOFLAGS|PS4|PYTHON.*|(LD|DYLD|BUN|GIT|SSH|NPM_CONFIG|CARGO|YARN|PIP|LUA|GEM)_.*|.*_PRELOAD)$/i;
|
|
1246
1275
|
var overridingKeys = (keys) => keys.filter((key) => OVERRIDES.test(key));
|
|
1247
1276
|
function fetchEnvironment(ctx, project, environment) {
|
|
1248
1277
|
return withAccess(ctx, { project, environment }, async () => {
|
|
@@ -1325,7 +1354,7 @@ var run = async (ctx) => {
|
|
|
1325
1354
|
return child.exitCode ?? 128 + signalNumber(child.signalCode);
|
|
1326
1355
|
};
|
|
1327
1356
|
|
|
1328
|
-
// apps/cli/src/commands/init.ts
|
|
1357
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/init.ts
|
|
1329
1358
|
import { writeFileSync as writeFileSync3 } from "node:fs";
|
|
1330
1359
|
import { join as join3 } from "node:path";
|
|
1331
1360
|
var init = async ({ args, client, flags, io }) => {
|
|
@@ -1373,11 +1402,11 @@ If you use "secretstore pull", add .env to your .gitignore (this command never e
|
|
|
1373
1402
|
`);
|
|
1374
1403
|
};
|
|
1375
1404
|
|
|
1376
|
-
// apps/cli/src/commands/push.ts
|
|
1405
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/push.ts
|
|
1377
1406
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
1378
1407
|
import { resolve as resolve2 } from "node:path";
|
|
1379
1408
|
|
|
1380
|
-
// apps/cli/src/dotenv.ts
|
|
1409
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/dotenv.ts
|
|
1381
1410
|
var CHUNK_BYTES = 200 * 1024;
|
|
1382
1411
|
var ENTRY = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=/;
|
|
1383
1412
|
function closingQuote(text, from, q) {
|
|
@@ -1437,7 +1466,7 @@ function chunkDotenv(text, max = CHUNK_BYTES) {
|
|
|
1437
1466
|
return chunks;
|
|
1438
1467
|
}
|
|
1439
1468
|
|
|
1440
|
-
// apps/cli/src/commands/push.ts
|
|
1469
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/push.ts
|
|
1441
1470
|
var NOT_DONE = [
|
|
1442
1471
|
["protected", "protected"],
|
|
1443
1472
|
["sealed", "sealed in the browser"],
|
|
@@ -1510,7 +1539,7 @@ var push = async (ctx) => {
|
|
|
1510
1539
|
return done === 0 && total.protected.length + total.sealed.length > 0 ? EXIT.approval : 0;
|
|
1511
1540
|
};
|
|
1512
1541
|
|
|
1513
|
-
// apps/cli/src/commands/read.ts
|
|
1542
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/read.ts
|
|
1514
1543
|
var pretty = (value) => JSON.stringify(value, null, 2) + `
|
|
1515
1544
|
`;
|
|
1516
1545
|
var whoami = async ({ args, client, io }) => {
|
|
@@ -1554,10 +1583,10 @@ var get = async (ctx) => {
|
|
|
1554
1583
|
`);
|
|
1555
1584
|
};
|
|
1556
1585
|
|
|
1557
|
-
// apps/cli/update-public-key.txt
|
|
1586
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/update-public-key.txt
|
|
1558
1587
|
var update_public_key_default = "TeXlgoyHl0XXy2h5JOw2o/DTRB97Dpw+TWtoyuXrGrQ=";
|
|
1559
1588
|
|
|
1560
|
-
// apps/cli/src/prompt.ts
|
|
1589
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/prompt.ts
|
|
1561
1590
|
import { readSync } from "node:fs";
|
|
1562
1591
|
function confirmOnStderr(question) {
|
|
1563
1592
|
process.stderr.write(`${question} [y/N] `);
|
|
@@ -1572,11 +1601,11 @@ function confirmOnStderr(question) {
|
|
|
1572
1601
|
return /^y(es)?$/i.test(line.trim());
|
|
1573
1602
|
}
|
|
1574
1603
|
|
|
1575
|
-
// apps/cli/src/update.ts
|
|
1604
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/update.ts
|
|
1576
1605
|
import { chmodSync as chmodSync2, readFileSync as readFileSync4, realpathSync, renameSync as renameSync3, rmSync as rmSync2 } from "node:fs";
|
|
1577
1606
|
import { basename, dirname as dirname3, join as join4 } from "node:path";
|
|
1578
1607
|
|
|
1579
|
-
// apps/web/src/lib/desktop-version.ts
|
|
1608
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/web/src/lib/desktop-version.ts
|
|
1580
1609
|
var VERSION = /^(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
|
|
1581
1610
|
function isVersion(value) {
|
|
1582
1611
|
return VERSION.test(value);
|
|
@@ -1617,14 +1646,14 @@ function compareVersions(a, b) {
|
|
|
1617
1646
|
return 0;
|
|
1618
1647
|
}
|
|
1619
1648
|
|
|
1620
|
-
// apps/cli/src/update-verify.ts
|
|
1649
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/update-verify.ts
|
|
1621
1650
|
var toHex = (bytes) => Buffer.from(bytes).toString("hex");
|
|
1622
1651
|
async function verifyDigest(publicKey, digest, signature) {
|
|
1623
1652
|
const key = await crypto.subtle.importKey("raw", Buffer.from(publicKey, "base64"), "Ed25519", false, ["verify"]);
|
|
1624
1653
|
return crypto.subtle.verify("Ed25519", key, Buffer.from(signature, "base64"), digest);
|
|
1625
1654
|
}
|
|
1626
1655
|
|
|
1627
|
-
// apps/cli/src/update.ts
|
|
1656
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/update.ts
|
|
1628
1657
|
var FEED_TIMEOUT_MS = 30000;
|
|
1629
1658
|
var CHECK_TIMEOUT_MS = 5000;
|
|
1630
1659
|
var DOWNLOAD_TIMEOUT_MS = 10 * 60000;
|
|
@@ -1756,7 +1785,7 @@ async function runUpdate({ io, flags, args }, deps) {
|
|
|
1756
1785
|
let error;
|
|
1757
1786
|
let origin = "";
|
|
1758
1787
|
try {
|
|
1759
|
-
origin = resolveUrl(flags.url, io.env);
|
|
1788
|
+
origin = resolveUrl(flags.url, io.env, io.cwd);
|
|
1760
1789
|
available = (await fetchRelease(origin, deps.fetcher, CHECK_TIMEOUT_MS))?.version ?? null;
|
|
1761
1790
|
updateAvailable = available !== null && compareVersions(available, deps.version) > 0;
|
|
1762
1791
|
} catch (e) {
|
|
@@ -1776,7 +1805,7 @@ Package-managed installation: update with bun add --global @secretstore/cli@${ta
|
|
|
1776
1805
|
throw new CliError("update replaces the installed binary; this is a development run", EXIT.usage);
|
|
1777
1806
|
if (!flags.check && !deps.publicKey)
|
|
1778
1807
|
throw new CliError("this build has no update key; build with apps/cli/update-public-key.txt set");
|
|
1779
|
-
const origin = resolveUrl(flags.url, io.env);
|
|
1808
|
+
const origin = resolveUrl(flags.url, io.env, io.cwd);
|
|
1780
1809
|
const say = (text) => {
|
|
1781
1810
|
if (!flags.json)
|
|
1782
1811
|
io.stdout(`${text}
|
|
@@ -1850,7 +1879,7 @@ ${release.notes}
|
|
|
1850
1879
|
return 0;
|
|
1851
1880
|
}
|
|
1852
1881
|
|
|
1853
|
-
// apps/cli/src/commands/update.ts
|
|
1882
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/update.ts
|
|
1854
1883
|
var update = (ctx) => runUpdate(ctx, {
|
|
1855
1884
|
version: package_default.version,
|
|
1856
1885
|
execPath: installedPath(),
|
|
@@ -1863,7 +1892,7 @@ var update = (ctx) => runUpdate(ctx, {
|
|
|
1863
1892
|
confirm: confirmOnStderr
|
|
1864
1893
|
});
|
|
1865
1894
|
|
|
1866
|
-
// apps/cli/src/commands/write.ts
|
|
1895
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/commands/write.ts
|
|
1867
1896
|
var set = async ({ args, client, flags, io }) => {
|
|
1868
1897
|
const { project, environment, rest } = targetFor({ io, flags }, args, { environment: true, need: 1, write: true });
|
|
1869
1898
|
const [key, given] = rest;
|
|
@@ -1893,7 +1922,7 @@ var del = async ({ args, client, flags, io }) => {
|
|
|
1893
1922
|
`);
|
|
1894
1923
|
};
|
|
1895
1924
|
|
|
1896
|
-
// apps/cli/src/session.ts
|
|
1925
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/session.ts
|
|
1897
1926
|
var REFRESH_MARGIN_MS = 60000;
|
|
1898
1927
|
var signIn = (reason) => new CliError(`${reason} Run "secretstore login" to sign in.`, EXIT.auth);
|
|
1899
1928
|
async function refreshLogin(store, name, stale, now, fetcher = fetch) {
|
|
@@ -1937,7 +1966,7 @@ function loginSession(store, name, login, now, fetcher) {
|
|
|
1937
1966
|
};
|
|
1938
1967
|
}
|
|
1939
1968
|
async function openSession(io, flags) {
|
|
1940
|
-
const origin = resolveUrl(flags.url, io.env);
|
|
1969
|
+
const origin = resolveUrl(flags.url, io.env, io.cwd);
|
|
1941
1970
|
const given = resolveToken(flags.token, io.env);
|
|
1942
1971
|
if (given)
|
|
1943
1972
|
return { via: given.via, endpoint: mcpEndpoint(origin), headers: async () => ({ authorization: `Bearer ${given.token}` }) };
|
|
@@ -1948,7 +1977,7 @@ async function openSession(io, flags) {
|
|
|
1948
1977
|
return loginSession(store, origin, login, io.now);
|
|
1949
1978
|
}
|
|
1950
1979
|
|
|
1951
|
-
// packages/telemetry/src/index.ts
|
|
1980
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/packages/telemetry/src/index.ts
|
|
1952
1981
|
var TIMEOUT_MS3 = 2000;
|
|
1953
1982
|
var QUIET_MS = 60000;
|
|
1954
1983
|
var MESSAGE_MAX = 200;
|
|
@@ -2050,17 +2079,17 @@ async function reportError(error, context, options = {}) {
|
|
|
2050
2079
|
}
|
|
2051
2080
|
}
|
|
2052
2081
|
|
|
2053
|
-
// apps/cli/src/telemetry.ts
|
|
2054
|
-
var CLI_SENTRY_DSN =
|
|
2082
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/telemetry.ts
|
|
2083
|
+
var CLI_SENTRY_DSN = undefined;
|
|
2055
2084
|
async function reportCliError(error, env, version, fetcher, dsn = CLI_SENTRY_DSN) {
|
|
2056
|
-
if (env.SECRETSTORE_TELEMETRY === "0" || !dsn)
|
|
2085
|
+
if (env.SECRETSTORE_TELEMETRY === "0" || env.DO_NOT_TRACK === "1" || !dsn)
|
|
2057
2086
|
return;
|
|
2058
2087
|
if (error instanceof Error && "code" in error && typeof error.code === "string" && !error.code.startsWith("ERR_"))
|
|
2059
2088
|
return;
|
|
2060
2089
|
await reportError(error, { area: "cli" }, { env: { SENTRY_DSN: dsn }, release: version, platform: "cli", environment: "production", ...fetcher ? { fetcher } : {} });
|
|
2061
2090
|
}
|
|
2062
2091
|
|
|
2063
|
-
// apps/cli/src/main.ts
|
|
2092
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/main.ts
|
|
2064
2093
|
var COMMANDS = {
|
|
2065
2094
|
login,
|
|
2066
2095
|
logout,
|
|
@@ -2130,7 +2159,7 @@ async function main(argv, io) {
|
|
|
2130
2159
|
}
|
|
2131
2160
|
}
|
|
2132
2161
|
|
|
2133
|
-
// apps/cli/src/index.ts
|
|
2162
|
+
// ../../../../C--Users-valen-Escritorio-secret-store/5a6b7732-87a9-4858-8123-ca0d205eaba6/scratchpad/rel-0.13.0/apps/cli/src/index.ts
|
|
2134
2163
|
removeStale(process.execPath);
|
|
2135
2164
|
process.exitCode = await main(process.argv.slice(2), {
|
|
2136
2165
|
env: process.env,
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.13.0",
|
|
3
3
|
"license": "SEE LICENSE IN LICENSE",
|
|
4
4
|
"homepage": "https://secretstore.sh/docs/cli",
|
|
5
|
+
"author": "Diego Palacios",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://secretstore.sh/contact"
|
|
8
|
+
},
|
|
5
9
|
"publishConfig": {
|
|
6
10
|
"access": "public",
|
|
7
11
|
"provenance": false
|
|
@@ -20,10 +24,10 @@
|
|
|
20
24
|
"dist/"
|
|
21
25
|
],
|
|
22
26
|
"optionalDependencies": {
|
|
23
|
-
"@secretstore/cli-windows-x64": "0.
|
|
24
|
-
"@secretstore/cli-linux-x64": "0.
|
|
25
|
-
"@secretstore/cli-linux-arm64": "0.
|
|
26
|
-
"@secretstore/cli-darwin-x64": "0.
|
|
27
|
-
"@secretstore/cli-darwin-arm64": "0.
|
|
27
|
+
"@secretstore/cli-windows-x64": "0.13.0",
|
|
28
|
+
"@secretstore/cli-linux-x64": "0.13.0",
|
|
29
|
+
"@secretstore/cli-linux-arm64": "0.13.0",
|
|
30
|
+
"@secretstore/cli-darwin-x64": "0.13.0",
|
|
31
|
+
"@secretstore/cli-darwin-arm64": "0.13.0"
|
|
28
32
|
}
|
|
29
33
|
}
|