Copilot commented on code in PR #11022:
URL: https://github.com/apache/gravitino/pull/11022#discussion_r3214717246


##########
plugins/idp-basic/src/main/java/org/apache/gravitino/idp/basic/dto/requests/CreateUserRequest.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.idp.basic.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 create a built-in IdP user. */
+@Getter
+@EqualsAndHashCode
+@ToString
+@Builder
+@Jacksonized
+public class CreateUserRequest implements RESTRequest {
+
+  @JsonProperty("user")
+  private final String user;
+
+  @JsonProperty("password")
+  @ToString.Exclude
+  private final String password;

Review Comment:
   The request payload uses JSON properties `"user"` and `"group"` for the 
resource name, which is inconsistent with the existing REST request models that 
use `"name"` (e.g., common `UserAddRequest`/`GroupAddRequest`). This makes the 
IdP API harder to consume and inconsistent with the response DTOs which expose 
`name`. Consider renaming the field/JSON property to `"name"` (and aligning 
accessor names accordingly) for consistency across APIs.



##########
plugins/idp-basic/src/main/java/org/apache/gravitino/idp/basic/dto/requests/CreateGroupRequest.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.idp.basic.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 create a built-in IdP group. */
+@Getter
+@EqualsAndHashCode
+@ToString
+@Builder
+@Jacksonized
+public class CreateGroupRequest implements RESTRequest {
+
+  @JsonProperty("group")
+  private final String group;
+

Review Comment:
   The request payload uses JSON property `"group"` for the group name, which 
is inconsistent with the rest of the REST request DTOs in the codebase that 
generally use `"name"` (e.g., `GroupAddRequest`). Aligning on `"name"` would 
make the IdP API more consistent and reduce confusion (especially since the 
group DTO/response uses `name`).



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