You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "FANNG1 (via GitHub)" <gi...@apache.org> on 2025/01/03 08:28:21 UTC
[PR] [SIP] add credential openapi document [gravitino]
FANNG1 opened a new pull request, #6088:
URL: https://github.com/apache/gravitino/pull/6088
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#233] fix: check null before access result in xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
(Please outline the changes and how this PR fixes the issue.)
### Why are the changes needed?
(Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, describe the bug.)
Fix: # (issue)
### Does this PR introduce _any_ user-facing change?
(Please list the user-facing changes introduced by your change, including
1. Change in user-facing APIs.
2. Addition or removal of property keys.)
### How was this patch tested?
(Please test your changes, and provide instructions on how to test it:
1. If you add a feature or fix a bug, add a test to cover your changes.
2. If you fix a flaky test, repeat it for many times to prove it works.)
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#issuecomment-2568931524
@jerryshao @mchades @yuqi1129 PTAL
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "tengqm (via GitHub)" <gi...@apache.org>.
tengqm commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903745630
##########
docs/open-api/credentials.yaml:
##########
@@ -0,0 +1,110 @@
+# 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"
+ "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, for example, s3-token, s3-secret-key, oss-token, oss-secret-key, gcs-token, adls-token, azure-account-key, etc.
Review Comment:
Thanks for mentioning the credential type examples.
Although not in the scope of this PR, I'm still wondering if we need to add an API for users to retrieve a list of supported credential types.
##########
docs/open-api/credentials.yaml:
##########
@@ -68,7 +59,7 @@ components:
type: string
description: The type of the credential, for example, s3-token, s3-secret-key, oss-token, oss-secret-key, gcs-token, adls-token, azure-account-key, etc.
expireTimeInMs:
- type: long
+ type: integer
description: The expiration time of the credential in milliseconds since the epoch, 0 means not expire.
Review Comment:
Gocha. :)
This is not supposed to be a time elapsed since epoch.
It is supposed to be time duration in milliseconds when the credential (e.g. a certificate) will expire.
##########
docs/open-api/credentials.yaml:
##########
@@ -0,0 +1,110 @@
+# 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"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+
+components:
+ schemas:
+ Credential:
+ type: object
+ description: A credential
+ required:
+ - credentialType
+ - expireTimeInMs
+ - credentialInfo
+ properties:
+ credentialType:
Review Comment:
I wouldn't call this `credentialType` because the property has a well-defined scope.
E.g. when I'm modeling a `Person`, I'll simply add a `gender` property rather than
naming it as `personGender`.
This can be pretty simple, e.g.
`{"type": "gcs-token", "expireTimeInMs": 12345, "data": {"token": "secret"}}`
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "tengqm (via GitHub)" <gi...@apache.org>.
tengqm commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1904106432
##########
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:
> 404 accurately indicates that the requested resource, including any part of the URL path, cannot be found on the server.
No. If the URL path is incorrectly formatted, such as containing illegal characters, the request is not valid. The error is from the client side. So the return value should be 400.
404 has a crystal clear definition - the target resource is not found. The target resource is a singular object of a specific type. You cannot use 404 to indicate that the metalake is not found or the schema is not found or the meta-object is not found.
This is an obvious abuse of the HTTP status code.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "tengqm (via GitHub)" <gi...@apache.org>.
tengqm commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1904778973
##########
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:
> Your interpretation of "target resource" seems too narrow in the context of RESTful APIs. The HTTP specification ([RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.4)) states that 404 applies when "the origin server did not find a current representation for the target resource." In REST, each path segment is considered a resource, not just the final element.
Correct. That was my interpretation, an interpretation I have seen in almost all RESTful API related web services. The "target resource", in this context, is the MetaObject. The 'metalake', 'schema' are all parameters (`in: path`) to get a MetaObject. If we say "not found", we mean, and only mean, the target MetaObject resource is not found. We are not confusing users (including client side software) that the metalake and the schema are correct, just that specific MetaObject is not found.
> GET /repos/{owner}/{repo}
This is not a "LIST" API. If you do `GET /repos`, where the path ends with a plural noun, the operation is a "LIST". For a "LIST" operation, the result is a list, which could be empty (`[]`). We are not telling users that a list is not found.
GitHub is not a good example. Its API was designed long before we have a RESTful convention. Their interpration of `/repos/{owner}/{repo}` is equivalent to `/repos?owner=foo&repo=bar`, and they also failed to enforce that the result is a list.
For this particular request:
> `GET /metalakes/{metalake}/objects/{type}/{name}/credentials`
Returning 404 is absolutely wrong. We are not checking a "specific resource", we are listing a collection.
It is okay to return a 404 for the following request:
> `GET /metalakes/{metalake}/objects/{obj-type}/{obj-name}/credentials/{id}`
because this is a "get" rather than a list. If there is no credential with the given ID, we return 404 NotFound.
If any of the `metalake`, `obj-type`, `obj-name` contains a `\@%)@*#$&`, we say 400 InvalidRequest. We are not responding with 404 which could be incorrectly interpreted as there is no MetaObjects in the metalake `\@%)@*#$&`. `metalake` should not be treated as a query string. It is part of the resource hierarchy in the system. Similarly, `obj-type` and `obj-name` are there for narrowing the scope for the **list** operation.
How about `GET /credentials/?metalake=m&obj-type=t&obj-name=n` then? Can we return 404
then? The answer is still a big NO. This is a list operation. There is no "target resource" here. There is only a concept of target resource collection.
This is important. We cannot abuse 404, i.e. we cannot use the same 404 to express "the metalake is not found, OR the object type is not found, OR the object name is not found", we are not generalizing the target resource to anything other than a MetaObject.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903757938
##########
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:
I observe that the request path specifies the metalake name; if the metalake is nonexistent, should a 404 error be returned?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903794759
##########
docs/open-api/credentials.yaml:
##########
@@ -68,7 +59,7 @@ components:
type: string
description: The type of the credential, for example, s3-token, s3-secret-key, oss-token, oss-secret-key, gcs-token, adls-token, azure-account-key, etc.
expireTimeInMs:
- type: long
+ type: integer
description: The expiration time of the credential in milliseconds since the epoch, 0 means not expire.
Review Comment:
It's not an time duration, because the credential may need some time to transfer from server side to client side, which makes duration not correct.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1904207433
##########
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:
`404` is widely used for `NoSuchMetalakeException` exception, How about creating a separate issue to track this?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1904826402
##########
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:
Iceberg REST catalog does the same thing, right?
https://github.com/apache/iceberg/blob/fc923b3af65b0e3cb28a9afb69f7fd05c88f62ca/open-api/rest-catalog-open-api.yaml#L497-L528
Could you present some existing project examples to substantiate your perspective? Such behavior is likely prevalent and adhered to by numerous projects.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "tengqm (via GitHub)" <gi...@apache.org>.
tengqm commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903835868
##########
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:
If a metalake or a schema or whatever upper-level entity is not found, this request should return a 400. It is a misconfigured REST request, because the `path` cannot be matched by the Web layer.
404 means not found, it means and only means the meta object is not found.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "tengqm (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades merged PR #6088:
URL: https://github.com/apache/gravitino/pull/6088
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903617640
##########
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:
updated
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903742802
##########
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:
Yes, it's odd to return 404 for list operations. removed `NoSuchCredential from the API`
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1901702709
##########
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: List credentials for metadata object
Review Comment:
updated
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903742802
##########
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:
Yes, it's odd to return 404 for list operations. removed `NoSuchCredential` from the API
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1904270965
##########
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:
> This is an obvious abuse of the HTTP status code.
Your interpretation of "target resource" seems too narrow in the context of RESTful APIs. The HTTP specification ([RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.4)) states that 404 applies when "the origin server did not find a current representation for the target resource." In REST, each path segment is considered a resource, not just the final element.
GitHub's API provides a clear example of this practice. Consider their endpoint for getting a repository:
GET /repos/{owner}/{repo}
If either the {owner} or {repo} doesn't exist, GitHub returns a 404 status code. For instance, requesting https://api.github.com/repos/nonexistent-user/some-repo returns 404, even though the error is in the 'owner' part of the path, not the final resource.
You can verify this behavior and see the documentation here:
https://docs.github.com/en/rest/repos/repos#get-a-repository
This approach aligns with RESTful design principles, providing clear feedback about resource availability throughout the URL path, and is consistent with industry best practices.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "tengqm (via GitHub)" <gi...@apache.org>.
tengqm commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1904862735
##########
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:
There have been maaany debates on this. And I don't think we will change that.
See:
- https://stackoverflow.com/questions/9930695/rest-api-404-bad-uri-or-missing-resource
- https://dev.to/mdamaceno/404-status-code-really-11k6
Some examples:
- https://docs.openstack.org/api-ref/compute/#list-servers, No 404 is returned for a list operation.
- https://docs.openstack.org/api-ref/compute/#show-server-details, 404 means the server is not found.
What I was trying to advocate is this clear distinction as some people suggested:
<img width="605" alt="image" src="https://github.com/user-attachments/assets/c6bb89cb-e850-425d-98f6-fdd6ae466200" />
Or, this
<img width="731" alt="image" src="https://github.com/user-attachments/assets/15b432ec-7fec-42d7-9e2a-0b68f60bbcfd" />
It makes the life for a client developer much easier.
Whatever, this discussion can end here.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903798689
##########
docs/open-api/credentials.yaml:
##########
@@ -0,0 +1,110 @@
+# 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"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+
+components:
+ schemas:
+ Credential:
+ type: object
+ description: A credential
+ required:
+ - credentialType
+ - expireTimeInMs
+ - credentialInfo
+ properties:
+ credentialType:
Review Comment:
Yes, thanks for pointing this out, I agree with you, how about keeping this as it has been published as API, I will try to use the short style for new features.
##########
docs/open-api/credentials.yaml:
##########
@@ -0,0 +1,110 @@
+# 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"
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+
+components:
+ schemas:
+ Credential:
+ type: object
+ description: A credential
+ required:
+ - credentialType
+ - expireTimeInMs
+ - credentialInfo
+ properties:
+ credentialType:
Review Comment:
Yes, thanks for pointing this out, I agree with you, how about keeping this as it has been published as API? I will try to use the short style for new features.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903615902
##########
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:
Review Comment:
updated
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903617964
##########
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:
we didn't define an `enum` because we should support custom credentials. add the build-in credentials
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1904826402
##########
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:
The Iceberg REST catalog operates in a similar manner, right?
https://github.com/apache/iceberg/blob/fc923b3af65b0e3cb28a9afb69f7fd05c88f62ca/open-api/rest-catalog-open-api.yaml#L497-L528
Could you present some existing project examples to substantiate your perspective? Such behavior is likely prevalent and adhered to by numerous projects.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903486038
##########
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:
Review Comment:
you should also add the path to `openapi.yaml`
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903930598
##########
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:
404 accurately indicates that the requested resource, including any part of the URL path, cannot be found on the server.
400 Bad Request, on the other hand, is more suitable for malformed requests, such as invalid syntax or improper formatting, rather than for resources that simply don't exist.
metalake is also a meta object
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903796237
##########
docs/open-api/credentials.yaml:
##########
@@ -0,0 +1,110 @@
+# 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"
+ "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, for example, s3-token, s3-secret-key, oss-token, oss-secret-key, gcs-token, adls-token, azure-account-key, etc.
Review Comment:
I couldn't figure out usage scenarios about this API, we could add it if requried.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1903828687
##########
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:
updated, and noticed some `tag` API missing `NoSuchXX` too, also fixed in this PR.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6092] docs(core): add credential openapi document [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #6088:
URL: https://github.com/apache/gravitino/pull/6088#discussion_r1901660919
##########
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: List credentials for metadata object
Review Comment:
Summary will be used as the title in the sidebar (https://gravitino.apache.org/docs/0.7.0-incubating/api/rest/list-catalogs), it should not be too long.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org