You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Flaugh24 (via GitHub)" <gi...@apache.org> on 2023/04/03 21:01:02 UTC

[GitHub] [ignite-3] Flaugh24 opened a new pull request, #1890: IGNITE-19197 Refactor authentication

Flaugh24 opened a new pull request, #1890:
URL: https://github.com/apache/ignite-3/pull/1890

   https://issues.apache.org/jira/browse/IGNITE-19197


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] PakhomovAlexander merged pull request #1890: IGNITE-19197 Refactor authentication

Posted by "PakhomovAlexander (via GitHub)" <gi...@apache.org>.
PakhomovAlexander merged PR #1890:
URL: https://github.com/apache/ignite-3/pull/1890


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] PakhomovAlexander commented on a diff in pull request #1890: IGNITE-19197 Refactor authentication

Posted by "PakhomovAlexander (via GitHub)" <gi...@apache.org>.
PakhomovAlexander commented on code in PR #1890:
URL: https://github.com/apache/ignite-3/pull/1890#discussion_r1158185798


##########
modules/core/src/main/java/org/apache/ignite/lang/ErrorGroups.java:
##########
@@ -426,4 +426,15 @@ public static class GarbageCollector {
         /** Garbage collector closed error. */
         public static final int CLOSED_ERR = GC_ERR_GROUP.registerErrorCode(1);
     }
+
+    /**
+     * Authentication error group.
+     */
+    public static class Authentication {
+        /** Authentication error group. */
+        public static final ErrorGroup AUTHENTICATION_ERR_GROUP = ErrorGroup.newGroup("AUTHENTICATION", 15);
+
+        /** General authentication error. */
+        public static final int UNKNOWN_AUTHENTICATION_ERR = AUTHENTICATION_ERR_GROUP.registerErrorCode(1);

Review Comment:
   In case this is the general auth error, why the variable is called `UNKNOWN_*`? Looking at the rest of the code we can see such variables called `COMMON_*`.



##########
modules/security/src/main/java/org/apache/ignite/internal/security/authentication/AuthenticationManagerImpl.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.ignite.internal.security.authentication;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.stream.Collectors;
+import org.apache.ignite.configuration.NamedListView;
+import org.apache.ignite.configuration.notifications.ConfigurationNotificationEvent;
+import org.apache.ignite.internal.configuration.AuthenticationProviderView;
+import org.apache.ignite.internal.configuration.AuthenticationView;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
+import org.apache.ignite.internal.security.exception.AuthenticationException;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Implementation of {@link AuthenticationManager}.
+ */
+public class AuthenticationManagerImpl implements AuthenticationManager {
+
+    private static final IgniteLogger LOG = Loggers.forClass(AuthenticationManagerImpl.class);
+
+    private final ReadWriteLock rwLock = new ReentrantReadWriteLock();
+    private final List<Authenticator> authenticators = new ArrayList<>();

Review Comment:
   put empty lines between fields, please



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org