mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 16:14:07 -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';
|
documentationUrl = 'venafitlsprotectcloud';
|
||||||
|
|
||||||
properties: INodeProperties[] = [
|
properties: INodeProperties[] = [
|
||||||
|
{
|
||||||
|
displayName: 'Region',
|
||||||
|
name: 'region',
|
||||||
|
type: 'options',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: 'US',
|
||||||
|
value: 'cloud',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'EU',
|
||||||
|
value: 'eu',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
default: 'cloud',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'API Key',
|
displayName: 'API Key',
|
||||||
name: 'apiKey',
|
name: 'apiKey',
|
||||||
|
@ -33,7 +49,7 @@ export class VenafiTlsProtectCloudApi implements ICredentialType {
|
||||||
|
|
||||||
test: ICredentialTestRequest = {
|
test: ICredentialTestRequest = {
|
||||||
request: {
|
request: {
|
||||||
baseURL: 'https://api.venafi.cloud',
|
baseURL: '=https://api.venafi.{{$credentials.region ?? "cloud"}}',
|
||||||
url: '/v1/preferences',
|
url: '/v1/preferences',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,6 +23,9 @@ export async function venafiApiRequest(
|
||||||
option: IDataObject = {},
|
option: IDataObject = {},
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const operation = this.getNodeParameter('operation', 0);
|
const operation = this.getNodeParameter('operation', 0);
|
||||||
|
const credentials = await this.getCredentials('venafiTlsProtectCloudApi');
|
||||||
|
|
||||||
|
const region = credentials.region ?? 'cloud';
|
||||||
|
|
||||||
const options: OptionsWithUri = {
|
const options: OptionsWithUri = {
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -32,7 +35,7 @@ export async function venafiApiRequest(
|
||||||
method,
|
method,
|
||||||
body,
|
body,
|
||||||
qs,
|
qs,
|
||||||
uri: `https://api.venafi.cloud${resource}`,
|
uri: `https://api.venafi.${region}${resource}`,
|
||||||
json: true,
|
json: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue