sim 2.1.16 → 2.1.17-preview.125.1
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/index.js +8 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8195,6 +8195,9 @@ function clientInfoHeader(env = process.env) {
|
|
|
8195
8195
|
cached ??= buildClientInfoHeader(env);
|
|
8196
8196
|
return cached;
|
|
8197
8197
|
}
|
|
8198
|
+
function identityHeaders() {
|
|
8199
|
+
return { "user-agent": USER_AGENT, [CLIENT_INFO_HEADER]: clientInfoHeader() };
|
|
8200
|
+
}
|
|
8198
8201
|
function buildClientInfoHeader(env) {
|
|
8199
8202
|
return formatClientInfo({
|
|
8200
8203
|
surface: "cli",
|
|
@@ -8546,8 +8549,7 @@ class SimClient {
|
|
|
8546
8549
|
...credential?.kind === "api_key" ? { "x-api-key": credential.apiKey } : {},
|
|
8547
8550
|
...credential?.kind === "oauth" ? { authorization: `Bearer ${credential.oauth.accessToken}` } : {},
|
|
8548
8551
|
accept: "application/json",
|
|
8549
|
-
|
|
8550
|
-
[CLIENT_INFO_HEADER]: clientInfoHeader(),
|
|
8552
|
+
...identityHeaders(),
|
|
8551
8553
|
...hasBody ? { "content-type": "application/json" } : {},
|
|
8552
8554
|
...options.headers
|
|
8553
8555
|
},
|
|
@@ -8772,7 +8774,7 @@ async function discoverOAuthProvider(endpoint) {
|
|
|
8772
8774
|
let response;
|
|
8773
8775
|
try {
|
|
8774
8776
|
response = await fetch(buildUrl(endpoint, DISCOVERY_PATH), {
|
|
8775
|
-
headers: { accept: "application/json",
|
|
8777
|
+
headers: { accept: "application/json", ...identityHeaders() },
|
|
8776
8778
|
redirect: "manual",
|
|
8777
8779
|
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
|
|
8778
8780
|
});
|
|
@@ -8800,7 +8802,7 @@ async function postToken(endpoint, path, form, signal) {
|
|
|
8800
8802
|
headers: {
|
|
8801
8803
|
"content-type": "application/x-www-form-urlencoded",
|
|
8802
8804
|
accept: "application/json",
|
|
8803
|
-
|
|
8805
|
+
...identityHeaders()
|
|
8804
8806
|
},
|
|
8805
8807
|
body: new URLSearchParams(form).toString(),
|
|
8806
8808
|
signal,
|
|
@@ -9280,7 +9282,7 @@ async function pollForKey(endpoint, auth, signal) {
|
|
|
9280
9282
|
headers: {
|
|
9281
9283
|
"content-type": "application/json",
|
|
9282
9284
|
accept: "application/json",
|
|
9283
|
-
|
|
9285
|
+
...identityHeaders()
|
|
9284
9286
|
},
|
|
9285
9287
|
body: JSON.stringify({ request: auth.request, verifier: auth.pollSecret }),
|
|
9286
9288
|
signal,
|
|
@@ -20829,6 +20831,7 @@ function attachSecretCommands(program) {
|
|
|
20829
20831
|
const redactionSpellings = new Set;
|
|
20830
20832
|
secrets.command("set").argument("<name>", "Secret name, as referenced in workflows").description(describeOperation(V2_OPERATIONS.setSecret, "Create or replace a named secret")).addOption(new Option("--scope <scope>", "Secret ownership scope (required)").choices([...SECRET_SCOPES]).makeOptionMandatory()).option("--value <value|@file>", "Secret value. Passing it inline exposes it to shell history and process listings; @path reads it from a file and @- from stdin, verbatim — a trailing newline is part of the value, so write the file with printf rather than echo. Prefix a literal leading @ with a second one").option("--description <description>", "What the secret is for, shown to teammates; workspace scope only. Omit to leave an existing description unchanged").option("--unredacted", `${V2_OPERATIONS.setSecret.body.unredacted.describe} Pass --no-unredacted to restore redaction`).option("--no-unredacted", "Send --unredacted as false").on("option:unredacted", () => redactionSpellings.add("--unredacted")).on("option:no-unredacted", () => redactionSpellings.add("--no-unredacted")).action((name, options, command) => setSecret(name, options, command, redactionSpellings));
|
|
20831
20833
|
}
|
|
20834
|
+
|
|
20832
20835
|
// src/telemetry/transport.ts
|
|
20833
20836
|
import { spawn as spawn4 } from "node:child_process";
|
|
20834
20837
|
var CAPTURE_PATH = "/i/v0/e/";
|