n8n-nodes-arubaclearpass 1.1.6 → 1.1.8

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.
Files changed (17) hide show
  1. package/dist/nodes/ArubaClearPass/ArubaClearPass.node.js +37 -0
  2. package/dist/nodes/ArubaClearPass/descriptions/LocalServerConfiguration/CppmVersion.descriptions.d.ts +4 -0
  3. package/dist/nodes/ArubaClearPass/descriptions/LocalServerConfiguration/CppmVersion.descriptions.js +25 -0
  4. package/dist/nodes/ArubaClearPass/descriptions/LocalServerConfiguration/ServerConfiguration.descriptions.d.ts +4 -0
  5. package/dist/nodes/ArubaClearPass/descriptions/LocalServerConfiguration/ServerConfiguration.descriptions.js +76 -0
  6. package/dist/nodes/ArubaClearPass/descriptions/LocalServerConfiguration/ServerVersion.descriptions.d.ts +4 -0
  7. package/dist/nodes/ArubaClearPass/descriptions/LocalServerConfiguration/ServerVersion.descriptions.js +25 -0
  8. package/dist/nodes/ArubaClearPass/descriptions/PlatformCertificates/ServerCert.descriptions.js +8 -120
  9. package/dist/nodes/ArubaClearPass/helpers/executeOperation.js +16 -0
  10. package/dist/nodes/ArubaClearPass/methods/LocalServerConfiguration/CppmVersion.methods.d.ts +6 -0
  11. package/dist/nodes/ArubaClearPass/methods/LocalServerConfiguration/CppmVersion.methods.js +29 -0
  12. package/dist/nodes/ArubaClearPass/methods/LocalServerConfiguration/ServerConfiguration.methods.d.ts +18 -0
  13. package/dist/nodes/ArubaClearPass/methods/LocalServerConfiguration/ServerConfiguration.methods.js +83 -0
  14. package/dist/nodes/ArubaClearPass/methods/LocalServerConfiguration/ServerVersion.methods.d.ts +6 -0
  15. package/dist/nodes/ArubaClearPass/methods/LocalServerConfiguration/ServerVersion.methods.js +29 -0
  16. package/dist/nodes/ArubaClearPass/methods/PlatformCertificates/ServerCert.methods.js +11 -46
  17. package/package.json +1 -1
@@ -50,6 +50,10 @@ class ArubaClearPass {
50
50
  name: 'Platform Certificates',
51
51
  value: 'PlatformCertificates',
52
52
  },
53
+ {
54
+ name: 'Local Server Configuration',
55
+ value: 'LocalServerConfiguration',
56
+ },
53
57
  ],
54
58
  default: 'Identities',
55
59
  required: true,
@@ -161,6 +165,33 @@ class ArubaClearPass {
161
165
  required: true,
162
166
  description: 'Resource to consume',
163
167
  },
168
+ {
169
+ displayName: 'Resource',
170
+ name: 'resource',
171
+ type: 'options',
172
+ displayOptions: {
173
+ show: {
174
+ domain: ['LocalServerConfiguration'],
175
+ },
176
+ },
177
+ options: [
178
+ {
179
+ name: 'CPPM Version',
180
+ value: 'CppmVersion',
181
+ },
182
+ {
183
+ name: 'Server Configuration',
184
+ value: 'ServerConfiguration',
185
+ },
186
+ {
187
+ name: 'Server Version',
188
+ value: 'ServerVersion',
189
+ },
190
+ ],
191
+ default: 'ServerConfiguration',
192
+ required: true,
193
+ description: 'Resource to consume',
194
+ },
164
195
  // Import the properties from the descriptions
165
196
  ...require('./descriptions/Identities/Device.descriptions').deviceProperties,
166
197
  ...require('./descriptions/Identities/Endpoint.descriptions').endpointProperties,
@@ -178,6 +209,12 @@ class ArubaClearPass {
178
209
  .serverCertProperties,
179
210
  ...require('./descriptions/PlatformCertificates/SelfSignedCert.descriptions')
180
211
  .selfSignedCertProperties,
212
+ ...require('./descriptions/LocalServerConfiguration/CppmVersion.descriptions')
213
+ .cppmVersionProperties,
214
+ ...require('./descriptions/LocalServerConfiguration/ServerVersion.descriptions')
215
+ .serverVersionProperties,
216
+ ...require('./descriptions/LocalServerConfiguration/ServerConfiguration.descriptions')
217
+ .serverConfigurationProperties,
181
218
  ],
182
219
  };
183
220
  }
@@ -0,0 +1,4 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const cppmVersionOperations: INodeProperties;
3
+ export declare const cppmVersionFields: INodeProperties[];
4
+ export declare const cppmVersionProperties: INodeProperties[];
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cppmVersionProperties = exports.cppmVersionFields = exports.cppmVersionOperations = void 0;
4
+ exports.cppmVersionOperations = {
5
+ displayName: 'Operation',
6
+ name: 'operation',
7
+ type: 'options',
8
+ displayOptions: {
9
+ show: {
10
+ domain: ['LocalServerConfiguration'],
11
+ resource: ['CppmVersion'],
12
+ },
13
+ },
14
+ options: [
15
+ {
16
+ name: 'Get',
17
+ value: 'get',
18
+ description: 'Get the ClearPass Policy Manager version information',
19
+ action: 'Get CPPM version',
20
+ },
21
+ ],
22
+ default: 'get',
23
+ };
24
+ exports.cppmVersionFields = [];
25
+ exports.cppmVersionProperties = [exports.cppmVersionOperations, ...exports.cppmVersionFields];
@@ -0,0 +1,4 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const serverConfigurationOperations: INodeProperties;
3
+ export declare const serverConfigurationFields: INodeProperties[];
4
+ export declare const serverConfigurationProperties: INodeProperties[];
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serverConfigurationProperties = exports.serverConfigurationFields = exports.serverConfigurationOperations = void 0;
4
+ exports.serverConfigurationOperations = {
5
+ displayName: 'Operation',
6
+ name: 'operation',
7
+ type: 'options',
8
+ displayOptions: {
9
+ show: {
10
+ domain: ['LocalServerConfiguration'],
11
+ resource: ['ServerConfiguration'],
12
+ },
13
+ },
14
+ options: [
15
+ {
16
+ name: 'Get',
17
+ value: 'get',
18
+ description: 'Get configuration for a specific server by UUID, "publisher", or "this"',
19
+ action: 'Get server configuration',
20
+ },
21
+ {
22
+ name: 'List',
23
+ value: 'list',
24
+ description: 'Get a list of all servers in the cluster with their configurations',
25
+ action: 'List server configurations',
26
+ },
27
+ {
28
+ name: 'Update',
29
+ value: 'update',
30
+ description: 'Update configuration of a specific server',
31
+ action: 'Update server configuration',
32
+ },
33
+ ],
34
+ default: 'list',
35
+ };
36
+ exports.serverConfigurationFields = [
37
+ // Server UUID for get and update operations
38
+ {
39
+ displayName: 'Server UUID',
40
+ name: 'serverUuid',
41
+ type: 'string',
42
+ required: true,
43
+ default: 'this',
44
+ displayOptions: {
45
+ show: {
46
+ domain: ['LocalServerConfiguration'],
47
+ resource: ['ServerConfiguration'],
48
+ operation: ['get', 'update'],
49
+ },
50
+ },
51
+ typeOptions: {
52
+ expressionsEnabled: true,
53
+ },
54
+ description: 'Server UUID, "publisher" (for the publisher node), or "this" (for the current node)',
55
+ hint: 'Use "this" for the current node, "publisher" for the publisher, or a full UUID from the List operation',
56
+ },
57
+ // Update fields
58
+ {
59
+ displayName: 'Insight Reporting Enabled',
60
+ name: 'is_insight_enabled',
61
+ type: 'boolean',
62
+ default: false,
63
+ displayOptions: {
64
+ show: {
65
+ domain: ['LocalServerConfiguration'],
66
+ resource: ['ServerConfiguration'],
67
+ operation: ['update'],
68
+ },
69
+ },
70
+ description: 'Whether to enable Insight reporting on this server',
71
+ },
72
+ ];
73
+ exports.serverConfigurationProperties = [
74
+ exports.serverConfigurationOperations,
75
+ ...exports.serverConfigurationFields,
76
+ ];
@@ -0,0 +1,4 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const serverVersionOperations: INodeProperties;
3
+ export declare const serverVersionFields: INodeProperties[];
4
+ export declare const serverVersionProperties: INodeProperties[];
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serverVersionProperties = exports.serverVersionFields = exports.serverVersionOperations = void 0;
4
+ exports.serverVersionOperations = {
5
+ displayName: 'Operation',
6
+ name: 'operation',
7
+ type: 'options',
8
+ displayOptions: {
9
+ show: {
10
+ domain: ['LocalServerConfiguration'],
11
+ resource: ['ServerVersion'],
12
+ },
13
+ },
14
+ options: [
15
+ {
16
+ name: 'Get',
17
+ value: 'get',
18
+ description: 'Get version information for the ClearPass server',
19
+ action: 'Get server version',
20
+ },
21
+ ],
22
+ default: 'get',
23
+ };
24
+ exports.serverVersionFields = [];
25
+ exports.serverVersionProperties = [exports.serverVersionOperations, ...exports.serverVersionFields];
@@ -286,119 +286,8 @@ exports.serverCertFields = [
286
286
  },
287
287
  description: 'Passphrase protecting the PKCS12 bundle at the URL (leave blank if none)',
288
288
  },
289
- // replaceByServiceName: same input modes as replaceByServiceId
290
- {
291
- displayName: 'Certificate Input Mode',
292
- name: 'certInputModeByName',
293
- type: 'options',
294
- default: 'pkcs12',
295
- displayOptions: {
296
- show: {
297
- domain: ['PlatformCertificates'],
298
- resource: ['ServerCert'],
299
- operation: ['replaceByServiceName'],
300
- },
301
- },
302
- options: [
303
- {
304
- name: 'PKCS12 / PFX File',
305
- value: 'pkcs12',
306
- description: 'Upload a .p12 or .pfx bundle containing the certificate and private key',
307
- },
308
- {
309
- name: 'Certificate and Private Key Files',
310
- value: 'certAndKey',
311
- description: 'Upload a PEM certificate file and a separate private key file',
312
- },
313
- {
314
- name: 'URL',
315
- value: 'url',
316
- description: 'Provide a URL for ClearPass to download the certificate from',
317
- },
318
- ],
319
- description: 'How to supply the certificate to ClearPass',
320
- },
321
- // replaceByServiceName — PKCS12 mode
322
- {
323
- displayName: 'PKCS12 / PFX Binary Field',
324
- name: 'pkcs12BinaryPropertyByName',
325
- type: 'string',
326
- default: 'data',
327
- displayOptions: {
328
- show: {
329
- domain: ['PlatformCertificates'],
330
- resource: ['ServerCert'],
331
- operation: ['replaceByServiceName'],
332
- certInputModeByName: ['pkcs12'],
333
- },
334
- },
335
- description: 'Name of the binary property holding the .p12 or .pfx file',
336
- hint: 'This is the field name of the file input on your form, not the file name itself',
337
- },
338
- {
339
- displayName: 'PKCS12 Passphrase',
340
- name: 'pkcs12PassphraseByName',
341
- type: 'string',
342
- typeOptions: { password: true },
343
- default: '',
344
- displayOptions: {
345
- show: {
346
- domain: ['PlatformCertificates'],
347
- resource: ['ServerCert'],
348
- operation: ['replaceByServiceName'],
349
- certInputModeByName: ['pkcs12'],
350
- },
351
- },
352
- description: 'Passphrase protecting the PKCS12 bundle (leave blank if none)',
353
- },
354
- // replaceByServiceName — Cert+Key mode
355
- {
356
- displayName: 'Certificate File Binary Field',
357
- name: 'certBinaryPropertyByName',
358
- type: 'string',
359
- default: 'data',
360
- displayOptions: {
361
- show: {
362
- domain: ['PlatformCertificates'],
363
- resource: ['ServerCert'],
364
- operation: ['replaceByServiceName'],
365
- certInputModeByName: ['certAndKey'],
366
- },
367
- },
368
- description: 'Name of the binary property holding the PEM certificate file (.crt / .pem)',
369
- },
370
- {
371
- displayName: 'Private Key File Binary Field',
372
- name: 'keyBinaryPropertyByName',
373
- type: 'string',
374
- default: 'data',
375
- displayOptions: {
376
- show: {
377
- domain: ['PlatformCertificates'],
378
- resource: ['ServerCert'],
379
- operation: ['replaceByServiceName'],
380
- certInputModeByName: ['certAndKey'],
381
- },
382
- },
383
- description: 'Name of the binary property holding the PEM private key file (.key)',
384
- },
385
- {
386
- displayName: 'Private Key Password',
387
- name: 'privateKeyPasswordByName',
388
- type: 'string',
389
- typeOptions: { password: true },
390
- default: '',
391
- displayOptions: {
392
- show: {
393
- domain: ['PlatformCertificates'],
394
- resource: ['ServerCert'],
395
- operation: ['replaceByServiceName'],
396
- certInputModeByName: ['certAndKey'],
397
- },
398
- },
399
- description: 'Password protecting the private key file (leave blank if none)',
400
- },
401
- // replaceByServiceName — URL mode
289
+ // replaceByServiceName: URL-only (ClearPass PUT endpoint does not accept cert_file/binary uploads,
290
+ // only certificate_url or pkcs12_file_url+pkcs12_passphrase per the API spec)
402
291
  {
403
292
  displayName: 'Certificate URL',
404
293
  name: 'certificate_url_byname',
@@ -409,11 +298,11 @@ exports.serverCertFields = [
409
298
  domain: ['PlatformCertificates'],
410
299
  resource: ['ServerCert'],
411
300
  operation: ['replaceByServiceName'],
412
- certInputModeByName: ['url'],
413
301
  },
414
302
  },
415
303
  typeOptions: { expressionsEnabled: true },
416
- description: 'URL from which ClearPass will download the PEM certificate file',
304
+ description: 'URL from which ClearPass will download the PEM certificate file. Provide this OR PKCS12 File URL — not both.',
305
+ hint: 'ClearPass must be able to reach this URL. Direct file upload is not supported by this endpoint.',
417
306
  },
418
307
  {
419
308
  displayName: 'PKCS12 File URL',
@@ -425,14 +314,14 @@ exports.serverCertFields = [
425
314
  domain: ['PlatformCertificates'],
426
315
  resource: ['ServerCert'],
427
316
  operation: ['replaceByServiceName'],
428
- certInputModeByName: ['url'],
429
317
  },
430
318
  },
431
319
  typeOptions: { expressionsEnabled: true },
432
- description: 'URL from which ClearPass will download the PKCS12 (.pfx/.p12) certificate bundle',
320
+ description: 'URL from which ClearPass will download the PKCS12 (.pfx/.p12) certificate bundle. Provide this OR Certificate URL — not both.',
321
+ hint: 'ClearPass must be able to reach this URL. Direct file upload is not supported by this endpoint.',
433
322
  },
434
323
  {
435
- displayName: 'URL PKCS12 Passphrase',
324
+ displayName: 'PKCS12 Passphrase',
436
325
  name: 'pkcs12_passphrase_byname',
437
326
  type: 'string',
438
327
  typeOptions: { password: true },
@@ -442,10 +331,9 @@ exports.serverCertFields = [
442
331
  domain: ['PlatformCertificates'],
443
332
  resource: ['ServerCert'],
444
333
  operation: ['replaceByServiceName'],
445
- certInputModeByName: ['url'],
446
334
  },
447
335
  },
448
- description: 'Passphrase protecting the PKCS12 bundle at the URL (leave blank if none)',
336
+ description: 'Passphrase protecting the PKCS12 bundle (leave blank if none)',
449
337
  },
450
338
  ];
451
339
  exports.serverCertProperties = [exports.serverCertOperations, ...exports.serverCertFields];
@@ -45,6 +45,9 @@ const enforcementProfileMethods = __importStar(require("../methods/EnforcementPr
45
45
  const serviceCertMethods = __importStar(require("../methods/PlatformCertificates/ServiceCert.methods"));
46
46
  const serverCertMethods = __importStar(require("../methods/PlatformCertificates/ServerCert.methods"));
47
47
  const selfSignedCertMethods = __importStar(require("../methods/PlatformCertificates/SelfSignedCert.methods"));
48
+ const cppmVersionMethods = __importStar(require("../methods/LocalServerConfiguration/CppmVersion.methods"));
49
+ const serverVersionMethods = __importStar(require("../methods/LocalServerConfiguration/ServerVersion.methods"));
50
+ const serverConfigurationMethods = __importStar(require("../methods/LocalServerConfiguration/ServerConfiguration.methods"));
48
51
  /**
49
52
  * Execute the appropriate operation based on user selection
50
53
  */
@@ -177,6 +180,19 @@ async function executeOperation() {
177
180
  create: selfSignedCertMethods.createSelfSignedCert,
178
181
  },
179
182
  },
183
+ LocalServerConfiguration: {
184
+ CppmVersion: {
185
+ get: cppmVersionMethods.getCppmVersion,
186
+ },
187
+ ServerVersion: {
188
+ get: serverVersionMethods.getServerVersion,
189
+ },
190
+ ServerConfiguration: {
191
+ list: serverConfigurationMethods.listServerConfigurations,
192
+ get: serverConfigurationMethods.getServerConfiguration,
193
+ update: serverConfigurationMethods.updateServerConfiguration,
194
+ },
195
+ },
180
196
  };
181
197
  if (!handlers[domain] || !handlers[domain][resource] || !handlers[domain][resource][operation]) {
182
198
  throw new Error(`The operation ${domain}.${resource}.${operation} is not supported!`);
@@ -0,0 +1,6 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ /**
3
+ * Get ClearPass Policy Manager version information
4
+ * GET /cppm-version
5
+ */
6
+ export declare function getCppmVersion(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCppmVersion = getCppmVersion;
4
+ // methods/LocalServerConfiguration/CppmVersion.methods.ts
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const apiRequest_1 = require("../../helpers/apiRequest");
7
+ const responseFormatter_1 = require("../../helpers/responseFormatter");
8
+ /**
9
+ * Get ClearPass Policy Manager version information
10
+ * GET /cppm-version
11
+ */
12
+ async function getCppmVersion() {
13
+ try {
14
+ const responseData = await apiRequest_1.apiRequest.call(this, 'GET', '/cppm-version');
15
+ return responseFormatter_1.formatResponse.call(this, responseData);
16
+ }
17
+ catch (error) {
18
+ const errorObject = {};
19
+ if (error instanceof Error) {
20
+ errorObject.message = error.message;
21
+ if (error.stack)
22
+ errorObject.stackTrace = error.stack;
23
+ }
24
+ else {
25
+ errorObject.message = 'Unknown error in getCppmVersion';
26
+ }
27
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), errorObject);
28
+ }
29
+ }
@@ -0,0 +1,18 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ /**
3
+ * Get a list of all servers in the cluster
4
+ * GET /cluster/server
5
+ */
6
+ export declare function listServerConfigurations(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
7
+ /**
8
+ * Get configuration for a specific server
9
+ * GET /cluster/server/{uuid}
10
+ * uuid can be a server UUID, "publisher", or "this"
11
+ */
12
+ export declare function getServerConfiguration(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
13
+ /**
14
+ * Update configuration of a specific server
15
+ * PATCH /cluster/server/{uuid}
16
+ * uuid can be a server UUID, "publisher", or "this"
17
+ */
18
+ export declare function updateServerConfiguration(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listServerConfigurations = listServerConfigurations;
4
+ exports.getServerConfiguration = getServerConfiguration;
5
+ exports.updateServerConfiguration = updateServerConfiguration;
6
+ // methods/LocalServerConfiguration/ServerConfiguration.methods.ts
7
+ const n8n_workflow_1 = require("n8n-workflow");
8
+ const apiRequest_1 = require("../../helpers/apiRequest");
9
+ const responseFormatter_1 = require("../../helpers/responseFormatter");
10
+ /**
11
+ * Get a list of all servers in the cluster
12
+ * GET /cluster/server
13
+ */
14
+ async function listServerConfigurations() {
15
+ try {
16
+ const responseData = await apiRequest_1.apiRequest.call(this, 'GET', '/cluster/server');
17
+ return responseFormatter_1.formatResponse.call(this, responseData);
18
+ }
19
+ catch (error) {
20
+ const errorObject = {};
21
+ if (error instanceof Error) {
22
+ errorObject.message = error.message;
23
+ if (error.stack)
24
+ errorObject.stackTrace = error.stack;
25
+ }
26
+ else {
27
+ errorObject.message = 'Unknown error in listServerConfigurations';
28
+ }
29
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), errorObject);
30
+ }
31
+ }
32
+ /**
33
+ * Get configuration for a specific server
34
+ * GET /cluster/server/{uuid}
35
+ * uuid can be a server UUID, "publisher", or "this"
36
+ */
37
+ async function getServerConfiguration() {
38
+ try {
39
+ const serverUuid = this.getNodeParameter('serverUuid', 0);
40
+ const responseData = await apiRequest_1.apiRequest.call(this, 'GET', `/cluster/server/${encodeURIComponent(serverUuid)}`);
41
+ return responseFormatter_1.formatResponse.call(this, responseData);
42
+ }
43
+ catch (error) {
44
+ const errorObject = {};
45
+ if (error instanceof Error) {
46
+ errorObject.message = error.message;
47
+ if (error.stack)
48
+ errorObject.stackTrace = error.stack;
49
+ }
50
+ else {
51
+ errorObject.message = 'Unknown error in getServerConfiguration';
52
+ }
53
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), errorObject);
54
+ }
55
+ }
56
+ /**
57
+ * Update configuration of a specific server
58
+ * PATCH /cluster/server/{uuid}
59
+ * uuid can be a server UUID, "publisher", or "this"
60
+ */
61
+ async function updateServerConfiguration() {
62
+ try {
63
+ const serverUuid = this.getNodeParameter('serverUuid', 0);
64
+ const isInsightEnabled = this.getNodeParameter('is_insight_enabled', 0);
65
+ const body = {
66
+ is_insight_enabled: isInsightEnabled,
67
+ };
68
+ const responseData = await apiRequest_1.apiRequest.call(this, 'PATCH', `/cluster/server/${encodeURIComponent(serverUuid)}`, body);
69
+ return responseFormatter_1.formatResponse.call(this, responseData);
70
+ }
71
+ catch (error) {
72
+ const errorObject = {};
73
+ if (error instanceof Error) {
74
+ errorObject.message = error.message;
75
+ if (error.stack)
76
+ errorObject.stackTrace = error.stack;
77
+ }
78
+ else {
79
+ errorObject.message = 'Unknown error in updateServerConfiguration';
80
+ }
81
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), errorObject);
82
+ }
83
+ }
@@ -0,0 +1,6 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ /**
3
+ * Get server version information
4
+ * GET /server/version
5
+ */
6
+ export declare function getServerVersion(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getServerVersion = getServerVersion;
4
+ // methods/LocalServerConfiguration/ServerVersion.methods.ts
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const apiRequest_1 = require("../../helpers/apiRequest");
7
+ const responseFormatter_1 = require("../../helpers/responseFormatter");
8
+ /**
9
+ * Get server version information
10
+ * GET /server/version
11
+ */
12
+ async function getServerVersion() {
13
+ try {
14
+ const responseData = await apiRequest_1.apiRequest.call(this, 'GET', '/server/version');
15
+ return responseFormatter_1.formatResponse.call(this, responseData);
16
+ }
17
+ catch (error) {
18
+ const errorObject = {};
19
+ if (error instanceof Error) {
20
+ errorObject.message = error.message;
21
+ if (error.stack)
22
+ errorObject.stackTrace = error.stack;
23
+ }
24
+ else {
25
+ errorObject.message = 'Unknown error in getServerVersion';
26
+ }
27
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), errorObject);
28
+ }
29
+ }
@@ -187,57 +187,22 @@ async function replaceServerCertByServiceId() {
187
187
  * service_name: RADIUS | HTTPS(RSA) | HTTPS(ECC) | RadSec
188
188
  */
189
189
  async function replaceServerCertByServiceName() {
190
- var _a, _b, _c, _d;
191
190
  try {
192
191
  const serverUuid = this.getNodeParameter('serverUuid', 0);
193
192
  const serviceName = this.getNodeParameter('serviceName', 0);
194
193
  const body = {};
195
- const certInputModeByName = this.getNodeParameter('certInputModeByName', 0, 'pkcs12');
196
- console.log(`[ClearPass] replaceServerCertByServiceName: serverUuid="${serverUuid}", serviceName="${serviceName}", certInputModeByName=${certInputModeByName}`);
197
- if (certInputModeByName === 'pkcs12') {
198
- const pkcs12BinaryProperty = this.getNodeParameter('pkcs12BinaryPropertyByName', 0, 'data');
199
- const pkcs12Passphrase = this.getNodeParameter('pkcs12PassphraseByName', 0, '');
200
- console.log(`[ClearPass] PKCS12 mode: binaryProperty="${pkcs12BinaryProperty}"`);
201
- const inputData1 = this.getInputData();
202
- console.log(`[ClearPass] Input item binary keys: ${JSON.stringify(Object.keys((_b = (_a = inputData1[0]) === null || _a === void 0 ? void 0 : _a.binary) !== null && _b !== void 0 ? _b : {}))}`);
203
- const binaryData = await getBinaryData(this, pkcs12BinaryProperty, 0);
204
- console.log(`[ClearPass] Binary data retrieved: ${binaryData.length} bytes`);
205
- body.cert_file = binaryData.toString('base64');
206
- if (pkcs12Passphrase)
207
- body.pkcs12_passphrase = pkcs12Passphrase;
208
- }
209
- else if (certInputModeByName === 'certAndKey') {
210
- const certBinaryProperty = this.getNodeParameter('certBinaryPropertyByName', 0, 'data');
211
- const keyBinaryProperty = this.getNodeParameter('keyBinaryPropertyByName', 0, 'data');
212
- const privateKeyPassword = this.getNodeParameter('privateKeyPasswordByName', 0, '');
213
- console.log(`[ClearPass] Cert+Key mode: certBinaryProperty="${certBinaryProperty}", keyBinaryProperty="${keyBinaryProperty}"`);
214
- const inputData2 = this.getInputData();
215
- console.log(`[ClearPass] Input item binary keys: ${JSON.stringify(Object.keys((_d = (_c = inputData2[0]) === null || _c === void 0 ? void 0 : _c.binary) !== null && _d !== void 0 ? _d : {}))}`);
216
- const certData = await getBinaryData(this, certBinaryProperty, 0);
217
- console.log(`[ClearPass] Cert binary data retrieved: ${certData.length} bytes`);
218
- body.cert_file = certData.toString('base64');
219
- const keyData = await getBinaryData(this, keyBinaryProperty, 0);
220
- console.log(`[ClearPass] Key binary data retrieved: ${keyData.length} bytes`);
221
- body.private_key_file = keyData.toString('base64');
222
- if (privateKeyPassword)
223
- body.private_key_password = privateKeyPassword;
224
- }
225
- else {
226
- const certificateUrl = this.getNodeParameter('certificate_url_byname', 0, '');
227
- const pkcs12FileUrl = this.getNodeParameter('pkcs12_file_url_byname', 0, '');
228
- const pkcs12Passphrase = this.getNodeParameter('pkcs12_passphrase_byname', 0, '');
229
- console.log(`[ClearPass] URL mode: certificate_url="${certificateUrl}", pkcs12_file_url="${pkcs12FileUrl}"`);
230
- if (certificateUrl)
231
- body.certificate_url = certificateUrl;
232
- if (pkcs12FileUrl)
233
- body.pkcs12_file_url = pkcs12FileUrl;
234
- if (pkcs12Passphrase)
235
- body.pkcs12_passphrase = pkcs12Passphrase;
236
- }
194
+ const certificateUrl = this.getNodeParameter('certificate_url_byname', 0, '');
195
+ const pkcs12FileUrl = this.getNodeParameter('pkcs12_file_url_byname', 0, '');
196
+ const pkcs12Passphrase = this.getNodeParameter('pkcs12_passphrase_byname', 0, '');
197
+ console.log(`[ClearPass] replaceServerCertByServiceName: serverUuid="${serverUuid}", serviceName="${serviceName}"`);
198
+ console.log(`[ClearPass] certificate_url="${certificateUrl}", pkcs12_file_url="${pkcs12FileUrl}"`);
199
+ if (certificateUrl)
200
+ body.certificate_url = certificateUrl;
201
+ if (pkcs12FileUrl)
202
+ body.pkcs12_file_url = pkcs12FileUrl;
203
+ if (pkcs12Passphrase)
204
+ body.pkcs12_passphrase = pkcs12Passphrase;
237
205
  console.log(`[ClearPass] Request body keys: ${JSON.stringify(Object.keys(body))}`);
238
- if (body.cert_file) {
239
- console.log(`[ClearPass] cert_file length (base64 chars): ${body.cert_file.length}`);
240
- }
241
206
  const endpoint = `/server-cert/name/${encodeURIComponent(serverUuid)}/${encodeURIComponent(serviceName)}`;
242
207
  console.log(`[ClearPass] Sending PUT ${endpoint}`);
243
208
  const responseData = await apiRequest_1.apiRequest.call(this, 'PUT', endpoint, body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-arubaclearpass",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "n8n community node for Aruba ClearPass API integration with comprehensive identity, policy, and enforcement profile management",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",