Copilot commented on code in PR #10971:
URL: https://github.com/apache/gravitino/pull/10971#discussion_r3212802579
##########
server/src/main/java/org/apache/gravitino/server/GravitinoServer.java:
##########
@@ -123,6 +128,10 @@ public ServerConfig serverConfig() {
}
private void initializeRestApi() {
+ boolean enableBasicAuthenticator =
+ serverConfig
+ .get(Configs.AUTHENTICATORS)
+ .contains(AuthenticatorType.BASIC.name().toLowerCase());
Review Comment:
`initializeRestApi()` treats `Configs.AUTHENTICATORS` containing `basic` as
a valid runtime mode (used to enable IdP APIs). However, the current
authenticator wiring does not provide a BASIC authenticator mapping
(AuthenticatorFactory only maps simple/oauth/kerberos), so setting
`AUTHENTICATORS=basic` will fail during server initialization (ClassNotFound
for "basic") before these endpoints can ever be used. Either add a real BASIC
authenticator implementation + factory mapping, or gate IdP APIs behind a
separate config that doesn’t require `AUTHENTICATORS` to include an unsupported
entry.
##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/IdpGroupUserRelSQLProviderFactory.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.storage.relational.mapper;
+
+import com.google.common.collect.ImmutableMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.gravitino.storage.relational.JDBCBackend.JDBCBackendType;
+import
org.apache.gravitino.storage.relational.mapper.provider.base.IdpGroupUserRelBaseSQLProvider;
+import
org.apache.gravitino.storage.relational.mapper.provider.postgresql.IdpGroupUserRelPostgreSQLProvider;
+import org.apache.gravitino.storage.relational.po.IdpGroupUserRelPO;
+import org.apache.gravitino.storage.relational.session.SqlSessionFactoryHelper;
+import org.apache.ibatis.annotations.Param;
+
+public class IdpGroupUserRelSQLProviderFactory {
+
+ private static final Map<JDBCBackendType, IdpGroupUserRelBaseSQLProvider>
+ IDP_GROUP_USER_RELATION_SQL_PROVIDER_MAP =
+ ImmutableMap.of(
+ JDBCBackendType.MYSQL, new IdpGroupUserRelMySQLProvider(),
+ JDBCBackendType.H2, new IdpGroupUserRelH2Provider(),
+ JDBCBackendType.POSTGRESQL, new
IdpGroupUserRelPostgreSQLProvider());
+
+ public static IdpGroupUserRelBaseSQLProvider getProvider() {
+ String databaseId =
+ SqlSessionFactoryHelper.getInstance()
+ .getSqlSessionFactory()
+ .getConfiguration()
+ .getDatabaseId();
+
+ JDBCBackendType jdbcBackendType = JDBCBackendType.fromString(databaseId);
+ return IDP_GROUP_USER_RELATION_SQL_PROVIDER_MAP.get(jdbcBackendType);
+ }
+
+ static class IdpGroupUserRelMySQLProvider extends
IdpGroupUserRelBaseSQLProvider {}
+
+ static class IdpGroupUserRelH2Provider extends
IdpGroupUserRelBaseSQLProvider {}
+
Review Comment:
This factory defines an inner `IdpGroupUserRelH2Provider`, but there is also
a top-level
`org.apache.gravitino.storage.relational.mapper.provider.h2.IdpGroupUserRelH2Provider`
class in this PR. Since the factory currently instantiates the inner class,
the top-level provider becomes dead code (only exercised by tests), which is
confusing and easy to diverge later. Prefer using the dedicated provider class
in the factory (and drop the inner one), or delete the unused provider
class/tests.
##########
docs/open-api/idp.yaml:
##########
@@ -0,0 +1,510 @@
+# 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.
+
+---
+
+paths:
+
+ /idp/users:
+ post:
+ tags:
+ - authentication
+ summary: Add built-in IdP user
+ operationId: addIdpUser
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CreateIdpUserRequest"
+ examples:
+ CreateIdpUserRequest:
+ $ref: "#/components/examples/CreateIdpUserRequest"
+ responses:
+ "200":
+ description: Returns the added built-in IdP user
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpUserResponse"
+ examples:
+ IdpUserResponse:
+ $ref: "#/components/examples/IdpUserResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "409":
+ description: Conflict - The target built-in IdP user already exists
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ UserAlreadyExistsException:
+ $ref: "#/components/examples/UserAlreadyExistsException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/users/{user}:
+ parameters:
+ - $ref: "./openapi.yaml#/components/parameters/user"
+
+ get:
+ tags:
+ - authentication
+ summary: Get built-in IdP user
+ operationId: getIdpUser
+ responses:
+ "200":
+ description: Returns the built-in IdP user
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpUserResponse"
+ examples:
+ IdpUserResponse:
+ $ref: "#/components/examples/IdpUserResponse"
+ "404":
+ description: Not Found - The specified built-in IdP user does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ put:
+ tags:
+ - authentication
+ summary: Reset built-in IdP user password
+ operationId: resetIdpUserPassword
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ResetIdpUserPasswordRequest"
+ examples:
+ ResetIdpUserPasswordRequest:
+ $ref: "#/components/examples/ResetIdpUserPasswordRequest"
+ responses:
+ "200":
+ description: Returns the updated built-in IdP user
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpUserResponse"
+ examples:
+ IdpUserResponse:
+ $ref: "#/components/examples/IdpUserResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "404":
+ description: Not Found - The specified built-in IdP user does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ delete:
+ tags:
+ - authentication
+ summary: Remove built-in IdP user
+ operationId: removeIdpUser
+ responses:
+ "200":
+ $ref: "./openapi.yaml#/components/responses/RemoveResponse"
+ "404":
+ description: Not Found - The specified built-in IdP user does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/groups:
+ post:
+ tags:
+ - authentication
+ summary: Add built-in IdP group
+ operationId: addIdpGroup
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CreateIdpGroupRequest"
+ examples:
+ CreateIdpGroupRequest:
+ $ref: "#/components/examples/CreateIdpGroupRequest"
+ responses:
+ "200":
+ description: Returns the added built-in IdP group
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpGroupResponse"
+ examples:
+ IdpGroupResponse:
+ $ref: "#/components/examples/IdpGroupResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "409":
+ description: Conflict - The target built-in IdP group already exists
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ GroupAlreadyExistsException:
+ $ref: "#/components/examples/GroupAlreadyExistsException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/groups/{group}:
+ parameters:
+ - $ref: "./openapi.yaml#/components/parameters/group"
+
+ get:
+ tags:
+ - authentication
+ summary: Get built-in IdP group
+ operationId: getIdpGroup
+ responses:
+ "200":
+ description: Returns the built-in IdP group
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpGroupResponse"
+ examples:
+ IdpGroupResponse:
+ $ref: "#/components/examples/IdpGroupResponse"
+ "404":
+ description: Not Found - The specified built-in IdP group does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchGroupException:
+ $ref: "#/components/examples/NoSuchGroupException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ delete:
+ tags:
+ - authentication
+ summary: Remove built-in IdP group
+ operationId: removeIdpGroup
+ parameters:
+ - name: force
+ in: query
+ required: false
+ schema:
+ type: boolean
+ default: false
+ description: Whether to force removal of the built-in IdP group
+ responses:
+ "200":
+ $ref: "./openapi.yaml#/components/responses/RemoveResponse"
+ "404":
+ description: Not Found - The specified built-in IdP group does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchGroupException:
+ $ref: "#/components/examples/NoSuchGroupException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/groups/{group}/add:
+ parameters:
+ - $ref: "./openapi.yaml#/components/parameters/group"
+
+ put:
+ tags:
+ - authentication
+ summary: Add users to built-in IdP group
+ operationId: addUsersToIdpGroup
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/UpdateIdpGroupUsersRequest"
+ examples:
+ UpdateIdpGroupUsersRequest:
+ $ref: "#/components/examples/UpdateIdpGroupUsersRequest"
+ responses:
+ "200":
+ description: Returns the updated built-in IdP group
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpGroupResponse"
+ examples:
+ IdpGroupResponse:
+ $ref: "#/components/examples/IdpGroupResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "404":
+ description: Not Found - The specified built-in IdP group or user
does not exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchGroupException:
+ $ref: "#/components/examples/NoSuchGroupException"
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/groups/{group}/remove:
+ parameters:
+ - $ref: "./openapi.yaml#/components/parameters/group"
+
+ put:
+ tags:
+ - authentication
+ summary: Remove users from built-in IdP group
+ operationId: removeUsersFromIdpGroup
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/UpdateIdpGroupUsersRequest"
+ examples:
+ UpdateIdpGroupUsersRequest:
+ $ref: "#/components/examples/UpdateIdpGroupUsersRequest"
+ responses:
+ "200":
+ description: Returns the updated built-in IdP group
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpGroupResponse"
+ examples:
+ IdpGroupResponse:
+ $ref: "#/components/examples/IdpGroupResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "404":
+ description: Not Found - The specified built-in IdP group or user
does not exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchGroupException:
+ $ref: "#/components/examples/NoSuchGroupException"
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+components:
+ schemas:
+ IdpUser:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ description: The name of the built-in IdP user
+ groups:
+ type: array
+ description: The built-in IdP groups the user belongs to
+ items:
+ type: string
+
+ IdpGroup:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ description: The name of the built-in IdP group
+ users:
+ type: array
+ description: The built-in IdP users that belong to the group
+ items:
+ type: string
+
+ CreateIdpUserRequest:
+ type: object
+ required:
+ - user
+ - password
+ properties:
+ user:
+ type: string
+ description: The name of the built-in IdP user
+ password:
+ type: string
+ description: The password of the built-in IdP user
+
+ ResetIdpUserPasswordRequest:
+ type: object
+ required:
+ - password
+ properties:
+ password:
+ type: string
+ description: The new password of the built-in IdP user
+
+ CreateIdpGroupRequest:
+ type: object
+ required:
+ - group
+ properties:
+ group:
+ type: string
+ description: The name of the built-in IdP group
+
+ UpdateIdpGroupUsersRequest:
+ type: object
+ required:
+ - users
+ properties:
+ users:
+ type: array
+ description: The built-in IdP users to add or remove
+ items:
+ type: string
+
+ IdpUserResponse:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ description: Status code of the response
+ enum:
+ - 0
+ user:
+ $ref: "#/components/schemas/IdpUser"
+
+ IdpGroupResponse:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ description: Status code of the response
+ enum:
+ - 0
+ group:
+ $ref: "#/components/schemas/IdpGroup"
+
+ examples:
+ CreateIdpUserRequest:
+ value: {
+ "user": "user1",
+ "password": "Passw0rd"
+ }
+
+ ResetIdpUserPasswordRequest:
+ value: {
+ "password": "NewPassw0rd"
+ }
Review Comment:
The OpenAPI example uses password `NewPassw0rd` (11 chars), but the server
enforces a minimum password length of 12 for built-in IdP users. Update the
example to a valid password (>= 12 chars) and consider adding
`minLength`/`maxLength` to the schema for better client-side validation.
##########
docs/open-api/idp.yaml:
##########
@@ -0,0 +1,510 @@
+# 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.
+
+---
+
+paths:
+
+ /idp/users:
+ post:
+ tags:
+ - authentication
+ summary: Add built-in IdP user
+ operationId: addIdpUser
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CreateIdpUserRequest"
+ examples:
+ CreateIdpUserRequest:
+ $ref: "#/components/examples/CreateIdpUserRequest"
+ responses:
+ "200":
+ description: Returns the added built-in IdP user
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpUserResponse"
+ examples:
+ IdpUserResponse:
+ $ref: "#/components/examples/IdpUserResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "409":
+ description: Conflict - The target built-in IdP user already exists
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ UserAlreadyExistsException:
+ $ref: "#/components/examples/UserAlreadyExistsException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/users/{user}:
+ parameters:
+ - $ref: "./openapi.yaml#/components/parameters/user"
+
+ get:
+ tags:
+ - authentication
+ summary: Get built-in IdP user
+ operationId: getIdpUser
+ responses:
+ "200":
+ description: Returns the built-in IdP user
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpUserResponse"
+ examples:
+ IdpUserResponse:
+ $ref: "#/components/examples/IdpUserResponse"
+ "404":
+ description: Not Found - The specified built-in IdP user does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ put:
+ tags:
+ - authentication
+ summary: Reset built-in IdP user password
+ operationId: resetIdpUserPassword
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ResetIdpUserPasswordRequest"
+ examples:
+ ResetIdpUserPasswordRequest:
+ $ref: "#/components/examples/ResetIdpUserPasswordRequest"
+ responses:
+ "200":
+ description: Returns the updated built-in IdP user
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpUserResponse"
+ examples:
+ IdpUserResponse:
+ $ref: "#/components/examples/IdpUserResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "404":
+ description: Not Found - The specified built-in IdP user does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ delete:
+ tags:
+ - authentication
+ summary: Remove built-in IdP user
+ operationId: removeIdpUser
+ responses:
+ "200":
+ $ref: "./openapi.yaml#/components/responses/RemoveResponse"
+ "404":
+ description: Not Found - The specified built-in IdP user does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/groups:
+ post:
+ tags:
+ - authentication
+ summary: Add built-in IdP group
+ operationId: addIdpGroup
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CreateIdpGroupRequest"
+ examples:
+ CreateIdpGroupRequest:
+ $ref: "#/components/examples/CreateIdpGroupRequest"
+ responses:
+ "200":
+ description: Returns the added built-in IdP group
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpGroupResponse"
+ examples:
+ IdpGroupResponse:
+ $ref: "#/components/examples/IdpGroupResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "409":
+ description: Conflict - The target built-in IdP group already exists
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ GroupAlreadyExistsException:
+ $ref: "#/components/examples/GroupAlreadyExistsException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/groups/{group}:
+ parameters:
+ - $ref: "./openapi.yaml#/components/parameters/group"
+
+ get:
+ tags:
+ - authentication
+ summary: Get built-in IdP group
+ operationId: getIdpGroup
+ responses:
+ "200":
+ description: Returns the built-in IdP group
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpGroupResponse"
+ examples:
+ IdpGroupResponse:
+ $ref: "#/components/examples/IdpGroupResponse"
+ "404":
+ description: Not Found - The specified built-in IdP group does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchGroupException:
+ $ref: "#/components/examples/NoSuchGroupException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ delete:
+ tags:
+ - authentication
+ summary: Remove built-in IdP group
+ operationId: removeIdpGroup
+ parameters:
+ - name: force
+ in: query
+ required: false
+ schema:
+ type: boolean
+ default: false
+ description: Whether to force removal of the built-in IdP group
+ responses:
+ "200":
+ $ref: "./openapi.yaml#/components/responses/RemoveResponse"
+ "404":
+ description: Not Found - The specified built-in IdP group does not
exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchGroupException:
+ $ref: "#/components/examples/NoSuchGroupException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/groups/{group}/add:
+ parameters:
+ - $ref: "./openapi.yaml#/components/parameters/group"
+
+ put:
+ tags:
+ - authentication
+ summary: Add users to built-in IdP group
+ operationId: addUsersToIdpGroup
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/UpdateIdpGroupUsersRequest"
+ examples:
+ UpdateIdpGroupUsersRequest:
+ $ref: "#/components/examples/UpdateIdpGroupUsersRequest"
+ responses:
+ "200":
+ description: Returns the updated built-in IdP group
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpGroupResponse"
+ examples:
+ IdpGroupResponse:
+ $ref: "#/components/examples/IdpGroupResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "404":
+ description: Not Found - The specified built-in IdP group or user
does not exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchGroupException:
+ $ref: "#/components/examples/NoSuchGroupException"
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+ /idp/groups/{group}/remove:
+ parameters:
+ - $ref: "./openapi.yaml#/components/parameters/group"
+
+ put:
+ tags:
+ - authentication
+ summary: Remove users from built-in IdP group
+ operationId: removeUsersFromIdpGroup
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/UpdateIdpGroupUsersRequest"
+ examples:
+ UpdateIdpGroupUsersRequest:
+ $ref: "#/components/examples/UpdateIdpGroupUsersRequest"
+ responses:
+ "200":
+ description: Returns the updated built-in IdP group
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "#/components/schemas/IdpGroupResponse"
+ examples:
+ IdpGroupResponse:
+ $ref: "#/components/examples/IdpGroupResponse"
+ "400":
+ $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+ "404":
+ description: Not Found - The specified built-in IdP group or user
does not exist
+ content:
+ application/vnd.gravitino.v1+json:
+ schema:
+ $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+ examples:
+ NoSuchGroupException:
+ $ref: "#/components/examples/NoSuchGroupException"
+ NoSuchUserException:
+ $ref: "#/components/examples/NoSuchUserException"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+components:
+ schemas:
+ IdpUser:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ description: The name of the built-in IdP user
+ groups:
+ type: array
+ description: The built-in IdP groups the user belongs to
+ items:
+ type: string
+
+ IdpGroup:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ description: The name of the built-in IdP group
+ users:
+ type: array
+ description: The built-in IdP users that belong to the group
+ items:
+ type: string
+
+ CreateIdpUserRequest:
+ type: object
+ required:
+ - user
+ - password
+ properties:
+ user:
+ type: string
+ description: The name of the built-in IdP user
+ password:
+ type: string
+ description: The password of the built-in IdP user
+
+ ResetIdpUserPasswordRequest:
+ type: object
+ required:
+ - password
+ properties:
+ password:
+ type: string
+ description: The new password of the built-in IdP user
+
+ CreateIdpGroupRequest:
+ type: object
+ required:
+ - group
+ properties:
+ group:
+ type: string
+ description: The name of the built-in IdP group
+
+ UpdateIdpGroupUsersRequest:
+ type: object
+ required:
+ - users
+ properties:
+ users:
+ type: array
+ description: The built-in IdP users to add or remove
+ items:
+ type: string
+
+ IdpUserResponse:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ description: Status code of the response
+ enum:
+ - 0
+ user:
+ $ref: "#/components/schemas/IdpUser"
+
+ IdpGroupResponse:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ description: Status code of the response
+ enum:
+ - 0
+ group:
+ $ref: "#/components/schemas/IdpGroup"
+
+ examples:
+ CreateIdpUserRequest:
+ value: {
+ "user": "user1",
+ "password": "Passw0rd"
+ }
Review Comment:
The OpenAPI example uses password `Passw0rd` (8 chars), but the server
enforces a minimum password length of 12 for built-in IdP users. This example
will always fail if copied by clients. Update the example to a valid password
(>= 12 chars) and ideally document the length constraints.
--
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]