Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10360554
HttpBinApi.credentials.ts
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
HttpBinApi.credentials.ts
View Options
import
{
ICredentialDataDecryptedObject
,
ICredentialTestRequest
,
ICredentialType
,
IHttpRequestOptions
,
INodeProperties
,
}
from
"n8n-workflow"
;
export
class
HttpBinApi
implements
ICredentialType
{
name
=
"httpbinApi"
;
displayName
=
"HttpBin API"
;
documentationUrl
=
"httpbin"
;
properties
:
INodeProperties
[]
=
[
{
displayName
:
"Token"
,
name
:
"token"
,
type
:
"string"
,
default
:
""
,
},
// {
// displayName: "API Key",
// name: "apiKey",
// type: "string",
// default: "",
// },
{
displayName
:
"Domain"
,
name
:
"domain"
,
type
:
"string"
,
default
:
"https://httpbin.org"
,
},
];
// authenticate = {
// type: "headerAuth",
// properties: {
// name: "api-key",
// value: "={{$credentials.apiKey}}",
// },
// } as IAuthenticateHeaderAuth;
authenticate
=
async
(
credentials
:
ICredentialDataDecryptedObject
,
requestOptions
:
IHttpRequestOptions
)
:
Promise
<
IHttpRequestOptions
>
=>
{
const
headers
=
requestOptions
.
headers
||
{};
const
authentication
=
{
Authorization
:
`Bearer
${
credentials
.
token
}
`
};
Object
.
assign
(
requestOptions
,
{
headers
:
{
...
authentication
,
...
headers
},
});
return
requestOptions
;
};
test
:
ICredentialTestRequest
=
{
request
:
{
baseURL
:
"={{$credentials?.domain}}"
,
url
:
"/bearer"
,
},
};
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 8, 07:17 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1033488
Default Alt Text
HttpBinApi.credentials.ts (1 KB)
Attached To
Mode
rNPN n8n-phabricator-node
Attached
Detach File
Event Timeline
Log In to Comment