mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
feat(Venafi TLS Protect Cloud Node): Add region parameter to Venafi protect cloud (#7689)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -13,6 +13,22 @@ export class VenafiTlsProtectCloudApi implements ICredentialType {
|
||||
documentationUrl = 'venafitlsprotectcloud';
|
||||
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Region',
|
||||
name: 'region',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'US',
|
||||
value: 'cloud',
|
||||
},
|
||||
{
|
||||
name: 'EU',
|
||||
value: 'eu',
|
||||
},
|
||||
],
|
||||
default: 'cloud',
|
||||
},
|
||||
{
|
||||
displayName: 'API Key',
|
||||
name: 'apiKey',
|
||||
@@ -33,7 +49,7 @@ export class VenafiTlsProtectCloudApi implements ICredentialType {
|
||||
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: 'https://api.venafi.cloud',
|
||||
baseURL: '=https://api.venafi.{{$credentials.region ?? "cloud"}}',
|
||||
url: '/v1/preferences',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -23,6 +23,9 @@ export async function venafiApiRequest(
|
||||
option: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const operation = this.getNodeParameter('operation', 0);
|
||||
const credentials = await this.getCredentials('venafiTlsProtectCloudApi');
|
||||
|
||||
const region = credentials.region ?? 'cloud';
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
headers: {
|
||||
@@ -32,7 +35,7 @@ export async function venafiApiRequest(
|
||||
method,
|
||||
body,
|
||||
qs,
|
||||
uri: `https://api.venafi.cloud${resource}`,
|
||||
uri: `https://api.venafi.${region}${resource}`,
|
||||
json: true,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user