mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-22 17:39:46 +01:00
27 lines
578 B
TypeScript
27 lines
578 B
TypeScript
import { PluginDefinition } from '@yaakapp/api';
|
|
|
|
export const plugin: PluginDefinition = {
|
|
authentication: {
|
|
name: 'bearer',
|
|
label: 'Bearer Token',
|
|
shortLabel: 'Bearer',
|
|
config: [{
|
|
type: 'text',
|
|
name: 'token',
|
|
label: 'Token',
|
|
optional: true,
|
|
password: true,
|
|
}],
|
|
async onApply(_ctx: any, args: any): Promise<any> {
|
|
const { token } = args.config;
|
|
return {
|
|
url: args.url,
|
|
headers: [{
|
|
name: 'Authorization',
|
|
value: `Bearer ${token}`.trim(),
|
|
}],
|
|
};
|
|
},
|
|
},
|
|
};
|