* added an RFC 7662 compliant OAuth2 auth adapter * forgot to add the actual auth adapter to the previous commit * fixed lint errors * * added test coverage * changed option names in auth adapter from snake case to camel case * added underscore prefix to helper function names * merged consecutive logger calls into one call and use JSON.stringify() to convert JSON objects to strings * changed error handling (ParseErrors are no longer thrown, but returned) * added description of the "debug" option and added this option to the tests too * added a check of the "debug" option to the unittests and replaced require() of the logger with an import (the former does not work correctly) * added AuthAdapter based auth adapter runtime validation to src/Adapters/Auth/index.js, added capability to define arbitrary providernames with an "adapter" property in auth config, replaced various "var" keywords with "const" in oauth2.js * incorporated changes requested by flovilmart (mainly that oauth2 is now not a standalone adapter, but can be selected by setting the "oauth2" property to true in auth config * modified oauth2 adapter as requested by flovilmart * bugfix: defaultAdapter can be null in loadAuthAdapter() of index.js (my change broke the tests) * added TODO on need for a validateAdapter() to validate auth adapters * test cases and cleanup
23 lines
566 B
JavaScript
23 lines
566 B
JavaScript
/*eslint no-unused-vars: "off"*/
|
|
export class AuthAdapter {
|
|
/*
|
|
@param appIds: the specified app ids in the configuration
|
|
@param authData: the client provided authData
|
|
@param options: additional options
|
|
@returns a promise that resolves if the applicationId is valid
|
|
*/
|
|
validateAppId(appIds, authData, options) {
|
|
return Promise.resolve({});
|
|
}
|
|
|
|
/*
|
|
@param authData: the client provided authData
|
|
@param options: additional options
|
|
*/
|
|
validateAuthData(authData, options) {
|
|
return Promise.resolve({});
|
|
}
|
|
}
|
|
|
|
export default AuthAdapter;
|