Skip to content

Commit

Permalink
Merge pull request #905 from salesforcecli/sm/deprecateAliases
Browse files Browse the repository at this point in the history
Sm/deprecateAliases
  • Loading branch information
shetzel authored Jan 2, 2024
2 parents 698009e + 10a02b7 commit 1424050
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion messages/jwt.grant.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ We recommend that you set an alias when you log into an org. Aliases make it eas

# examples

- Log into an org with username jdoe@example.org and on the default instance URL (https://login.salesforce.org). The private key is stored in the file /Users/jdoe/JWT/server.key and the command uses the connected app with consumer key (client id) 04580y4051234051.
- Log into an org with username jdoe@example.org and on the default instance URL (https://login.salesforce.com). The private key is stored in the file /Users/jdoe/JWT/server.key and the command uses the connected app with consumer key (client id) 04580y4051234051.

<%= config.bin %> <%= command.id %> --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id 04580y4051234051

Expand Down
5 changes: 2 additions & 3 deletions src/commands/org/login/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import { AuthFields, AuthInfo, DeviceOauthService, Messages, OAuth2Config } from '@salesforce/core';
import { Flags, loglevel } from '@salesforce/sf-plugins-core';
import { DeviceCodeResponse } from '@salesforce/core/lib/deviceOauthService.js';
import { ux } from '@oclif/core';
import { AuthBaseCommand } from '../../../authBaseCommand.js';
import { Common } from '../../../common.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-auth', 'device.login');
const commonMessages = Messages.loadMessages('@salesforce/plugin-auth', 'messages');

Expand All @@ -25,6 +23,7 @@ export default class LoginDevice extends AuthBaseCommand<DeviceLoginResult> {
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static aliases = ['force:auth:device:login', 'auth:device:login'];
public static readonly deprecateAliases = true;

public static readonly flags = {
'client-id': Flags.string({
Expand Down
5 changes: 2 additions & 3 deletions src/commands/org/login/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import { Flags, loglevel } from '@salesforce/sf-plugins-core';
import { AuthFields, AuthInfo, AuthRemover, Logger, Messages, SfError } from '@salesforce/core';
import { Interfaces } from '@oclif/core';
import { AuthBaseCommand } from '../../../authBaseCommand.js';
import { Common } from '../../../common.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-auth', 'jwt.grant');
const commonMessages = Messages.loadMessages('@salesforce/plugin-auth', 'messages');

Expand All @@ -22,6 +20,7 @@ export default class LoginJwt extends AuthBaseCommand<AuthFields> {
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static aliases = ['force:auth:jwt:grant', 'auth:jwt:grant'];
public static readonly deprecateAliases = true;

public static readonly flags = {
username: Flags.string({
Expand Down
5 changes: 2 additions & 3 deletions src/commands/org/login/sfdx-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import fs from 'node:fs/promises';
import { Flags, loglevel } from '@salesforce/sf-plugins-core';
import { AuthFields, AuthInfo, Messages } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
import { parseJson } from '@salesforce/kit';
import { AuthBaseCommand } from '../../../authBaseCommand.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-auth', 'sfdxurl.store');
const commonMessages = Messages.loadMessages('@salesforce/plugin-auth', 'messages');

Expand All @@ -29,6 +27,7 @@ export default class LoginSfdxUrl extends AuthBaseCommand<AuthFields> {
public static readonly description = messages.getMessage('description', [AUTH_URL_FORMAT]);
public static readonly examples = messages.getMessages('examples');
public static aliases = ['force:auth:sfdxurl:store', 'auth:sfdxurl:store'];
public static readonly deprecateAliases = true;

public static readonly flags = {
'sfdx-url-file': Flags.file({
Expand Down
6 changes: 2 additions & 4 deletions src/commands/org/login/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import open, { apps, AppName } from 'open';
import { Flags, loglevel } from '@salesforce/sf-plugins-core';
import { AuthFields, AuthInfo, Logger, Messages, OAuth2Config, SfError, WebOAuthServer } from '@salesforce/core';
Expand All @@ -15,7 +13,7 @@ import { Interfaces } from '@oclif/core';
import { AuthBaseCommand } from '../../../authBaseCommand.js';
import { Common } from '../../../common.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-auth', 'web.login');
const commonMessages = Messages.loadMessages('@salesforce/plugin-auth', 'messages');

Expand All @@ -24,7 +22,7 @@ export default class LoginWeb extends AuthBaseCommand<AuthFields> {
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static readonly deprecateAliases = true;
public static aliases = ['force:auth:web:login', 'auth:web:login'];
public static readonly aliases = ['force:auth:web:login', 'auth:web:login'];

public static readonly flags = {
browser: Flags.string({
Expand Down

0 comments on commit 1424050

Please sign in to comment.