morningman commented on code in PR #60407:
URL: https://github.com/apache/doris/pull/60407#discussion_r2779347938


##########
fe/fe-authentication/fe-authentication-handler/src/main/java/org/apache/doris/authentication/handler/PluginManager.java:
##########
@@ -0,0 +1,195 @@
+// 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.doris.authentication.handler;
+
+import org.apache.doris.authentication.AuthenticationPluginType;
+import org.apache.doris.authentication.AuthenticationProfile;
+import org.apache.doris.authentication.spi.AuthenticationException;
+import org.apache.doris.authentication.spi.AuthenticationPlugin;
+import org.apache.doris.authentication.spi.AuthenticationPluginFactory;
+import org.apache.doris.extension.loader.ChildFirstClassLoader;
+import org.apache.doris.extension.loader.PluginLoader;
+import org.apache.doris.extension.spi.PluginDescriptor;
+import org.apache.doris.extension.spi.PluginException;
+import org.apache.doris.extension.spi.PluginFactory;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.ServiceLoader;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Manager for authentication plugins.
+ *
+ * <p>Handles plugin instance lifecycle: creation, caching, health checks, 
reloading.
+ * Uses {@link ServiceLoader} for classpath plugins and {@link PluginLoader}
+ * for external plugins.</p>
+ */
+public class PluginManager {

Review Comment:
   ```suggestion
   public class AuthPluginManager {
   ```



##########
fe/fe-authentication/fe-authentication-api/src/main/java/org/apache/doris/authentication/Subject.java:
##########
@@ -0,0 +1,257 @@
+// 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.doris.authentication;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * Authorization subject representing a user session.
+ *
+ * <p>Subject is the authorization-layer representation of an authenticated 
user.
+ * It contains the user identity (via {@link Principal}) plus role information
+ * needed for access control decisions.
+ *
+ * <p>Design note: Subject focuses purely on authorization concerns:
+ * <ul>
+ *   <li>WHO - the authenticated principal</li>
+ *   <li>WHAT ROLES - active and available roles</li>
+ *   <li>WHERE FROM - source IP for IP-based access control</li>
+ * </ul>
+ *
+ * <p>Protocol-specific information (connection type, client info) belongs
+ * in the session context, not the Subject.
+ *
+ * <p>This design follows the standard security pattern where:
+ * <ul>
+ *   <li>Authentication produces a Principal</li>
+ *   <li>Principal + Roles = Subject</li>
+ *   <li>Subject is used for authorization decisions</li>
+ * </ul>
+ *
+ * @see Principal
+ * @see Identity
+ */
+public final class Subject {

Review Comment:
   what is diff between Subject and Principal?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to