Skip to content

Commit

Permalink
Merge pull request #47 from akamai/release/3.1.0
Browse files Browse the repository at this point in the history
Release/3.1.0 --> Master
  • Loading branch information
atuljain16 authored Dec 3, 2024
2 parents 6a00380 + 5b856f4 commit 6ec9ebd
Show file tree
Hide file tree
Showing 23 changed files with 1,093 additions and 257 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 3.1.0 (December 2024 Release)

- New Commands:
- `account-protection-transactional-endpoint-list` Display List of all account protected transactional endpoints.
- `account-protection-transactional-endpoint` Get a transactional endpoint by operation id for account protection.
- `create-account-protection-transactional-endpoint-list` Create List of transactional endpoints for account protection.
- `modify-account-protection-transactional-endpoint` Update a transactional endpoint for account protection.
- `delete-account-protection-transactional-endpoint` Delete a account protected transactional endpoint.
- `account-protection-settings` Display account protection settings for a security policy.
- `modify-account-protection-settings` Modify account protection settings for a security policy.
- `account-protection-transactional-endpoint-protection` Display account protected advanced settings for transactional endpoints.
- `modify-account-protection-transactional-endpoint-protection` Modify account protected advanced settings for transactional endpoints.
- `account-protection-user-allow-list-id` Display user allow list id for account protection.
- `modify-account-protection-user-allow-list-id` Modify user allow list id for account protection.
- `delete-account-protection-user-allow-list-id` Delete user allow list id for account protection.
- `account-protection-risk-actions` Display allowed risk actions for account protected endpoints.

## 3.0.0 (August 2024 Release)

- New Commands:
Expand Down
517 changes: 265 additions & 252 deletions README.md

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions bin/commands/accountprotectionadvancedsettingstep.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
let AccountProtectionAdvancedSettings = require('../../src/accountprotectionadvancedsettings')
.accountProtectionAdvancedSettings;
let out = require('./lib/out');

class GetAccountProtectionTransactionEndpointProtectionCommand {
constructor() {
this.flags = 'account-protection-transactional-endpoint-protection';
this.desc = 'Display account protected advanced settings for transactional endpoints.';
this.setup = this.setup.bind(this);
this.run = this.run.bind(this);
}

setup(sywac) {
sywac
.number('--config <id>', {
desc: 'Configuration ID. Mandatory if you have more than one configuration.',
group: 'Optional:',
required: false
})
.string('--version <id>', {
desc:
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.",
group: 'Optional:',
required: false
});
}
run(options) {
out.print({
promise: new AccountProtectionAdvancedSettings(options).getTransactionalEndpointProtection(),
args: options,
success: (args, data) => {
return JSON.stringify(data);
}
});
}
}

module.exports = new GetAccountProtectionTransactionEndpointProtectionCommand();
50 changes: 50 additions & 0 deletions bin/commands/accountprotectionadvancedsettingstep.modify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
let AccountProtectionAdvancedSettings = require('../../src/accountprotectionadvancedsettings')
.accountProtectionAdvancedSettings;
let out = require('./lib/out');

class ModifyAccountProtectionTransactionEndpointProtectionCommand {
constructor() {
this.flags = 'modify-account-protection-transactional-endpoint-protection';
this.desc = 'Modify account protected advanced settings for transactional endpoints.';
this.setup = this.setup.bind(this);
this.run = this.run.bind(this);
}

setup(sywac) {
sywac
.positional('<@path>', {
paramsDesc: 'The input file path.'
})
.number('--config <id>', {
desc: 'Configuration ID. Mandatory if you have more than one configuration.',
group: 'Optional:',
required: false
})
.string('--version <id>', {
desc:
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.",
group: 'Optional:',
required: false
})
.check((argv, context) => {
if (!argv['@path'].startsWith('@')) {
return context.cliMessage("ERROR: Invalid file name, should start with '@'");
}
});
}
run(options) {
options.file = options['@path'].replace('@', '');

out.print({
promise: new AccountProtectionAdvancedSettings(
options
).updateTransactionalEndpointProtection(),
args: options,
success: (args, data) => {
return JSON.stringify(data);
}
});
}
}

module.exports = new ModifyAccountProtectionTransactionEndpointProtectionCommand();
38 changes: 38 additions & 0 deletions bin/commands/accountprotectionriskactions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
let AccountProtectionRiskActions = require('../../src/accountprotectionriskactions')
.accountProtectionRiskAction;
let out = require('./lib/out');

class GetAccountProtectionRiskActionsCommand {
constructor() {
this.flags = 'account-protection-risk-actions';
this.desc = 'Display allowed risk actions for account protected endpoints.';
this.setup = this.setup.bind(this);
this.run = this.run.bind(this);
}

setup(sywac) {
sywac
.number('--config <id>', {
desc: 'Configuration ID. Mandatory if you have more than one configuration.',
group: 'Optional:',
required: false
})
.string('--version <id>', {
desc:
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.",
group: 'Optional:',
required: false
});
}
run(options) {
out.print({
promise: new AccountProtectionRiskActions(options).getRiskActions(),
args: options,
success: (args, data) => {
return JSON.stringify(data);
}
});
}
}

module.exports = new GetAccountProtectionRiskActionsCommand();
44 changes: 44 additions & 0 deletions bin/commands/accountprotectionsettings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
let AccountProtectionPolicySettings = require('../../src/accountprotectionpolicysettings')
.accountProtectionPolicySettings;
let out = require('./lib/out');

class GetAccountProtectionSettingsCommand {
constructor() {
this.flags = 'account-protection-settings';
this.desc = 'Display account protection settings for a security policy.';
this.setup = this.setup.bind(this);
this.run = this.run.bind(this);
}

setup(sywac) {
sywac
.number('--config <id>', {
desc: 'Configuration ID. Mandatory if you have more than one configuration.',
group: 'Optional:',
required: false
})
.string('--version <id>', {
desc:
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.",
group: 'Optional:',
required: false
})
.string('--policy <id>', {
desc:
'Policy ID. If not provided, we try to use the policy available on file. If you have more than one policy, this option must be provided.',
group: 'Optional:',
required: false
});
}
run(options) {
out.print({
promise: new AccountProtectionPolicySettings(options).getAccountProtectionSettings(),
args: options,
success: (args, data) => {
return JSON.stringify(data);
}
});
}
}

module.exports = new GetAccountProtectionSettingsCommand();
54 changes: 54 additions & 0 deletions bin/commands/accountprotectionsettings.modify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
let AccountProtectionPolicySettings = require('../../src/accountprotectionpolicysettings')
.accountProtectionPolicySettings;
let out = require('./lib/out');

class ModifyAccountProtectionSettingsCommand {
constructor() {
this.flags = 'modify-account-protection-settings';
this.desc = 'Modify account protection settings for a security policy.';
this.setup = this.setup.bind(this);
this.run = this.run.bind(this);
}

setup(sywac) {
sywac
.positional('<@path>', {
paramsDesc: 'The input file path.'
})
.number('--config <id>', {
desc: 'Configuration ID. Mandatory if you have more than one configuration.',
group: 'Optional:',
required: false
})
.string('--version <id>', {
desc:
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.",
group: 'Optional:',
required: false
})
.string('--policy <id>', {
desc:
'Policy ID. If not provided, we try to use the policy available on file. If you have more than one policy, this option must be provided.',
group: 'Optional:',
required: false
})
.check((argv, context) => {
if (!argv['@path'].startsWith('@')) {
return context.cliMessage("ERROR: Invalid file name, should start with '@'");
}
});
}
run(options) {
options.file = options['@path'].replace('@', '');

out.print({
promise: new AccountProtectionPolicySettings(options).updateAccountProtectionSettings(),
args: options,
success: (args, data) => {
return JSON.stringify(data);
}
});
}
}

module.exports = new ModifyAccountProtectionSettingsCommand();
51 changes: 51 additions & 0 deletions bin/commands/accountprotectiontransactionalendpoint.delete.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
let AccountProtectionTransactionalEndpoint = require('../../src/accountprotectiontransactionalendpoint')
.accountProtectionTransactionalEndpoint;
let out = require('./lib/out');

const objectType = 'operations';

class DeleteAccountProtectionTransactionEndpointCommand {
constructor() {
this.flags = 'delete-account-protection-transactional-endpoint';
this.desc = 'Delete account protection transactional endpoint by operation id.';
this.setup = this.setup.bind(this);
this.run = this.run.bind(this);
}

setup(sywac) {
sywac
.positional('<operation-id>', {
paramsDesc: 'Operation ID'
})
.number('--config <id>', {
desc: 'Configuration ID. Mandatory if you have more than one configuration.',
group: 'Optional:',
required: false
})
.string('--version <id>', {
desc:
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.",
group: 'Optional:',
required: false
})
.string('--policy <id>', {
desc:
'Policy ID. If not provided, we try to use the policy available on file. If you have more than one policy, this option must be provided.',
group: 'Optional:',
required: false
});
}
run(options) {
options.operation_id = options['operation-id'];

out.print({
promise: new AccountProtectionTransactionalEndpoint(options).deleteTransactionalEndpoint(),
args: options,
success: (args, data) => {
return data;
}
});
}
}

module.exports = new DeleteAccountProtectionTransactionEndpointCommand();
51 changes: 51 additions & 0 deletions bin/commands/accountprotectiontransactionalendpoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
let AccountProtectionTransactionalEndpoint = require('../../src/accountprotectiontransactionalendpoint')
.accountProtectionTransactionalEndpoint;
let out = require('./lib/out');

const objectType = 'operations';

class GetAccountProtectionTransactionEndpointCommand {
constructor() {
this.flags = 'account-protection-transactional-endpoint';
this.desc = 'Get a transactional endpoint by operation id for account protection.';
this.setup = this.setup.bind(this);
this.run = this.run.bind(this);
}

setup(sywac) {
sywac
.positional('<operation-id>', {
paramsDesc: 'Operation ID'
})
.number('--config <id>', {
desc: 'Configuration ID. Mandatory if you have more than one configuration.',
group: 'Optional:',
required: false
})
.string('--version <id>', {
desc:
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.",
group: 'Optional:',
required: false
})
.string('--policy <id>', {
desc:
'Policy ID. If not provided, we try to use the policy available on file. If you have more than one policy, this option must be provided.',
group: 'Optional:',
required: false
});
}
run(options) {
options.operation_id = options['operation-id'];

out.print({
promise: new AccountProtectionTransactionalEndpoint(options).getTransactionalEndpointById(),
args: options,
success: (args, data) => {
return data;
}
});
}
}

module.exports = new GetAccountProtectionTransactionEndpointCommand();
Loading

0 comments on commit 6ec9ebd

Please sign in to comment.