@adobe/aio-cli-plugin-api-mesh 5.3.2-beta.1 → 5.3.2-beta.2

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.
@@ -1 +1 @@
1
- {"version":"5.3.2-beta.1","commands":{"api-mesh":{"id":"api-mesh","description":"Create, run, test, and deploy API Mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{},"args":[]},"api-mesh:create":{"id":"api-mesh:create","description":"Create a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:delete":{"id":"api-mesh:delete","description":"Delete the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false}},"args":[]},"api-mesh:describe":{"id":"api-mesh:describe","description":"Get details of a mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:get":{"id":"api-mesh:get","description":"Get the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[{"name":"file"}]},"api-mesh:init":{"id":"api-mesh:init","description":"This command will create a workspace where you can organise your API mesh configuration and other files","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[{"description":"API mesh workspace init","command":"aio api-mesh init commerce-mesh"},{"description":"API mesh workspace init with flags","command":"aio api-mesh init commerce-mesh --path ./mesh_projects/test_mesh --git y --packageManager yarn"}],"flags":{"path":{"name":"path","type":"option","char":"p","default":"."},"packageManager":{"name":"packageManager","type":"option","char":"m","options":["npm","yarn"]},"git":{"name":"git","type":"option","char":"g","options":["y","n"]}},"args":[{"name":"projectName","description":"Project name","required":true}]},"api-mesh:log-get-bulk":{"id":"api-mesh:log-get-bulk","description":"Download all mesh logs for a selected time period.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"startTime":{"name":"startTime","type":"option","description":"Start time for the logs in UTC"},"endTime":{"name":"endTime","type":"option","description":"End time for the logs in UTC"},"filename":{"name":"filename","type":"option","description":"Path to the output file for logs","required":true},"past":{"name":"past","type":"option","description":"Past time window in minutes"}},"args":[]},"api-mesh:log-get":{"id":"api-mesh:log-get","description":"Get the Log of a given mesh by RayId","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[{"name":"rayId","description":"Fetch a single log by rayID","required":true}]},"api-mesh:log-list":{"id":"api-mesh:log-list","description":"Get recent logs of requests made to the API Mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"filename":{"name":"filename","type":"option","description":"Name of CSV file to export the recent logs to"}},"args":[]},"api-mesh:run":{"id":"api-mesh:run","description":"Run a local development server that builds and compiles a mesh locally","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"Port number for the local dev server","default":5000},"inspectPort":{"name":"inspectPort","type":"option","char":"i","description":"Port number for the local dev server inspector","default":9229},"debug":{"name":"debug","type":"boolean","description":"Enable debugging mode","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"select":{"name":"select","type":"boolean","description":"Retrieve existing artifacts from the mesh","allowNo":false},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file","description":"Mesh File"}]},"api-mesh:status":{"id":"api-mesh:status","description":"Get a mesh status with a given meshid.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:update":{"id":"api-mesh:update","description":"Update a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:cache:purge":{"id":"api-mesh:cache:purge","description":"Cache purge for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"all":{"name":"all","type":"boolean","char":"a","description":"Purge all cache. CLI will purge all cache data.","required":true,"allowNo":false}},"args":[]},"api-mesh:config":{"id":"api-mesh:config","description":"Manage the configuration for API Mesh.\n\nThe 'config' command includes the following options:\n- set: Set log forwarding details for a given mesh.\n- get: Retrieve log forwarding details for a given mesh.\n- delete: Delete log forwarding details for a given mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{},"args":[]},"api-mesh:source:discover":{"id":"api-mesh:source:discover","description":"Return the list of avaliable sources","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm install action prompt. CLI will not check ask user to install source.","allowNo":false}},"args":[]},"api-mesh:source:get":{"id":"api-mesh:source:get","description":"Command returns the content of a specific source.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:get -s=<version>@<source_name>","$ aio api-mesh:source:get -s<source_name>","$ aio api-mesh:source:get -m"],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm print action prompt. CLI will not check ask user to print source.","allowNo":false},"source":{"name":"source","type":"option","char":"s","description":"Source name"},"multiple":{"name":"multiple","type":"boolean","char":"m","description":"Select multiple sources","allowNo":false}},"args":[]},"api-mesh:source:install":{"id":"api-mesh:source:install","description":"Command to install the source to your API mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:install <version>@<source_name>","$ aio api-mesh:source:install <source_name> -v <variable_name>=<variable_value>","$ aio api-mesh:source:install <source_name> -f <path_to_variables_file>"],"flags":{"source":{"name":"source","type":"option","char":"s","description":"Source name"},"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm override action prompt. CLI will not check ask user to override source.","allowNo":false},"variable":{"name":"variable","type":"option","char":"v","description":"Variables required for the source"},"variable-file":{"name":"variable-file","type":"option","char":"f","description":"Variables file path"},"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[{"name":"source"}]},"api-mesh:config:delete:log-forwarding":{"id":"api-mesh:config:delete:log-forwarding","description":"Delete log forwarding details for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false}},"args":[]},"api-mesh:config:get:log-forwarding":{"id":"api-mesh:config:get:log-forwarding","description":"Get log forwarding details for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[]},"api-mesh:config:set:log-forwarding":{"id":"api-mesh:config:set:log-forwarding","description":"Sets the log forwarding destination for API mesh. \n- Select a log forwarding destination - Choose from available options (for example, New Relic).\n- Enter the base URI - Provide the URI for the log forwarding service. Ensure it includes the protocol (for example, if the hosted region of the New Relic account is the U.S, the base URI could be 'https://log-api.newrelic.com/log/v1').\n- Enter the license key - Provide the INGEST-LICENSE API key type.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[]}}}
1
+ {"version":"5.3.2-beta.2","commands":{"api-mesh":{"id":"api-mesh","description":"Create, run, test, and deploy API Mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{},"args":[]},"api-mesh:create":{"id":"api-mesh:create","description":"Create a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:delete":{"id":"api-mesh:delete","description":"Delete the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false}},"args":[]},"api-mesh:describe":{"id":"api-mesh:describe","description":"Get details of a mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:get":{"id":"api-mesh:get","description":"Get the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[{"name":"file"}]},"api-mesh:init":{"id":"api-mesh:init","description":"This command will create a workspace where you can organise your API mesh configuration and other files","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[{"description":"API mesh workspace init","command":"aio api-mesh init commerce-mesh"},{"description":"API mesh workspace init with flags","command":"aio api-mesh init commerce-mesh --path ./mesh_projects/test_mesh --git y --packageManager yarn"}],"flags":{"path":{"name":"path","type":"option","char":"p","default":"."},"packageManager":{"name":"packageManager","type":"option","char":"m","options":["npm","yarn"]},"git":{"name":"git","type":"option","char":"g","options":["y","n"]}},"args":[{"name":"projectName","description":"Project name","required":true}]},"api-mesh:log-get-bulk":{"id":"api-mesh:log-get-bulk","description":"Download all mesh logs for a selected time period.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"startTime":{"name":"startTime","type":"option","description":"Start time for the logs in UTC"},"endTime":{"name":"endTime","type":"option","description":"End time for the logs in UTC"},"filename":{"name":"filename","type":"option","description":"Path to the output file for logs","required":true},"past":{"name":"past","type":"option","description":"Past time window in minutes"}},"args":[]},"api-mesh:log-get":{"id":"api-mesh:log-get","description":"Get the Log of a given mesh by RayId","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[{"name":"rayId","description":"Fetch a single log by rayID","required":true}]},"api-mesh:log-list":{"id":"api-mesh:log-list","description":"Get recent logs of requests made to the API Mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"filename":{"name":"filename","type":"option","description":"Name of CSV file to export the recent logs to"}},"args":[]},"api-mesh:run":{"id":"api-mesh:run","description":"Run a local development server that builds and compiles a mesh locally","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"Port number for the local dev server","default":5000},"inspectPort":{"name":"inspectPort","type":"option","char":"i","description":"Port number for the local dev server inspector","default":9229},"debug":{"name":"debug","type":"boolean","description":"Enable debugging mode","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"select":{"name":"select","type":"boolean","description":"Retrieve existing artifacts from the mesh","allowNo":false},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file","description":"Mesh File"}]},"api-mesh:status":{"id":"api-mesh:status","description":"Get a mesh status with a given meshid.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:update":{"id":"api-mesh:update","description":"Update a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:cache:purge":{"id":"api-mesh:cache:purge","description":"Cache purge for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"all":{"name":"all","type":"boolean","char":"a","description":"Purge all cache. CLI will purge all cache data.","required":true,"allowNo":false}},"args":[]},"api-mesh:config":{"id":"api-mesh:config","description":"Manage the configuration for API Mesh.\n\nThe 'config' command includes the following options:\n- set: Set log forwarding details for a given mesh.\n- get: Retrieve log forwarding details for a given mesh.\n- delete: Delete log forwarding details for a given mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{},"args":[]},"api-mesh:source:discover":{"id":"api-mesh:source:discover","description":"Return the list of avaliable sources","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm install action prompt. CLI will not check ask user to install source.","allowNo":false}},"args":[]},"api-mesh:source:get":{"id":"api-mesh:source:get","description":"Command returns the content of a specific source.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:get -s=<version>@<source_name>","$ aio api-mesh:source:get -s<source_name>","$ aio api-mesh:source:get -m"],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm print action prompt. CLI will not check ask user to print source.","allowNo":false},"source":{"name":"source","type":"option","char":"s","description":"Source name"},"multiple":{"name":"multiple","type":"boolean","char":"m","description":"Select multiple sources","allowNo":false}},"args":[]},"api-mesh:source:install":{"id":"api-mesh:source:install","description":"Command to install the source to your API mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:install <version>@<source_name>","$ aio api-mesh:source:install <source_name> -v <variable_name>=<variable_value>","$ aio api-mesh:source:install <source_name> -f <path_to_variables_file>"],"flags":{"source":{"name":"source","type":"option","char":"s","description":"Source name"},"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm override action prompt. CLI will not check ask user to override source.","allowNo":false},"variable":{"name":"variable","type":"option","char":"v","description":"Variables required for the source"},"variable-file":{"name":"variable-file","type":"option","char":"f","description":"Variables file path"},"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[{"name":"source"}]},"api-mesh:config:delete:log-forwarding":{"id":"api-mesh:config:delete:log-forwarding","description":"Delete log forwarding details for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false}},"args":[]},"api-mesh:config:get:log-forwarding":{"id":"api-mesh:config:get:log-forwarding","description":"Get log forwarding details for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[]},"api-mesh:config:set:log-forwarding":{"id":"api-mesh:config:set:log-forwarding","description":"Sets the log forwarding destination for API mesh. \n- Select a log forwarding destination - Choose from available options (for example, New Relic).\n- Enter the base URI - Provide the URI for the log forwarding service. Ensure it includes the protocol (for example, if the hosted region of the New Relic account is the U.S, the base URI could be 'https://log-api.newrelic.com/log/v1').\n- Enter the license key - Provide the INGEST-LICENSE API key type.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[]}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aio-cli-plugin-api-mesh",
3
- "version": "5.3.2-beta.1",
3
+ "version": "5.3.2-beta.2",
4
4
  "description": "Adobe I/O CLI plugin to develop and manage API mesh sources",
5
5
  "keywords": [
6
6
  "oclif-plugin"
@@ -11,6 +11,7 @@ governing permissions and limitations under the License.
11
11
  */
12
12
 
13
13
  const SetLogForwardingCommand = require('../config/set/log-forwarding');
14
+ const crypto = require('crypto');
14
15
  const {
15
16
  initSdk,
16
17
  promptConfirm,
@@ -18,7 +19,7 @@ const {
18
19
  promptInput,
19
20
  promptInputSecret,
20
21
  } = require('../../../helpers');
21
- const { getMeshId, setLogForwarding } = require('../../../lib/smsClient');
22
+ const { getMeshId, setLogForwarding, getPublicEncryptionKey } = require('../../../lib/smsClient');
22
23
 
23
24
  jest.mock('../../../helpers', () => ({
24
25
  initSdk: jest.fn().mockResolvedValue({}),
@@ -31,6 +32,21 @@ jest.mock('../../../helpers', () => ({
31
32
  jest.mock('../../../lib/smsClient');
32
33
  jest.mock('../../../classes/logger');
33
34
 
35
+ jest.mock('crypto');
36
+ // Mock randomBytes for aesKey and iv
37
+ const mockAesKey = Buffer.from('mockAesKey');
38
+ const mockIv = Buffer.from('mockIv');
39
+ const mockEncryptedAesKey = Buffer.from('mockEncryptedAesKey');
40
+ const mockCipher = {
41
+ update: jest.fn().mockReturnValueOnce('mockEncryptedData'),
42
+ final: jest.fn().mockReturnValueOnce(''),
43
+ };
44
+ const mockEncryptedLicenseKey = {
45
+ iv: 'bW9ja0l2',
46
+ key: 'bW9ja0VuY3J5cHRlZEFlc0tleQ==',
47
+ data: 'mockEncryptedData',
48
+ };
49
+
34
50
  describe('SetLogForwardingCommand', () => {
35
51
  let parseSpy;
36
52
  let logSpy;
@@ -60,8 +76,13 @@ describe('SetLogForwardingCommand', () => {
60
76
  workspaceName: 'workspaceName',
61
77
  });
62
78
  getMeshId.mockResolvedValue('meshId');
79
+ getPublicEncryptionKey.mockResolvedValue('dummy_public_key');
63
80
  setLogForwarding.mockResolvedValue({ success: true, result: true });
64
81
  global.requestId = 'dummy_request_id';
82
+
83
+ // Reset mockCipher methods
84
+ mockCipher.update.mockReset().mockReturnValueOnce('mockEncryptedData');
85
+ mockCipher.final.mockReset().mockReturnValueOnce('');
65
86
  });
66
87
 
67
88
  afterEach(() => {
@@ -71,6 +92,10 @@ describe('SetLogForwardingCommand', () => {
71
92
  describe('Test New Relic destination', () => {
72
93
  /** Success Scenario */
73
94
  test('sets log forwarding with valid parameters', async () => {
95
+ crypto.randomBytes.mockReturnValueOnce(mockAesKey).mockReturnValueOnce(mockIv);
96
+ crypto.createCipheriv.mockReturnValueOnce(mockCipher);
97
+ crypto.publicEncrypt.mockReturnValueOnce(mockEncryptedAesKey);
98
+
74
99
  const command = new SetLogForwardingCommand([], {});
75
100
  await command.run();
76
101
 
@@ -88,7 +113,7 @@ describe('SetLogForwardingCommand', () => {
88
113
  destination: 'newrelic',
89
114
  config: {
90
115
  baseUri: 'https://log-api.newrelic.com/log/v1',
91
- licenseKey: 'abcdef0123456789abcdef0123456789abcdef01',
116
+ licenseKey: JSON.stringify(mockEncryptedLicenseKey), // Expect the encrypted value
92
117
  },
93
118
  },
94
119
  );
@@ -126,6 +151,10 @@ describe('SetLogForwardingCommand', () => {
126
151
  args: [],
127
152
  });
128
153
 
154
+ crypto.randomBytes.mockReturnValueOnce(mockAesKey).mockReturnValueOnce(mockIv);
155
+ crypto.createCipheriv.mockReturnValueOnce(mockCipher);
156
+ crypto.publicEncrypt.mockReturnValueOnce(mockEncryptedAesKey);
157
+
129
158
  const command = new SetLogForwardingCommand([], {});
130
159
  await command.run();
131
160
 
@@ -186,6 +215,10 @@ describe('SetLogForwardingCommand', () => {
186
215
  args: [],
187
216
  });
188
217
 
218
+ crypto.randomBytes.mockReturnValueOnce(mockAesKey).mockReturnValueOnce(mockIv);
219
+ crypto.createCipheriv.mockReturnValueOnce(mockCipher);
220
+ crypto.publicEncrypt.mockReturnValueOnce(mockEncryptedAesKey);
221
+
189
222
  const command = new SetLogForwardingCommand([], {});
190
223
  await command.run();
191
224
 
@@ -194,6 +227,10 @@ describe('SetLogForwardingCommand', () => {
194
227
  });
195
228
 
196
229
  test('sets log forwarding with auto-confirmation', async () => {
230
+ crypto.randomBytes.mockReturnValueOnce(mockAesKey).mockReturnValueOnce(mockIv);
231
+ crypto.createCipheriv.mockReturnValueOnce(mockCipher);
232
+ crypto.publicEncrypt.mockReturnValueOnce(mockEncryptedAesKey);
233
+
197
234
  parseSpy.mockResolvedValueOnce({
198
235
  flags: {
199
236
  ignoreCache: false,
@@ -216,7 +253,7 @@ describe('SetLogForwardingCommand', () => {
216
253
  destination: 'newrelic',
217
254
  config: {
218
255
  baseUri: 'https://log-api.newrelic.com/log/v1',
219
- licenseKey: 'abcdef0123456789abcdef0123456789abcdef01',
256
+ licenseKey: JSON.stringify(mockEncryptedLicenseKey), // Expect the encrypted value
220
257
  },
221
258
  },
222
259
  );
@@ -227,6 +264,10 @@ describe('SetLogForwardingCommand', () => {
227
264
  const errorMessage = 'Unable to set log forwarding details';
228
265
  setLogForwarding.mockRejectedValueOnce(new Error(errorMessage));
229
266
 
267
+ crypto.randomBytes.mockReturnValueOnce(mockAesKey).mockReturnValueOnce(mockIv);
268
+ crypto.createCipheriv.mockReturnValueOnce(mockCipher);
269
+ crypto.publicEncrypt.mockReturnValueOnce(mockEncryptedAesKey);
270
+
230
271
  const command = new SetLogForwardingCommand([], {});
231
272
  await expect(command.run()).rejects.toThrow(
232
273
  'Failed to set log forwarding details. Try again. RequestId: dummy_request_id',
@@ -24,8 +24,14 @@ const {
24
24
  autoConfirmActionFlag,
25
25
  jsonFlag,
26
26
  destinations,
27
+ LogForwardingKeys,
28
+ encryptSecrets,
27
29
  } = require('../../../../utils');
28
- const { setLogForwarding, getMeshId } = require('../../../../lib/smsClient');
30
+ const {
31
+ setLogForwarding,
32
+ getMeshId,
33
+ getPublicEncryptionKey,
34
+ } = require('../../../../lib/smsClient');
29
35
 
30
36
  class SetLogForwardingCommand extends Command {
31
37
  static flags = {
@@ -85,6 +91,30 @@ class SetLogForwardingCommand extends Command {
85
91
 
86
92
  if (shouldContinue) {
87
93
  try {
94
+ // Get publicKey for encryption
95
+ const publicKey = await getPublicEncryptionKey(imsOrgCode);
96
+ if (!publicKey) {
97
+ this.error(
98
+ `Unable to set log forwarding details. Unable to get public key. Try again. RequestId: ${global.requestId}`,
99
+ );
100
+ }
101
+ // Get the key to encrypt from config
102
+ const getEncryptableKey = config => {
103
+ if (LogForwardingKeys.LICENSE_KEY in config) return LogForwardingKeys.LICENSE_KEY;
104
+ if (LogForwardingKeys.HEC_TOKEN in config) return LogForwardingKeys.HEC_TOKEN;
105
+ return null;
106
+ };
107
+ const keyToEncrypt = getEncryptableKey(destinationConfig.config);
108
+ if (!keyToEncrypt) {
109
+ this.error(
110
+ `Unable to set log forwarding details. No valid key to encrypt found in the configuration. Try again. RequestId: ${global.requestId}`,
111
+ );
112
+ }
113
+ // Encrypt the key
114
+ destinationConfig.config[keyToEncrypt] = await encryptSecrets(
115
+ publicKey,
116
+ destinationConfig.config[keyToEncrypt],
117
+ );
88
118
  const response = await setLogForwarding(
89
119
  imsOrgCode,
90
120
  projectId,
package/src/utils.js CHANGED
@@ -101,6 +101,11 @@ const logFilenameFlag = Flags.string({
101
101
  required: true,
102
102
  });
103
103
 
104
+ const LogForwardingKeys = {
105
+ LICENSE_KEY: 'licenseKey',
106
+ HEC_TOKEN: 'hecToken',
107
+ };
108
+
104
109
  // The `destinations` object to hold the configuration for log forwarding destinations.
105
110
  // It prompts for the required inputs for the destination.
106
111
  // Each destination can have different key/value pairs of configuration credentials.
@@ -819,4 +824,5 @@ module.exports = {
819
824
  localToUTCTime,
820
825
  cachePurgeAllActionFlag,
821
826
  destinations,
827
+ LogForwardingKeys,
822
828
  };