Yair Zaslavsky has posted comments on this change. Change subject: aaa: InternalAuthenticator should use the new API ......................................................................
Patch Set 3: (7 comments) http://gerrit.ovirt.org/#/c/26443/3/backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/internal/InternalAuthenticator.java File backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/internal/InternalAuthenticator.java: Line 7: import org.ovirt.engine.api.extensions.Extension; Line 8: import org.ovirt.engine.api.extensions.aaa.Authn; Line 9: import org.ovirt.engine.api.extensionsold.AAAExtensionException; Line 10: import org.ovirt.engine.core.aaa.Authenticator; Line 11: import org.ovirt.engine.core.extensions.mgr.ExtensionProxy; > this class should not use anything of core, only api Done Line 12: Line 13: /** Line 14: * This authenticator authenticates the internal user as specified in the {@code AdminUser} and {@code AdminPassword} Line 15: * configuration parameters stored in the database. Currently it is in an interim status of development as Line 15: * configuration parameters stored in the database. Currently it is in an interim status of development as Line 16: */ Line 17: public class InternalAuthenticator extends Authenticator implements Extension { Line 18: Line 19: private ExtMap initMap; > please use consistent terms... this is context. Done Line 20: Line 21: // This method should be removed once we no longer work with Authenticator class hierarchy Line 22: @Override Line 23: @Deprecated Line 48: doInit(input, output); Line 49: } Line 50: if (input.get(Base.InvokeKeys.COMMAND).equals(Authn.InvokeCommands.AUTHENTICATE_CREDENTIALS)) { Line 51: doAuthenticate(input, output); Line 52: } > I suggest try catch and set success/failure here. Done Line 53: } Line 54: Line 55: @Override Line 56: public String getName() { Line 51: doAuthenticate(input, output); Line 52: } Line 53: } Line 54: Line 55: @Override > this depreciated as well, right? Done Line 56: public String getName() { Line 57: return (String) initMap.<ExtMap> get(Base.InvokeKeys.CONTEXT).<String> get(Base.ContextKeys.INSTANCE_NAME); Line 58: } Line 59: Line 64: .getProperty("ovirt.engine.aaa.authn.profile.name"); Line 65: } Line 66: Line 67: private void doAuthenticate(ExtMap input, ExtMap output) { Line 68: String adminUser = input.<ExtMap> get( > you already have context as member... so either you use it always or use th Done Line 69: Base.InvokeKeys.CONTEXT Line 70: ).<Properties>get(Base.ContextKeys.CONFIGURATION).getProperty("config.authn.user.name"); Line 71: Line 72: String adminPassword= input.<ExtMap> get( Line 66: Line 67: private void doAuthenticate(ExtMap input, ExtMap output) { Line 68: String adminUser = input.<ExtMap> get( Line 69: Base.InvokeKeys.CONTEXT Line 70: ).<Properties>get(Base.ContextKeys.CONFIGURATION).getProperty("config.authn.user.name"); > get this during initialization, no need to get configuration each time. onc Done Line 71: Line 72: String adminPassword= input.<ExtMap> get( Line 73: Base.InvokeKeys.CONTEXT Line 74: ).<Properties>get(Base.ContextKeys.CONFIGURATION).getProperty("config.authn.user.password"); Line 85: mput(Base.ContextKeys.LICENSE, "ASL 2.0"). Line 86: mput(Base.ContextKeys.HOME_URL, "http://www.ovirt.org"). Line 87: mput(Base.ContextKeys.VERSION, "N/A"). Line 88: mput(Authn.ContextKeys.CAPABILITIES, Authn.Capabilities.AUTHENTICATE_PASSWORD); Line 89: initMap = input; > you should store the context, not the input. input should be allowed to be Done Line 90: output.mput(Base.InvokeKeys.RESULT, Base.InvokeResult.SUCCESS); Line 91: } Line 92: -- To view, visit http://gerrit.ovirt.org/26443 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60f7b7f50617bff9f4872dc79f14fb016c9d72d3 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
