Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#6092] docs(core): add credential openapi document #6088

Merged
merged 9 commits into from
Jan 7, 2025

Conversation

FANNG1
Copy link
Contributor

@FANNG1 FANNG1 commented Jan 3, 2025

What changes were proposed in this pull request?

add credential openapi document

Why are the changes needed?

Fix: #6092

Does this PR introduce any user-facing change?

no

How was this patch tested?

just document

@FANNG1 FANNG1 marked this pull request as draft January 3, 2025 08:28
diqiu50 pushed a commit to diqiu50/gravitino that referenced this pull request Jan 3, 2025
…che#6039)

### What changes were proposed in this pull request?

Remove the unnecessary `CONTRIBUTING` file under `.github` folder.

### Why are the changes needed?

It's not necessary to add this file in `.github` folder.

Fix: apache#6008 

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

N/A
@FANNG1 FANNG1 changed the title [SIP] add credential openapi document [#6092] docs(core): add credential openapi document Jan 3, 2025
@FANNG1 FANNG1 marked this pull request as ready for review January 3, 2025 09:27
@FANNG1
Copy link
Contributor Author

FANNG1 commented Jan 3, 2025

@jerryshao @mchades @yuqi1129 PTAL

get:
tags:
- credentials
summary: List credentials for metadata object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

docs/open-api/credentials.yaml Show resolved Hide resolved
properties:
credentialType:
type: string
description: The type of the credential
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we have a enum for this field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we didn't define an enum because we should support custom credentials. add the build-in credentials

description: The type of the credential
expireTimeInMs:
type: long
description: The expire time of the credential
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@jerryshao jerryshao requested a review from mchades January 6, 2025 02:16
@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't figure out usage scenarios about this API, we could add it if requried.

- expireTimeInMs
- credentialInfo
properties:
credentialType:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

@FANNG1 FANNG1 Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mchades mchades merged commit b3a848b into apache:main Jan 7, 2025
28 checks passed
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this pull request Jan 9, 2025
### What changes were proposed in this pull request?
add credential openapi document 

### Why are the changes needed?

Fix: apache#6092 

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
just document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Subtask] add credential openAPI document
4 participants