lasdf1234 commented on code in PR #10971:
URL: https://github.com/apache/gravitino/pull/10971#discussion_r3212753105


##########
common/src/main/java/org/apache/gravitino/dto/requests/ResetPasswordRequest.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.dto.requests;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import lombok.Builder;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.ToString;
+import lombok.extern.jackson.Jacksonized;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.gravitino.rest.RESTRequest;
+
+/** Represents a request to reset a built-in IdP user password. */
+@Getter
+@EqualsAndHashCode
+@ToString
+@Builder
+@Jacksonized
+public class ResetPasswordRequest implements RESTRequest {
+
+  @JsonProperty("password")
+  private final String password;
+
+  /** Default constructor for ResetPasswordRequest. (Used for Jackson 
deserialization.) */
+  public ResetPasswordRequest() {
+    this(null);
+  }
+
+  /**
+   * Creates a new ResetPasswordRequest.
+   *
+   * @param password The new password of the built-in IdP user.
+   */
+  public ResetPasswordRequest(String password) {
+    super();
+    this.password = password;
+  }
+
+  /**
+   * Validates the {@link ResetPasswordRequest} request.
+   *
+   * @throws IllegalArgumentException If the request is invalid, this 
exception is thrown.
+   */
+  @Override
+  public void validate() throws IllegalArgumentException {
+    Preconditions.checkArgument(
+        StringUtils.isNotBlank(password), "\"password\" field is required and 
cannot be empty");
+  }

Review Comment:
   resolved



##########
server-common/src/main/java/org/apache/gravitino/server/authentication/AuthenticatorFactory.java:
##########
@@ -32,11 +32,12 @@
 public class AuthenticatorFactory {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(AuthenticatorFactory.class);
-
   public static final ImmutableMap<String, String> AUTHENTICATORS =
       ImmutableMap.of(
           AuthenticatorType.SIMPLE.name().toLowerCase(),
           SimpleAuthenticator.class.getCanonicalName(),
+          AuthenticatorType.BASIC.name().toLowerCase(),
+          SimpleAuthenticator.class.getCanonicalName(),
           AuthenticatorType.OAUTH.name().toLowerCase(),

Review Comment:
   resolved



-- 
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]

Reply via email to