[ 
https://issues.apache.org/jira/browse/GEODE-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16217657#comment-16217657
 ] 

ASF GitHub Bot commented on GEODE-3705:
---------------------------------------

kohlmu-pivotal commented on a change in pull request #967: GEODE-3705: Refactor 
Authentication request to be processed as a "normal" protobuf message
URL: https://github.com/apache/geode/pull/967#discussion_r146686886
 
 

 ##########
 File path: 
geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/SecurityLookupService.java
 ##########
 @@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.protocol.security;
+
+import 
org.apache.geode.internal.protocol.protobuf.security.InvalidConfigAuthenticator;
+import 
org.apache.geode.internal.protocol.protobuf.security.ProtobufShiroAuthenticator;
+import 
org.apache.geode.internal.protocol.protobuf.security.ProtobufShiroAuthorizer;
+import 
org.apache.geode.internal.protocol.protobuf.security.processors.AuthenticationSecurityProcessor;
+import 
org.apache.geode.internal.protocol.security.processors.NoAuthenticationSecurityProcessor;
+import org.apache.geode.internal.security.SecurityService;
+
+public class SecurityLookupService {
+  private final Authenticator[] authenticators = new Authenticator[3];
+  private final Authorizer[] authorizers = new Authorizer[2];
+  private final SecurityProcessor[] securityProcessors = new 
SecurityProcessor[2];
+
+  public SecurityLookupService() {
+    initializeAuthenticators();
+    initializeAuthortizers();
+    initializeSecurityProcessors();
+  }
+
+  private void initializeSecurityProcessors() {
+    securityProcessors[0] = new NoAuthenticationSecurityProcessor();
+    securityProcessors[1] = new AuthenticationSecurityProcessor();
+  }
+
+  private void initializeAuthenticators() {
+    authenticators[0] = new NoOpAuthenticator();
+    authenticators[1] = new InvalidConfigAuthenticator();
+  }
+
+  private void initializeAuthortizers() {
+    authorizers[0] = new NoOpAuthorizer();
+  }
+
+  public SecurityProcessor lookupProcessor(SecurityService securityService) {
+    return isSecurityEnabled(securityService) ? securityProcessors[1] : 
securityProcessors[0];
 
 Review comment:
   fix applied

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Refactor Authentication request to be processed as a "normal" protobuf message
> ------------------------------------------------------------------------------
>
>                 Key: GEODE-3705
>                 URL: https://issues.apache.org/jira/browse/GEODE-3705
>             Project: Geode
>          Issue Type: New Feature
>          Components: client/server
>            Reporter: Galen O'Sullivan
>            Assignee: Udo Kohlmeyer
>
> Refactor authentication and Authorization for the new protocol to process the 
> AuthenticationRequest as a "normal" protobuf message.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to