Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function setupBindings2() {
addExtension(
app,
AuthenticationBindings.AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME,
PassportBasicAuthProvider,
{
namespace:
AuthenticationBindings.AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME,
},
);
// used by VerifyFunctionProvider
app.bind(USERS_REPOSITORY_BINDING_KEY).to(users);
// the verify function for passport-http
app
.bind(VERIFY_FUNCTION_BASIC_AUTHENTICATION_BINDING_KEY)
.toProvider(VerifyFunctionProvider);
// used by the Strategy Adapter
async function setupBindings2() {
addExtension(
app,
AuthenticationBindings.AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME,
PassportBasicAuthProvider,
{
namespace:
AuthenticationBindings.AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME,
},
);
// used by VerifyFunctionProvider
app.bind(USERS_REPOSITORY_BINDING_KEY).to(users);
// the verify function for passport-http
app
.bind(VERIFY_FUNCTION_BASIC_AUTHENTICATION_BINDING_KEY)
.toProvider(VerifyFunctionProvider);
// used by the Strategy Adapter
app
.bind(AuthenticationBindings.USER_PROFILE_FACTORY)
.to(myUserProfileFactory);
}
async function setupBindings1() {
app
.bind(BASIC_STRATEGY_BINDING_KEY)
.to(basicAuthStrategy)
.tag({
[CoreTags.EXTENSION_FOR]:
AuthenticationBindings.AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME,
});
}
async function givenAServer() {
app = new Application();
app.component(AuthenticationComponent);
app.component(RestComponent);
app
.bind('authentication.strategies.basicAuthStrategy')
.to(basicAuthStrategy)
.tag({
[CoreTags.EXTENSION_FOR]:
AuthenticationBindings.AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME,
});
server = await app.getServer(RestServer);
}