bharos commented on code in PR #9788: URL: https://github.com/apache/gravitino/pull/9788#discussion_r2722907887
########## core/src/main/java/org/apache/gravitino/auth/KerberosPrincipalParser.java: ########## @@ -0,0 +1,216 @@ +/* + * 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.gravitino.auth; + +import java.security.Principal; +import java.util.Objects; +import java.util.Optional; + +/** + * Represents a Kerberos principal with structured information. + * + * <p>A Kerberos principal has the format: {@code user[/instance][@REALM]} where: + * + * <ul> + * <li><b>username</b> (required): The primary component, typically the user or service name + * <li><b>instance</b> (optional): The secondary component, often a hostname for service + * principals + * <li><b>realm</b> (optional): The Kerberos realm (domain), typically uppercase + * </ul> + * + * <p>Examples: + * + * <ul> + * <li>{@code john} - username only + * <li>{@code [email protected]} - username with realm + * <li>{@code HTTP/[email protected]} - service principal with instance and realm + * </ul> + */ +public class KerberosPrincipalParser implements Principal { Review Comment: @jerqi @yangyuxia I added a class like this, but currently it is not used in the code. But the point is that users can create custom authenticators using this class easily (as I have added in documentation). LMK if it will be useful to keep this class. -- 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]
