@salesforce/plugin-auth 3.1.2 → 3.2.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/README.md CHANGED
@@ -107,7 +107,7 @@ EXAMPLES
107
107
  $ sf org list auth
108
108
  ```
109
109
 
110
- _See code: [src/commands/org/list/auth.ts](https://github.com/salesforcecli/plugin-auth/blob/3.1.2/src/commands/org/list/auth.ts)_
110
+ _See code: [src/commands/org/list/auth.ts](https://github.com/salesforcecli/plugin-auth/blob/3.2.0/src/commands/org/list/auth.ts)_
111
111
 
112
112
  ## `sf org login access-token`
113
113
 
@@ -160,7 +160,7 @@ FLAG DESCRIPTIONS
160
160
  To specify a sandbox, set --instance-url to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
161
161
  ```
162
162
 
163
- _See code: [src/commands/org/login/access-token.ts](https://github.com/salesforcecli/plugin-auth/blob/3.1.2/src/commands/org/login/access-token.ts)_
163
+ _See code: [src/commands/org/login/access-token.ts](https://github.com/salesforcecli/plugin-auth/blob/3.2.0/src/commands/org/login/access-token.ts)_
164
164
 
165
165
  ## `sf org login device`
166
166
 
@@ -219,7 +219,7 @@ FLAG DESCRIPTIONS
219
219
  To specify a sandbox, set --instance-url to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
220
220
  ```
221
221
 
222
- _See code: [src/commands/org/login/device.ts](https://github.com/salesforcecli/plugin-auth/blob/3.1.2/src/commands/org/login/device.ts)_
222
+ _See code: [src/commands/org/login/device.ts](https://github.com/salesforcecli/plugin-auth/blob/3.2.0/src/commands/org/login/device.ts)_
223
223
 
224
224
  ## `sf org login jwt`
225
225
 
@@ -308,27 +308,29 @@ FLAG DESCRIPTIONS
308
308
  To specify a sandbox, set --instance-url to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
309
309
  ```
310
310
 
311
- _See code: [src/commands/org/login/jwt.ts](https://github.com/salesforcecli/plugin-auth/blob/3.1.2/src/commands/org/login/jwt.ts)_
311
+ _See code: [src/commands/org/login/jwt.ts](https://github.com/salesforcecli/plugin-auth/blob/3.2.0/src/commands/org/login/jwt.ts)_
312
312
 
313
313
  ## `sf org login sfdx-url`
314
314
 
315
- Authorize an org using a Salesforce DX authorization URL stored in a file.
315
+ Authorize an org using a Salesforce DX authorization URL stored in a file or through standard input (stdin).
316
316
 
317
317
  ```
318
318
  USAGE
319
- $ sf org login sfdx-url -f <value> [--json] [-d] [-s] [-a <value>]
319
+ $ sf org login sfdx-url [--json] [-f <value>] [-u <value>] [-d] [-s] [-a <value>]
320
320
 
321
321
  FLAGS
322
- -a, --alias=<value> Alias for the org.
323
- -d, --set-default-dev-hub Set the authenticated org as the default Dev Hub.
324
- -f, --sfdx-url-file=<value> (required) Path to a file that contains the Salesforce DX authorization URL.
325
- -s, --set-default Set the authenticated org as the default that all org-related commands run against.
322
+ -a, --alias=<value> Alias for the org.
323
+ -d, --set-default-dev-hub Set the authenticated org as the default Dev Hub.
324
+ -f, --sfdx-url-file=<value> Path to a file that contains the Salesforce DX authorization URL.
325
+ -s, --set-default Set the authenticated org as the default that all org-related commands run against.
326
+ -u, --sfdx-url-stdin=<value> Specify '-' as this flag's value to pipe the Salesforce DX authorization URL through
327
+ standard input (stdin).
326
328
 
327
329
  GLOBAL FLAGS
328
330
  --json Format output as json.
329
331
 
330
332
  DESCRIPTION
331
- Authorize an org using a Salesforce DX authorization URL stored in a file.
333
+ Authorize an org using a Salesforce DX authorization URL stored in a file or through standard input (stdin).
332
334
 
333
335
  The Salesforce DX (SFDX) authorization URL must have the format
334
336
  "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". NOTE: The SFDX authorization URL uses the "force"
@@ -352,6 +354,9 @@ DESCRIPTION
352
354
  You can also create a JSON file that has a top-level property named sfdxAuthUrl whose value is the authorization URL.
353
355
  Finally, you can create a normal text file that includes just the URL and nothing else.
354
356
 
357
+ Alternatively, you can pipe the SFDX authorization URL through standard input by using the --sfdx-url-stdin flag and
358
+ providing the '-' character as the value.
359
+
355
360
  ALIASES
356
361
  $ sf force auth sfdxurl store
357
362
  $ sf auth sfdxurl store
@@ -364,9 +369,13 @@ EXAMPLES
364
369
  Similar to previous example, but set the org as your default and give it an alias MyDefaultOrg:
365
370
 
366
371
  $ sf org login sfdx-url --sfdx-url-file files/authFile.json --set-default --alias MyDefaultOrg
372
+
373
+ Pipe the SFDX authorization URL from stdin by specifying the '-' value.
374
+
375
+ $ echo url | sf org login sfdx-url --sfdx-url-stdin -
367
376
  ```
368
377
 
369
- _See code: [src/commands/org/login/sfdx-url.ts](https://github.com/salesforcecli/plugin-auth/blob/3.1.2/src/commands/org/login/sfdx-url.ts)_
378
+ _See code: [src/commands/org/login/sfdx-url.ts](https://github.com/salesforcecli/plugin-auth/blob/3.2.0/src/commands/org/login/sfdx-url.ts)_
370
379
 
371
380
  ## `sf org login web`
372
381
 
@@ -451,7 +460,7 @@ FLAG DESCRIPTIONS
451
460
  To specify a sandbox, set --instance-url to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
452
461
  ```
453
462
 
454
- _See code: [src/commands/org/login/web.ts](https://github.com/salesforcecli/plugin-auth/blob/3.1.2/src/commands/org/login/web.ts)_
463
+ _See code: [src/commands/org/login/web.ts](https://github.com/salesforcecli/plugin-auth/blob/3.2.0/src/commands/org/login/web.ts)_
455
464
 
456
465
  ## `sf org logout`
457
466
 
@@ -511,6 +520,6 @@ FLAG DESCRIPTIONS
511
520
  All orgs includes Dev Hubs, sandboxes, DE orgs, and expired, deleted, and unknown-status scratch orgs.
512
521
  ```
513
522
 
514
- _See code: [src/commands/org/logout.ts](https://github.com/salesforcecli/plugin-auth/blob/3.1.2/src/commands/org/logout.ts)_
523
+ _See code: [src/commands/org/logout.ts](https://github.com/salesforcecli/plugin-auth/blob/3.2.0/src/commands/org/logout.ts)_
515
524
 
516
525
  <!-- commandsstop -->
@@ -7,7 +7,8 @@ export default class LoginSfdxUrl extends AuthBaseCommand<AuthFields> {
7
7
  static aliases: string[];
8
8
  static readonly deprecateAliases = true;
9
9
  static readonly flags: {
10
- 'sfdx-url-file': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
+ 'sfdx-url-file': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
+ 'sfdx-url-stdin': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
12
  'set-default-dev-hub': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
12
13
  'set-default': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
13
14
  alias: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
@@ -23,9 +23,19 @@ export default class LoginSfdxUrl extends AuthBaseCommand {
23
23
  'sfdx-url-file': Flags.file({
24
24
  char: 'f',
25
25
  summary: messages.getMessage('flags.sfdx-url-file.summary'),
26
- required: true,
26
+ required: false,
27
27
  deprecateAliases: true,
28
28
  aliases: ['sfdxurlfile'],
29
+ exactlyOne: ['sfdx-url-file', 'sfdx-url-stdin'],
30
+ }),
31
+ 'sfdx-url-stdin': Flags.file({
32
+ char: 'u',
33
+ summary: messages.getMessage('flags.sfdx-url-stdin.summary'),
34
+ required: false,
35
+ deprecateAliases: true,
36
+ aliases: ['sfdxurlstdin'],
37
+ allowStdin: 'only',
38
+ exactlyOne: ['sfdx-url-file', 'sfdx-url-stdin'],
29
39
  }),
30
40
  'set-default-dev-hub': Flags.boolean({
31
41
  char: 'd',
@@ -60,11 +70,19 @@ export default class LoginSfdxUrl extends AuthBaseCommand {
60
70
  if (await this.shouldExitCommand(flags['no-prompt']))
61
71
  return {};
62
72
  const authFile = flags['sfdx-url-file'];
63
- const sfdxAuthUrl = authFile.endsWith('.json')
64
- ? await getUrlFromJson(authFile)
65
- : await fs.readFile(authFile, 'utf8');
66
- if (!sfdxAuthUrl) {
67
- throw new Error(`Error getting the auth URL from file ${authFile}. Please ensure it meets the description shown in the documentation for this command.`);
73
+ const authStdin = flags['sfdx-url-stdin'];
74
+ let sfdxAuthUrl;
75
+ if (authFile) {
76
+ sfdxAuthUrl = authFile.endsWith('.json') ? await getUrlFromJson(authFile) : await fs.readFile(authFile, 'utf8');
77
+ if (!sfdxAuthUrl) {
78
+ throw new Error(`Error getting the auth URL from file ${authFile}. Please ensure it meets the description shown in the documentation for this command.`);
79
+ }
80
+ }
81
+ else if (authStdin) {
82
+ sfdxAuthUrl = authStdin;
83
+ }
84
+ else {
85
+ throw new Error('SFDX Auth URL not found.');
68
86
  }
69
87
  const oauth2Options = AuthInfo.parseSfdxAuthUrl(sfdxAuthUrl);
70
88
  const authInfo = await AuthInfo.create({ oauth2Options });
@@ -1 +1 @@
1
- {"version":3,"file":"sfdx-url.js","sourceRoot":"","sources":["../../../../src/commands/org/login/sfdx-url.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAc,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;AACnF,MAAM,cAAc,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAC;AAEpF,MAAM,eAAe,GAAG,gEAAgE,CAAC;AAMzF,MAAM,CAAC,OAAO,OAAO,YAAa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AE,QAAgB,EAAmB,EAAE;IACjE,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAa,CAAC;IACzD,OAAO,YAAY,CAAC,MAAM,EAAE,WAAW,IAAI,YAAY,CAAC,WAAW,CAAC;AACtE,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  # summary
2
2
 
3
- Authorize an org using a Salesforce DX authorization URL stored in a file.
3
+ Authorize an org using a Salesforce DX authorization URL stored in a file or through standard input (stdin).
4
4
 
5
5
  # description
6
6
 
@@ -18,10 +18,16 @@ NOTE: The "<%= config.bin %> org display --verbose" command displays the refresh
18
18
 
19
19
  You can also create a JSON file that has a top-level property named sfdxAuthUrl whose value is the authorization URL. Finally, you can create a normal text file that includes just the URL and nothing else.
20
20
 
21
+ Alternatively, you can pipe the SFDX authorization URL through standard input by using the --sfdx-url-stdin flag and providing the '-' character as the value.
22
+
21
23
  # flags.sfdx-url-file.summary
22
24
 
23
25
  Path to a file that contains the Salesforce DX authorization URL.
24
26
 
27
+ # flags.sfdx-url-stdin.summary
28
+
29
+ Specify '-' as this flag's value to pipe the Salesforce DX authorization URL through standard input (stdin).
30
+
25
31
  # examples
26
32
 
27
33
  - Authorize an org using the SFDX authorization URL in the files/authFile.json file:
@@ -31,3 +37,7 @@ Path to a file that contains the Salesforce DX authorization URL.
31
37
  - Similar to previous example, but set the org as your default and give it an alias MyDefaultOrg:
32
38
 
33
39
  <%= config.bin %> <%= command.id %> --sfdx-url-file files/authFile.json --set-default --alias MyDefaultOrg
40
+
41
+ - Pipe the SFDX authorization URL from stdin by specifying the '-' value.
42
+
43
+ <%= "\n $ echo url | " + config.bin %> <%= command.id %> --sfdx-url-stdin -
@@ -676,10 +676,11 @@
676
676
  ],
677
677
  "args": {},
678
678
  "deprecateAliases": true,
679
- "description": "The Salesforce DX (SFDX) authorization URL must have the format \"force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>\". NOTE: The SFDX authorization URL uses the \"force\" protocol, and not \"http\" or \"https\". Also, the \"instanceUrl\" inside the SFDX authorization URL doesn't include the protocol (\"https://\").\n\nYou have three options when creating the authorization file. The easiest option is to redirect the output of the \"<%= config.bin %> org display --verbose --json\" command into a file. For example, using an org with alias my-org that you've already authorized:\n\n $ <%= config.bin %> org display --target-org my-org --verbose --json > authFile.json\n\nThe resulting JSON file contains the URL in the \"sfdxAuthUrl\" property of the \"result\" object. You can then reference the file when running this command:\n\n $ <%= config.bin %> <%= command.id %> --sfdx-url-file authFile.json\n\nNOTE: The \"<%= config.bin %> org display --verbose\" command displays the refresh token only for orgs authorized with the web server flow, and not the JWT bearer flow.\n\nYou can also create a JSON file that has a top-level property named sfdxAuthUrl whose value is the authorization URL. Finally, you can create a normal text file that includes just the URL and nothing else.",
679
+ "description": "The Salesforce DX (SFDX) authorization URL must have the format \"force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>\". NOTE: The SFDX authorization URL uses the \"force\" protocol, and not \"http\" or \"https\". Also, the \"instanceUrl\" inside the SFDX authorization URL doesn't include the protocol (\"https://\").\n\nYou have three options when creating the authorization file. The easiest option is to redirect the output of the \"<%= config.bin %> org display --verbose --json\" command into a file. For example, using an org with alias my-org that you've already authorized:\n\n $ <%= config.bin %> org display --target-org my-org --verbose --json > authFile.json\n\nThe resulting JSON file contains the URL in the \"sfdxAuthUrl\" property of the \"result\" object. You can then reference the file when running this command:\n\n $ <%= config.bin %> <%= command.id %> --sfdx-url-file authFile.json\n\nNOTE: The \"<%= config.bin %> org display --verbose\" command displays the refresh token only for orgs authorized with the web server flow, and not the JWT bearer flow.\n\nYou can also create a JSON file that has a top-level property named sfdxAuthUrl whose value is the authorization URL. Finally, you can create a normal text file that includes just the URL and nothing else.\n\nAlternatively, you can pipe the SFDX authorization URL through standard input by using the --sfdx-url-stdin flag and providing the '-' character as the value.",
680
680
  "examples": [
681
681
  "Authorize an org using the SFDX authorization URL in the files/authFile.json file:\n<%= config.bin %> <%= command.id %> --sfdx-url-file files/authFile.json",
682
- "Similar to previous example, but set the org as your default and give it an alias MyDefaultOrg:\n<%= config.bin %> <%= command.id %> --sfdx-url-file files/authFile.json --set-default --alias MyDefaultOrg"
682
+ "Similar to previous example, but set the org as your default and give it an alias MyDefaultOrg:\n<%= config.bin %> <%= command.id %> --sfdx-url-file files/authFile.json --set-default --alias MyDefaultOrg",
683
+ "Pipe the SFDX authorization URL from stdin by specifying the '-' value.\n<%= \"\\n $ echo url | \" + config.bin %> <%= command.id %> --sfdx-url-stdin -"
683
684
  ],
684
685
  "flags": {
685
686
  "json": {
@@ -696,12 +697,25 @@
696
697
  "char": "f",
697
698
  "deprecateAliases": true,
698
699
  "name": "sfdx-url-file",
699
- "required": true,
700
+ "required": false,
700
701
  "summary": "Path to a file that contains the Salesforce DX authorization URL.",
701
702
  "hasDynamicHelp": false,
702
703
  "multiple": false,
703
704
  "type": "option"
704
705
  },
706
+ "sfdx-url-stdin": {
707
+ "aliases": [
708
+ "sfdxurlstdin"
709
+ ],
710
+ "char": "u",
711
+ "deprecateAliases": true,
712
+ "name": "sfdx-url-stdin",
713
+ "required": false,
714
+ "summary": "Specify '-' as this flag's value to pipe the Salesforce DX authorization URL through standard input (stdin).",
715
+ "hasDynamicHelp": false,
716
+ "multiple": false,
717
+ "type": "option"
718
+ },
705
719
  "set-default-dev-hub": {
706
720
  "aliases": [
707
721
  "setdefaultdevhub",
@@ -768,7 +782,7 @@
768
782
  "pluginName": "@salesforce/plugin-auth",
769
783
  "pluginType": "core",
770
784
  "strict": true,
771
- "summary": "Authorize an org using a Salesforce DX authorization URL stored in a file.",
785
+ "summary": "Authorize an org using a Salesforce DX authorization URL stored in a file or through standard input (stdin).",
772
786
  "isESM": true,
773
787
  "relativePath": [
774
788
  "lib",
@@ -1010,5 +1024,5 @@
1010
1024
  ]
1011
1025
  }
1012
1026
  },
1013
- "version": "3.1.2"
1027
+ "version": "3.2.0"
1014
1028
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-auth",
3
3
  "description": "plugin for sf auth commands",
4
- "version": "3.1.2",
4
+ "version": "3.2.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
@@ -231,7 +231,7 @@
231
231
  "exports": "./lib/index.js",
232
232
  "type": "module",
233
233
  "sfdx": {
234
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-auth/3.1.2.crt",
235
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-auth/3.1.2.sig"
234
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-auth/3.2.0.crt",
235
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-auth/3.2.0.sig"
236
236
  }
237
237
  }