Convly 17bad93089 Create an auth strategy for data-transfer
Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
Co-authored-by: Ben Irvin <innerdvations@users.noreply.github.com>
Co-authored-by: Simone <simone.taeggi@strapi.io>
2023-02-02 17:03:41 +01:00

27 lines
840 B
JavaScript

'use strict';
/**
* @typedef {{authenticated: boolean, error?: string, credentials?: Record<any, any>}} AuthenticateResponse
* @typedef {(ctx: Record<any, any>) => AuthenticateResponse | Promise<AuthenticateResponse>} AuthenticateFunction
* @typedef {{strategy: AuthStrategy, credentials?: Record<any, any>}} VerifyInputAuth
* @typedef {{scope: string, [key: any]: any}} VerifyInputConfig
* @typedef {(auth: VerifyInputAuth, config: VerifyInputConfig) => void | Promise<void>} VerifyFunction
*/
/**
* @typedef AuthStrategy
*
* @property {string} name
* @property {AuthenticateFunction} authenticate
* @property {VerifyFunction} [verify]
*/
/**
* @type {Record<string, AuthStrategy>}
*/
module.exports = {
admin: require('./admin'),
'data-transfer': require('./data-transfer'),
'api-token': require('./api-token'),
};