Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions docs/Release Notes/Axway CLI 3.2.15.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Axway CLI 3.2.15

## November 21, 2024

This is a patch release with a bug fix for an issue with logout confirmation.

### Installation

```
npm i -g axway@3.2.15
```

### axway

- **v3.2.15** - 11/21/2024

- chore: Updated dependencies.

### amplify-cli-utils

- **v5.0.19** - 11/21/2024

- chore: Updated dependencies.

### amplify-config

- **v4.0.15** - 11/21/2024

- chore: Updated dependencies.

### amplify-request

- **v3.1.6** - 11/21/2024

- chore: Updated dependencies.

### amplify-sdk

- **v3.2.15** - 11/21/2024

- chore: Logout issue - fix for an issue with logout confirmation on platform.

### amplify-utils

- **v1.0.15** - 11/21/2024

- chore: Updated dependencies.

### axway-cli-auth

- **v3.3.15** - 11/21/2024

- chore: Updated dependencies.

### axway-cli-oum

- **v2.0.19** - 11/21/2024

- chore: Updated dependencies.

### axway-cli-pm

- **v4.0.19** - 11/21/2024

- chore: Updated dependencies.
4 changes: 4 additions & 0 deletions packages/amplify-cli-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v5.0.19 (Nov 21, 2024)

- chore: Updated dependencies.

# v5.0.18 (July 3, 2024)

- chore: Updated dependencies.
Expand Down
8 changes: 4 additions & 4 deletions packages/amplify-cli-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axway/amplify-cli-utils",
"version": "5.0.19",
"version": "5.0.20",
"publishConfig": {
"access": "public"
},
Expand All @@ -24,9 +24,9 @@
"test": "gulp test"
},
"dependencies": {
"@axway/amplify-config": "^4.0.15",
"@axway/amplify-request": "^3.1.6",
"@axway/amplify-sdk": "^3.2.15",
"@axway/amplify-config": "^4.0.16",
"@axway/amplify-request": "^3.1.7",
"@axway/amplify-sdk": "^3.2.16",
"boxen": "^5.1.2",
"check-kit": "^1.2.1",
"cli-kit": "^1.16.0",
Expand Down
9 changes: 6 additions & 3 deletions packages/amplify-cli-utils/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function buildAuthParams(opts = {}, config) {
}

const env = environments.resolve(opts.env || config.get('env'));
const region = opts.region || config.get('region');

const { clientId, realm } = env.auth;
const params = {};
Expand All @@ -64,6 +65,7 @@ export function buildAuthParams(opts = {}, config) {
persistSecrets: undefined,
platformUrl: undefined,
realm,
region: region,
secretFile: undefined,
serverHost: undefined,
serverPort: undefined,
Expand Down Expand Up @@ -235,20 +237,21 @@ export function hlVer(toVer, fromVer) {
* @param {String} [accountName] - The name of the platform account to use.
* @param {String} [org] - The name, id, or guid of the default organization.
* @param {String} [env] - The environment name.
* @param {boolean} [bypassPlatformAccountCheck] - Optional parameter to bypass check if the account is platform
* @returns {Promise<Object>}
*/
export async function initPlatformAccount(accountName, org, env) {
export async function initPlatformAccount(accountName, org, env, bypassPlatformAccountCheck = false) {
const { config, sdk } = initSDK({ env });
const authConfigEnvSpecifier = getAuthConfigEnvSpecifier(sdk.env.name);
const account = await sdk.auth.find(accountName || config.get(`${authConfigEnvSpecifier}.defaultAccount`));

if (accountName) {
if (!account) {
throw new Error(`Account "${accountName}" not found`);
} else if (!account.isPlatform) {
} else if (!bypassPlatformAccountCheck && !account.isPlatform) {
throw new Error(`Account "${accountName}" is not a platform account\n\nTo login, run: axway auth login`);
}
} else if (!account || !account.isPlatform) {
} else if (!account || (!bypassPlatformAccountCheck && !account.isPlatform)) {
throw new Error('You must be logged into a platform account\n\nTo login, run: axway auth login');
}

Expand Down
4 changes: 4 additions & 0 deletions packages/amplify-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v4.0.15 (Nov 21, 2024)

- chore: Updated dependencies.

# v4.0.14 (July 3, 2024)

- chore: Updated dependencies.
Expand Down
4 changes: 2 additions & 2 deletions packages/amplify-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axway/amplify-config",
"version": "4.0.15",
"version": "4.0.16",
"publishConfig": {
"access": "public"
},
Expand All @@ -24,7 +24,7 @@
"test": "gulp test"
},
"dependencies": {
"@axway/amplify-utils": "^1.0.15",
"@axway/amplify-utils": "^1.0.16",
"config-kit": "^1.7.2",
"fs-extra": "^10.1.0",
"source-map-support": "^0.5.21"
Expand Down
4 changes: 4 additions & 0 deletions packages/amplify-request/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v3.1.6 (Nov 21, 2024)

- chore: Updated dependencies.

# v3.1.5 (July 3, 2024)

- chore: Updated dependencies.
Expand Down
4 changes: 2 additions & 2 deletions packages/amplify-request/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axway/amplify-request",
"version": "3.1.6",
"version": "3.1.7",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -28,7 +28,7 @@
"test": "gulp test"
},
"dependencies": {
"@axway/amplify-utils": "^1.0.15",
"@axway/amplify-utils": "^1.0.16",
"got": "^11.8.5",
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.1",
Expand Down
5 changes: 5 additions & 0 deletions packages/amplify-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v3.2.15 (Nov 21, 2024)

- fix: Remove Platform logout confirmation dialog when using axway cli auth logout.
([APIGOV-29233](https://jira.axway.com/browse/APIGOV-29233))

# v3.2.14 (July 3, 2024)

- chore: Updated dependencies.
Expand Down
6 changes: 3 additions & 3 deletions packages/amplify-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axway/amplify-sdk",
"version": "3.2.15",
"version": "3.2.16",
"publishConfig": {
"access": "public"
},
Expand All @@ -23,8 +23,8 @@
"test": "gulp test"
},
"dependencies": {
"@axway/amplify-request": "^3.1.6",
"@axway/amplify-utils": "^1.0.15",
"@axway/amplify-request": "^3.1.7",
"@axway/amplify-utils": "^1.0.16",
"ci-info": "^3.3.1",
"ejs": "^3.1.7",
"fs-extra": "^10.1.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/amplify-sdk/src/amplify-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default class AmplifySDK {
*
* @param {Object} opts - Authentication options.
* @param {Object} [opts.env=prod] - The environment name.
* @param {Object} [opts.region=us] - The region name.
* @param {Object} [opts.requestOptions] - HTTP request options with proxy settings and such to
* create a `got` HTTP client.
* @access public
Expand All @@ -48,7 +49,7 @@ export default class AmplifySDK {
* Resolved environment-specific settings.
* @type {Object}
*/
this.env = environments.resolve(opts.env);
this.env = environments.resolve(opts.env, opts.region);

// set the defaults based on the environment
for (const prop of [ 'baseUrl', 'platformUrl', 'realm' ]) {
Expand Down Expand Up @@ -403,7 +404,7 @@ export default class AmplifySDK {
for (const account of accounts) {
if (account.isPlatform && !account.isPlatformTooling) {
// note: there should only be 1 platform account in the accounts list
const { platformUrl } = environments.resolve(account.auth.env);
const { platformUrl } = environments.resolve(account.auth.env, this.opts.region);
const redirect = `${platformUrl}/signed.out?msg=signout`;
const url = `${platformUrl}/auth/signout?redirect=${encodeURIComponent(redirect)}`;
if (typeof opts.onOpenBrowser === 'function') {
Expand Down
10 changes: 7 additions & 3 deletions packages/amplify-sdk/src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default class Auth {
* @param {String} [opts.clientId] - The client id to specify when authenticating.
* @param {String} [opts.clientSecret] - The secret token to use to authenticate.
* @param {String} [opts.env=prod] - The environment name. Must be `staging` or `prod`.
* @param {String} [opts.region=us] - The region name. Must be `us` or `eu`.
* The environment is a shorthand way of specifying a Axway default base URL.
* @param {Function} [opts.got] - A reference to a `got` HTTP client. If not defined, the
* default `got` instance will be used.
Expand Down Expand Up @@ -118,7 +119,8 @@ export default class Auth {
username: { value: opts.username }
});

this.env = environments.resolve(opts.env).name;
this.env = environments.resolve(opts.env, opts.region).name;
this.region = opts.region;

if (opts.tokenStore) {
if (!(opts.tokenStore instanceof TokenStore)) {
Expand Down Expand Up @@ -188,7 +190,8 @@ export default class Auth {
}

const name = opts.env || this.env;
const env = environments.resolve(name);
const region = opts.region || this.region;
const env = environments.resolve(name, region);
if (!env) {
throw E.INVALID_VALUE(`Invalid environment: ${name}`);
}
Expand All @@ -206,6 +209,7 @@ export default class Auth {
persistSecrets: opts.persistSecrets !== undefined ? opts.persistSecrets : this.persistSecrets,
platformUrl: opts.platformUrl || this.platformUrl,
realm: opts.realm || this.realm,
region: region,
secretFile: opts.secretFile || this.secretFile,
serviceAccount: opts.serviceAccount || this.serviceAccount,
timeout: opts.timeout || opts.interactiveLoginTimeout || this.interactiveLoginTimeout,
Expand Down Expand Up @@ -455,7 +459,7 @@ export default class Auth {
for (const entry of revoked) {
// don't logout of platform accounts here, it's done in the Amplify SDK by opening the browser
if (!entry.isPlatform) {
const { platformUrl } = environments.resolve(entry.auth.env);
const { platformUrl } = environments.resolve(entry.auth.env, this.region);
const url = `${platformUrl}/auth/signout?id_token_hint=${entry.auth.tokens.id_token}`;
try {
const { statusCode } = await this.got(url, { responseType: 'json', retry: 0 });
Expand Down
3 changes: 2 additions & 1 deletion packages/amplify-sdk/src/authenticators/authenticator.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
* endpoints are: `auth`, `certs`, `logout`, `token`, `userinfo`, and `wellKnown`.
* @param {String} [opts.env=prod] - The environment name. Must be `staging` or `prod`.
* The environment is a shorthand way of specifying a Axway default base URL.
* @param {String} [opts.region=us] - The region name. Must be `us` or `eu`.
* @param {Boolean} [opts.persistSecrets] - When `true`, adds the authenticator params
* (client secret, private key, username/password) to the authenticated account object so that
* the access token can be refreshed when a refresh token is not available.
Expand All @@ -113,7 +114,7 @@
}

// check the environment
this.env = environments.resolve(opts.env);
this.env = environments.resolve(opts.env, opts.region);

// process the base URL
if (opts.baseUrl) {
Expand Down Expand Up @@ -535,9 +536,9 @@
log(`Starting ${opts.manual ? 'manual ' : ''}login request clientId=${highlight(this.clientId)} realm=${highlight(this.realm)}`);

const loginAccount = codeCallback.start().then(async () => {
return await orgSelectedCallback.start()

Check warning on line 539 in packages/amplify-sdk/src/authenticators/authenticator.js

View workflow job for this annotation

GitHub Actions / Lint

Avoid nesting promises

Check warning on line 539 in packages/amplify-sdk/src/authenticators/authenticator.js

View workflow job for this annotation

GitHub Actions / Lint

Avoid nesting promises
.then(async (res) => {
if (res) {

Check warning on line 541 in packages/amplify-sdk/src/authenticators/authenticator.js

View workflow job for this annotation

GitHub Actions / Lint

Each then() should return a value or throw

Check warning on line 541 in packages/amplify-sdk/src/authenticators/authenticator.js

View workflow job for this annotation

GitHub Actions / Lint

Each then() should return a value or throw
await this.timeout();
return await this.getToken(undefined, undefined, true);
}
Expand Down
27 changes: 22 additions & 5 deletions packages/amplify-sdk/src/environments.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ export const environments = {
realm: 'Broker'
},
prod: {
baseUrl: 'https://login.axway.com',
platformUrl: 'https://platform.axway.com',
realm: 'Broker'
us: {
baseUrl: 'https://login.axway.com',
platformUrl: 'https://platform.axway.com',
realm: 'Broker'
},
eu: {
baseUrl: 'https://login.eu-fr.axway.com',
platformUrl: 'https://platform.eu-fr.axway.com',
realm: 'Broker'
},
}
};

Expand All @@ -26,8 +33,9 @@ const mapping = {
test: 'staging'
};

export function resolve(env) {
export function resolve(env, reg) {
let environment = 'prod';
let region = 'us';
if (env) {
if (typeof env !== 'string') {
throw new TypeError('Expected environment to be a string');
Expand All @@ -38,9 +46,18 @@ export function resolve(env) {
throw new Error(`Invalid environment "${env}"`);
}
}
if (reg) {
if (typeof reg !== 'string') {
throw new TypeError('Expected region to be a string');
}
region = reg.toLowerCase();
if (!environments[environment][region]) {
throw new Error(`Invalid region "${reg}" for environment "${env}"`);
}
}

return {
name: environment,
...environments[environment]
...environments[environment][region]
};
}
4 changes: 4 additions & 0 deletions packages/amplify-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v1.0.15 (Nov 21, 2024)

- chore: Updated dependencies.

# v1.0.14 (July 3, 2024)

- chore: Updated dependencies.
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axway/amplify-utils",
"version": "1.0.15",
"version": "1.0.16",
"publishConfig": {
"access": "public"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/axway-cli-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v3.3.15 (Nov 21, 2024)

- chore: Updated dependencies.

# v3.3.14 (July 3, 2024)

- chore: Updated dependencies.
Expand Down
6 changes: 3 additions & 3 deletions packages/axway-cli-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axway/axway-cli-auth",
"version": "3.3.15",
"version": "3.3.16",
"publishConfig": {
"access": "public"
},
Expand All @@ -23,8 +23,8 @@
"test": "gulp test"
},
"dependencies": {
"@axway/amplify-cli-utils": "^5.0.19",
"@axway/amplify-utils": "^1.0.15",
"@axway/amplify-cli-utils": "^5.0.20",
"@axway/amplify-utils": "^1.0.16",
"cli-kit": "^1.16.0",
"enquirer": "^2.3.6",
"pretty-ms": "^7.0.1",
Expand Down
Loading
Loading