mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-28 05:59:42 -08:00
86721fc496
* ⚡ Add generic auth type * ⚡ Remove queryAuth * ⚡ Remove bearer * ⚡ Remove headerAuth * ⚡ Remove basicAuth * ⚡ Adjust tests * ⚡ Small improvements * 👕 Fix lint issue
39 lines
681 B
TypeScript
39 lines
681 B
TypeScript
import {
|
|
IAuthenticateGeneric,
|
|
ICredentialType,
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
export class HttpHeaderAuth implements ICredentialType {
|
|
name = 'httpHeaderAuth';
|
|
displayName = 'Header Auth';
|
|
documentationUrl = 'httpRequest';
|
|
genericAuth = true;
|
|
icon = 'node:n8n-nodes-base.httpRequest';
|
|
properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'Name',
|
|
name: 'name',
|
|
type: 'string',
|
|
default: '',
|
|
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
];
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
type: 'generic',
|
|
properties: {
|
|
headers: {
|
|
'={{$credentials.name}}': '={{$credentials.value}}',
|
|
},
|
|
},
|
|
};
|
|
}
|