mirror of
https://github.com/n8n-io/n8n.git
synced 2026-08-28 17:22:01 +08:00
fix: Add missing test and authenticate to OpenWeatherMap, Azure Storage and Netlify credentials (#20221)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type {
|
||||
ICredentialDataDecryptedObject,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
IHttpRequestOptions,
|
||||
INodeProperties,
|
||||
@@ -93,4 +94,18 @@ export class AzureStorageSharedKeyApi implements ICredentialType {
|
||||
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: '={{$credentials.baseUrl}}',
|
||||
url: '/',
|
||||
headers: {
|
||||
'x-ms-date': '={{ new Date().toUTCString() }}',
|
||||
'x-ms-version': '2021-12-02',
|
||||
},
|
||||
qs: {
|
||||
comp: 'list',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IAuthenticate,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class NetlifyApi implements ICredentialType {
|
||||
name = 'netlifyApi';
|
||||
@@ -16,4 +21,20 @@ export class NetlifyApi implements ICredentialType {
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
||||
authenticate: IAuthenticate = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
headers: {
|
||||
Authorization: '=Bearer {{$credentials.accessToken}}',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: 'https://api.netlify.com',
|
||||
url: '/api/v1/sites',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IAuthenticate,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class OpenWeatherMapApi implements ICredentialType {
|
||||
name = 'openWeatherMapApi';
|
||||
@@ -16,4 +21,23 @@ export class OpenWeatherMapApi implements ICredentialType {
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
||||
authenticate: IAuthenticate = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
qs: {
|
||||
appid: '={{$credentials.accessToken}}',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: 'https://api.openweathermap.org/data/2.5',
|
||||
url: '/weather',
|
||||
qs: {
|
||||
q: 'London',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user