@whook/authorization
Version:
A wrapper to provide authorization support to a Whook server
30 lines • 1.15 kB
JavaScript
import { DEFAULT_ERROR_URI, DEFAULT_HELP_URI, } from '@whook/whook';
import initWrapRouteHandlerWithAuthorization from './wrappers/wrapRouteHandlerWithAuthorization.js';
export { initWrapRouteHandlerWithAuthorization };
export const AUTHORIZATION_ERRORS_DESCRIPTORS = {
E_OPERATION_REQUIRED: {
code: 'server_misconfiguration',
description: 'The authorization wrapper needs to have the operation passed in',
uri: DEFAULT_ERROR_URI,
help: DEFAULT_HELP_URI,
},
E_UNAUTHORIZED: {
code: 'unauthorized_client',
description: 'Access refused to this resource for the authenticated client',
uri: DEFAULT_ERROR_URI,
help: DEFAULT_HELP_URI,
},
E_AUTH_MECHANISM_NOT_ALLOWED: {
code: 'bad_request',
description: 'Unsupported auth mechanism',
uri: DEFAULT_ERROR_URI,
help: DEFAULT_HELP_URI,
},
E_MISCONFIGURATION: {
code: 'bad_handler',
description: 'The operation "$2" is misconfigured for the authorization type "$0"',
uri: DEFAULT_ERROR_URI,
help: DEFAULT_HELP_URI,
},
};
//# sourceMappingURL=index.js.map