@salesforce/plugin-auth 3.1.2 → 3.3.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.
@@ -78,6 +78,7 @@
78
78
  "pluginType": "core",
79
79
  "strict": true,
80
80
  "summary": "Log out of a Salesforce org.",
81
+ "enableJsonFlag": true,
81
82
  "isESM": true,
82
83
  "relativePath": [
83
84
  "lib",
@@ -139,7 +140,6 @@
139
140
  "strict": true,
140
141
  "summary": "List authorization information about the orgs you created or logged into.",
141
142
  "enableJsonFlag": true,
142
- "SF_ENV": "SF_ENV",
143
143
  "isESM": true,
144
144
  "relativePath": [
145
145
  "lib",
@@ -267,6 +267,7 @@
267
267
  "pluginType": "core",
268
268
  "strict": true,
269
269
  "summary": "Authorize an org using an existing Salesforce access token.",
270
+ "enableJsonFlag": true,
270
271
  "isESM": true,
271
272
  "relativePath": [
272
273
  "lib",
@@ -397,17 +398,6 @@
397
398
  "multiple": false,
398
399
  "type": "option"
399
400
  },
400
- "disable-masking": {
401
- "aliases": [
402
- "disablemasking"
403
- ],
404
- "deprecateAliases": true,
405
- "hidden": true,
406
- "name": "disable-masking",
407
- "summary": "Disable masking of user input; use with problematic terminals.",
408
- "allowNo": false,
409
- "type": "boolean"
410
- },
411
401
  "loglevel": {
412
402
  "deprecated": {
413
403
  "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
@@ -427,6 +417,7 @@
427
417
  "pluginType": "core",
428
418
  "strict": true,
429
419
  "summary": "Authorize an org using a device code.",
420
+ "enableJsonFlag": true,
430
421
  "isESM": true,
431
422
  "relativePath": [
432
423
  "lib",
@@ -620,6 +611,7 @@
620
611
  "pluginType": "core",
621
612
  "strict": true,
622
613
  "summary": "Log in to a Salesforce org using a JSON web token (JWT).",
614
+ "enableJsonFlag": true,
623
615
  "isESM": true,
624
616
  "relativePath": [
625
617
  "lib",
@@ -676,10 +668,11 @@
676
668
  ],
677
669
  "args": {},
678
670
  "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.",
671
+ "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
672
  "examples": [
681
673
  "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"
674
+ "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",
675
+ "Pipe the SFDX authorization URL from stdin by specifying the '-' value.\n<%= \"\\n $ echo url | \" + config.bin %> <%= command.id %> --sfdx-url-stdin -"
683
676
  ],
684
677
  "flags": {
685
678
  "json": {
@@ -696,12 +689,25 @@
696
689
  "char": "f",
697
690
  "deprecateAliases": true,
698
691
  "name": "sfdx-url-file",
699
- "required": true,
692
+ "required": false,
700
693
  "summary": "Path to a file that contains the Salesforce DX authorization URL.",
701
694
  "hasDynamicHelp": false,
702
695
  "multiple": false,
703
696
  "type": "option"
704
697
  },
698
+ "sfdx-url-stdin": {
699
+ "aliases": [
700
+ "sfdxurlstdin"
701
+ ],
702
+ "char": "u",
703
+ "deprecateAliases": true,
704
+ "name": "sfdx-url-stdin",
705
+ "required": false,
706
+ "summary": "Specify '-' as this flag's value to pipe the Salesforce DX authorization URL through standard input (stdin).",
707
+ "hasDynamicHelp": false,
708
+ "multiple": false,
709
+ "type": "option"
710
+ },
705
711
  "set-default-dev-hub": {
706
712
  "aliases": [
707
713
  "setdefaultdevhub",
@@ -768,7 +774,8 @@
768
774
  "pluginName": "@salesforce/plugin-auth",
769
775
  "pluginType": "core",
770
776
  "strict": true,
771
- "summary": "Authorize an org using a Salesforce DX authorization URL stored in a file.",
777
+ "summary": "Authorize an org using a Salesforce DX authorization URL stored in a file or through standard input (stdin).",
778
+ "enableJsonFlag": true,
772
779
  "isESM": true,
773
780
  "relativePath": [
774
781
  "lib",
@@ -917,17 +924,6 @@
917
924
  "multiple": false,
918
925
  "type": "option"
919
926
  },
920
- "disable-masking": {
921
- "aliases": [
922
- "disablemasking"
923
- ],
924
- "deprecateAliases": true,
925
- "hidden": true,
926
- "name": "disable-masking",
927
- "summary": "Disable masking of user input; use with problematic terminals.",
928
- "allowNo": false,
929
- "type": "boolean"
930
- },
931
927
  "no-prompt": {
932
928
  "aliases": [
933
929
  "noprompt"
@@ -960,6 +956,7 @@
960
956
  "pluginType": "core",
961
957
  "strict": true,
962
958
  "summary": "Log in to a Salesforce org using the web server flow.",
959
+ "enableJsonFlag": true,
963
960
  "isESM": true,
964
961
  "relativePath": [
965
962
  "lib",
@@ -1010,5 +1007,5 @@
1010
1007
  ]
1011
1008
  }
1012
1009
  },
1013
- "version": "3.1.2"
1010
+ "version": "3.3.0"
1014
1011
  }
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-auth",
3
3
  "description": "plugin for sf auth commands",
4
- "version": "3.1.2",
4
+ "version": "3.3.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
8
- "@oclif/core": "^3.16.0",
9
- "@salesforce/core": "^6.4.4",
8
+ "@inquirer/checkbox": "^1.5.0",
9
+ "@inquirer/select": "^1.3.1",
10
+ "@oclif/core": "^3.18.0",
11
+ "@salesforce/core": "^6.4.6",
10
12
  "@salesforce/kit": "^3.0.15",
11
- "@salesforce/sf-plugins-core": "^5.0.13",
13
+ "@salesforce/sf-plugins-core": "^7.1.1",
12
14
  "@salesforce/ts-types": "^2.0.9",
13
15
  "chalk": "^5.3.0",
14
16
  "open": "^9.1.0"
@@ -17,10 +19,10 @@
17
19
  "@oclif/plugin-command-snapshot": "^5.0.5",
18
20
  "@salesforce/cli-plugins-testkit": "^5.1.3",
19
21
  "@salesforce/dev-scripts": "^8.2.0",
20
- "@salesforce/plugin-command-reference": "^3.0.59",
22
+ "@salesforce/plugin-command-reference": "^3.0.61",
21
23
  "@salesforce/ts-sinon": "^1.4.19",
22
- "eslint-plugin-sf-plugin": "^1.17.0",
23
- "oclif": "^4.1.0",
24
+ "eslint-plugin-sf-plugin": "^1.17.1",
25
+ "oclif": "^4.2.0",
24
26
  "shx": "0.3.4",
25
27
  "ts-node": "^10.9.2",
26
28
  "typescript": "^5.3.3"
@@ -231,7 +233,7 @@
231
233
  "exports": "./lib/index.js",
232
234
  "type": "module",
233
235
  "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"
236
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-auth/3.3.0.crt",
237
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-auth/3.3.0.sig"
236
238
  }
237
239
  }
@@ -1,9 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- import { Config } from '@oclif/core';
3
- export declare abstract class AuthBaseCommand<T> extends SfCommand<T> {
4
- constructor(argv: string[], config: Config);
5
- protected askForHiddenResponse(messageKey: string, disableMasking?: boolean): Promise<string>;
6
- protected shouldExitCommand(noPrompt?: boolean, message?: string): Promise<boolean>;
7
- protected askForClientSecret(disableMasking?: boolean): Promise<string>;
8
- protected askForAccessToken(disableMasking?: boolean): Promise<string>;
9
- }
@@ -1,46 +0,0 @@
1
- /*
2
- * Copyright (c) 2020, salesforce.com, inc.
3
- * All rights reserved.
4
- * Licensed under the BSD 3-Clause license.
5
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
- */
7
- import { Messages, Global, Mode } from '@salesforce/core';
8
- import chalk from 'chalk';
9
- import { SfCommand } from '@salesforce/sf-plugins-core';
10
- Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
11
- const messages = Messages.loadMessages('@salesforce/plugin-auth', 'messages');
12
- function dimMessage(message) {
13
- return chalk.dim(message);
14
- }
15
- export class AuthBaseCommand extends SfCommand {
16
- constructor(argv, config) {
17
- super(argv, config);
18
- }
19
- async askForHiddenResponse(messageKey, disableMasking = false) {
20
- const msg = dimMessage(messages.getMessage(messageKey));
21
- const hidden = await this.prompt({
22
- message: msg,
23
- type: 'input',
24
- name: 'response',
25
- transformer: (input) => (disableMasking ? input : '*'.repeat(input.length)),
26
- });
27
- return hidden.response;
28
- }
29
- async shouldExitCommand(noPrompt, message) {
30
- if (Boolean(noPrompt) || Global.getEnvironmentMode() !== Mode.DEMO) {
31
- return false;
32
- }
33
- else {
34
- const msg = dimMessage(message ?? messages.getMessage('warnAuth', [this.config.bin]));
35
- const answer = await this.confirm(msg);
36
- return !answer;
37
- }
38
- }
39
- async askForClientSecret(disableMasking = false) {
40
- return this.askForHiddenResponse('clientSecretStdin', disableMasking);
41
- }
42
- async askForAccessToken(disableMasking = false) {
43
- return this.askForHiddenResponse('accessTokenStdin', disableMasking);
44
- }
45
- }
46
- //# sourceMappingURL=authBaseCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authBaseCommand.js","sourceRoot":"","sources":["../src/authBaseCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAGxD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC5D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAC;AAE9E,SAAS,UAAU,CAAC,OAAe;IACjC,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;A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