-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add auth:accesstoken:store command (#165)
* feat: add command auth:token:set @W-8066452@ * chore: update command ref and topic map * chore: unit tests and refactor from team guidance * chore: update cmd ref and package.json * chore: add tests * chore: update command-snapshot * chore: remove .codecov.yml Authored via Leif * chore: sync github PR slack notification (#152) Authored via Leif * feat: identify scratch orgs if hub is known during auth (#148) * feat: identify scratch orgs if hub is known during auth * chore: remove codecov * chore: clean up github folder * refactor: don't use prod-like loginUrl to exit * chore: prune unnecessary ts-comment * test: temporarily remove scratch-org-id to verify tests * style: typos * test: improve logging, temporarily use console * chore: back to regular logging * test: stubs for authinfo.hasAuthentications * style: typos * test: try single test * test: return a promise? * test: check authentications from instance * test: stub method used by hasAuthentications * test: run all the tests again * test: try grant using stubbed listAll * test: stub listAll for web:login * test: store uses stub * style: better error messages * style: typo in nut name! * refactor: changes from review comments * refactor: getFields from authinfo in scratch-id * Revert "refactor: getFields from authinfo in scratch-id" This reverts commit c914648. * style: comment for why we pass in the fields object * fix: use decrypted fields, not result of getFields * chore(release): 1.6.0 [ci skip] * chore: sync github PR slack notification (#152) Authored via Leif * chore: add call to reestablish org full identity * chore: set to fake return empty array * chore: sync github PR slack notification (#152) Authored via Leif * chore: sync github PR slack notification (#152) Authored via Leif * chore: sync github PR slack notification (#152) Authored via Leif * feat: add accesstoken command tests * chore: remove accesstokenfile parameter * chore: requested review changes * chore: clean up messages * chore: update command example missing instanceurl * chore: bump core version to 2.21.0 * chore: bump testkit to 1.1.2 * chore: dep changes * chore: pin dev-scripts to 0.9.11 * chore: fix the tests Co-authored-by: Benjamin Maggi <[email protected]> Co-authored-by: SF-CLI-BOT <[email protected]> Co-authored-by: Shane McLaughlin <[email protected]> Co-authored-by: SF-CLI-BOT <[email protected]>
- Loading branch information
1 parent
5eca185
commit 3f7d75a
Showing
16 changed files
with
668 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: "monthly" | ||
interval: 'monthly' | ||
labels: | ||
- "dependencies" | ||
- 'dependencies' | ||
open-pull-requests-limit: 100 | ||
pull-request-branch-name: | ||
separator: "-" | ||
separator: '-' | ||
ignore: | ||
- dependency-name: "typescript" | ||
- dependency-name: "sinon" | ||
- dependency-name: "string-ansi" | ||
- dependency-name: "*" | ||
update-types: ["version-update:semver-major"] | ||
- dependency-name: 'typescript' | ||
- dependency-name: 'sinon' | ||
- dependency-name: 'string-ansi' | ||
- dependency-name: '*' | ||
update-types: ['version-update:semver-major'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ We always recommend using the latest version of these commands bundled with the | |
|
||
## Install | ||
|
||
|
||
```bash | ||
sfdx plugins:install [email protected] | ||
``` | ||
|
@@ -70,20 +69,21 @@ sfdx plugins | |
# Commands | ||
|
||
<!-- commands --> | ||
* [`sfdx auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authdevicelogin--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
* [`sfdx auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authjwtgrant--u-string--f-filepath--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
* [`sfdx auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authlist---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
* [`sfdx auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authlogout--a--p--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
* [`sfdx auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authsfdxurlstore--f-filepath--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
* [`sfdx auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authweblogin--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
|
||
- [`sfdx auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authdevicelogin--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
- [`sfdx auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authjwtgrant--u-string--f-filepath--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
- [`sfdx auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authlist---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
- [`sfdx auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authlogout--a--p--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
- [`sfdx auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authsfdxurlstore--f-filepath--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
- [`sfdx auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authweblogin--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
|
||
## `sfdx auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` | ||
|
||
authorize an org using a device code | ||
|
||
``` | ||
USAGE | ||
$ sfdx auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel | ||
$ sfdx auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel | ||
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] | ||
OPTIONS | ||
|
@@ -126,7 +126,7 @@ authorize an org using the JWT flow | |
|
||
``` | ||
USAGE | ||
$ sfdx auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel | ||
$ sfdx auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel | ||
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] | ||
OPTIONS | ||
|
@@ -159,8 +159,8 @@ OPTIONS | |
DESCRIPTION | ||
Use a certificate associated with your private key that has been uploaded to a personal connected app. | ||
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To | ||
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To | ||
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To | ||
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To | ||
specify a sandbox, set --instanceurl to https://test.salesforce.com. | ||
ALIASES | ||
|
@@ -200,7 +200,7 @@ log out from authorized orgs | |
|
||
``` | ||
USAGE | ||
$ sfdx auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel | ||
$ sfdx auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel | ||
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] | ||
OPTIONS | ||
|
@@ -238,7 +238,7 @@ Authorize an org using an SFDX auth URL | |
|
||
``` | ||
USAGE | ||
$ sfdx auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel | ||
$ sfdx auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel | ||
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] | ||
OPTIONS | ||
|
@@ -262,9 +262,9 @@ OPTIONS | |
this command invocation | ||
DESCRIPTION | ||
Authorize a Salesforce org using an SFDX auth URL stored within a file. The URL must have the format | ||
Authorize a Salesforce org using an SFDX auth URL stored within a file. The URL must have the format | ||
"force://<refreshToken>@<instanceUrl>" or "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". | ||
You have three options when creating the auth file. The easiest option is to redirect the output of the `sfdx | ||
You have three options when creating the auth file. The easiest option is to redirect the output of the `sfdx | ||
force:org:display --verbose --json` command into a file. | ||
For example, using an org you have already authorized: | ||
|
@@ -291,7 +291,7 @@ authorize an org using the web login flow | |
|
||
``` | ||
USAGE | ||
$ sfdx auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel | ||
$ sfdx auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel | ||
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] | ||
OPTIONS | ||
|
@@ -318,8 +318,8 @@ OPTIONS | |
this command invocation | ||
DESCRIPTION | ||
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To | ||
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To log | ||
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To | ||
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To log | ||
in to a sandbox, set --instanceurl to https://test.salesforce.com. | ||
ALIASES | ||
|
@@ -332,4 +332,5 @@ EXAMPLES | |
``` | ||
|
||
_See code: [src/commands/auth/web/login.ts](https://github.com/salesforcecli/plugin-auth/blob/v1.6.1/src/commands/auth/web/login.ts)_ | ||
|
||
<!-- commandsstop --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"description": "authorize an org using a Salesforce access token\nWhen run interactively, the command prompts you for the access token.\nTo use the command in a CI/CD script, set the SFDX_ACCESS_TOKEN environment variable to the access token.", | ||
"examples": [ | ||
"sfdx auth:accesstoken:store --instanceurl https://login.salesforce.com", | ||
"sfdx auth:accesstoken:store --instanceurl https://dev-hub.my.salesforce.com", | ||
"export SFDX_ACCESS_TOKEN=00Dxx0000000000!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nsfdx auth:accesstoken:store --instanceurl https://dev-hub.my.salesforce.com" | ||
], | ||
"invalidAccessTokenFormat": "The access token isn't in the correct format.\nIt should follow this pattern: %s." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
{ | ||
"description": "log out from authorized orgs\nBy default, this command logs you out from your default scratch org.", | ||
"examples": [ | ||
"sfdx auth:logout -u [email protected]", | ||
"sfdx auth:logout -a", | ||
"sfdx auth:logout -p" | ||
], | ||
"examples": ["sfdx auth:logout -u [email protected]", "sfdx auth:logout -a", "sfdx auth:logout -p"], | ||
"all": "include all authenticated orgs", | ||
"allLong": "Includes all authenticated orgs: for example, Dev Hubs, sandboxes, DE orgs, and expired, deleted, and unknown-status scratch orgs.", | ||
"noPrompt": "do not prompt for confirmation", | ||
"logoutCommandYesNo": "Are you sure you want to log out from these org(s)?\n%s\n\nImportant: You need a password to reauthorize scratch orgs. By default, scratch orgs have no password. If you still need your scratch orgs, run \"sfdx force:user:password:generate\" before logging out. If you don't need the scratch orgs anymore, run \"sfdx force:org:delete\" instead of logging out.\n\nLog out (y/n)?", | ||
"specifiedBothUserAndAllError": "Specify either --targetusername or --all.", | ||
"logoutOrgCommandSuccess": "Successfully logged out of orgs: %s" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.