Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make extra unused auth plugins not throw errors #94

Merged
merged 3 commits into from May 7, 2019

Conversation

@toddwellman
Copy link
Contributor

commented Apr 29, 2019

Signed-off-by: toddwellman twellman@rocketsoftware.com

make extra unused auth plugins not throw errors
Signed-off-by: toddwellman <twellman@rocketsoftware.com>

@toddwellman toddwellman requested a review from 1000TurquoisePogs Apr 29, 2019

@ghost ghost assigned toddwellman Apr 29, 2019

@ghost ghost added the review label Apr 29, 2019

@1000TurquoisePogs
Copy link
Contributor

left a comment

Functionally correct, but could use clearer code.

isRequestedAuthPlugin(context) {
//we should not load authentication types that are
//not requested by the administrator
if (!context.authManager.authPluginRequested(this.identifier,

This comment has been minimized.

Copy link
@1000TurquoisePogs

1000TurquoisePogs May 2, 2019

Contributor

if the value of the function return is equal to the value that you are returning, then you can just return the function itself, as return context.authManager.authPluginRequested(this.identifier, this.authenticationCategory), or alternatively since it is a one-liner at that point, that this can be done inline.

consolidate code to one line
Signed-off-by: Todd Wellman <twellman@rocketsoftware.com>
@@ -513,7 +503,8 @@ function makePlugin(def, pluginConfiguration, pluginContext, dynamicallyCreated)
const self = new pluginConstr(def, pluginConfiguration);
self.dynamicallyCreated = dynamicallyCreated;
if (!self.isValid(pluginContext)) {
if (def.pluginType == 'nodeAuthentication' && !self.isRequestedAuthPlugin(pluginContext)) {
if (def.pluginType == 'nodeAuthentication' && pluginContext.authManager.authPluginRequested(self.identifier,

This comment has been minimized.

Copy link
@1000TurquoisePogs

1000TurquoisePogs May 5, 2019

Contributor

This is consolidated, but now backwards.

fix swapped boolean
Signed-off-by: Todd Wellman <twellman@rocketsoftware.com>

@1000TurquoisePogs 1000TurquoisePogs merged commit ee97939 into staging May 7, 2019

2 checks passed

DCO DCO
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details

@ghost ghost removed the review label May 7, 2019

@1000TurquoisePogs 1000TurquoisePogs deleted the bug/skip-extra-auth-plugin-without-error branch May 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.