tengqm commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903381006


##########
docs/open-api/credentials.yaml:
##########
@@ -0,0 +1,130 @@
+# 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:
+
+  
/metalakes/{metalake}/objects/{metadataObjectType}/{metadataObjectFullName}/credentials:
+    parameters:
+      - $ref: "./openapi.yaml#/components/parameters/metalake"
+      - $ref: "./openapi.yaml#/components/parameters/metadataObjectType"
+      - $ref: "./openapi.yaml#/components/parameters/metadataObjectFullName"
+    get:
+      tags:
+        - credentials
+      summary: Get credentials
+      operationId: getCredentials
+      responses:
+        "200":
+          description: Returns the list of credential objects associated with 
specified metadata object.
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "#/components/responses/CredentialResponse"
+              examples:
+                CredentialResponse:
+                  $ref: "#/components/examples/CredentialResponse"
+        "400":
+          $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+        "404":

Review Comment:
   Since this is a "list" operation rather than a "get", we won't get a "404" 
error, right?
   If there are no credentials, returning an empty list should be desirable and 
it is not supposed to be treated as a "NotFound" error.



##########
docs/open-api/credentials.yaml:
##########
@@ -0,0 +1,130 @@
+# 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:
+
+  
/metalakes/{metalake}/objects/{metadataObjectType}/{metadataObjectFullName}/credentials:
+    parameters:
+      - $ref: "./openapi.yaml#/components/parameters/metalake"
+      - $ref: "./openapi.yaml#/components/parameters/metadataObjectType"
+      - $ref: "./openapi.yaml#/components/parameters/metadataObjectFullName"
+    get:
+      tags:
+        - credentials
+      summary: Get credentials
+      operationId: getCredentials
+      responses:
+        "200":
+          description: Returns the list of credential objects associated with 
specified metadata object.
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "#/components/responses/CredentialResponse"
+              examples:
+                CredentialResponse:
+                  $ref: "#/components/examples/CredentialResponse"
+        "400":
+          $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+        "404":
+          description: Not Found - The credential does not exist
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+              examples:
+                NoSuchCredentialException:
+                  $ref: "#/components/examples/NoSuchCredentialException"
+        "5xx":
+          $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+
+components:
+  schemas:
+    Credential:
+      type: object
+      description: A credential
+      required:
+        - credentialType
+        - expireTimeInMs
+        - credentialInfo
+      properties:
+        credentialType:
+          type: string
+          description: The type of the credential

Review Comment:
   I believe we have a `enum` for this field.



##########
docs/open-api/credentials.yaml:
##########
@@ -0,0 +1,130 @@
+# 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:
+
+  
/metalakes/{metalake}/objects/{metadataObjectType}/{metadataObjectFullName}/credentials:
+    parameters:
+      - $ref: "./openapi.yaml#/components/parameters/metalake"
+      - $ref: "./openapi.yaml#/components/parameters/metadataObjectType"
+      - $ref: "./openapi.yaml#/components/parameters/metadataObjectFullName"
+    get:
+      tags:
+        - credentials
+      summary: Get credentials
+      operationId: getCredentials
+      responses:
+        "200":
+          description: Returns the list of credential objects associated with 
specified metadata object.
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "#/components/responses/CredentialResponse"
+              examples:
+                CredentialResponse:
+                  $ref: "#/components/examples/CredentialResponse"
+        "400":
+          $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+        "404":
+          description: Not Found - The credential does not exist
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+              examples:
+                NoSuchCredentialException:
+                  $ref: "#/components/examples/NoSuchCredentialException"
+        "5xx":
+          $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+
+components:
+  schemas:
+    Credential:
+      type: object
+      description: A credential
+      required:
+        - credentialType
+        - expireTimeInMs
+        - credentialInfo
+      properties:
+        credentialType:
+          type: string
+          description: The type of the credential
+        expireTimeInMs:
+          type: long
+          description: The expire time of the credential

Review Comment:
   Please amend the description so that users know what this long number is.



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