mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08: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:
parent
cbc690907f
commit
a08fca51d9
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue