-
Notifications
You must be signed in to change notification settings - Fork 334
Add support for API keys #14188
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
base: develop
Are you sure you want to change the base?
Add support for API keys #14188
Conversation
| Week = 'Week', | ||
| Month = 'Month', | ||
| Year = 'Year', | ||
| Indefinetly = 'Indefinetly', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PabloBuchu Indefinitely is the correct spelling (but maybe Indefinite is more appropriate, given that the others aren't Yearly (for example))
| .min(1) | ||
| .refine((name) => !apiKeyNames.has(name), getText('duplicateApiKeyError')), | ||
| description: z.string(), | ||
| expiresIn: z.enum([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
z.nativeEnum(ApiKeyExpiresIn) should work
| const { data: apiKeys } = useSuspenseQuery(backendQueryOptions(backend, 'listApiKeys', [])) | ||
| const apiKeyNames = new Set(apiKeys.map((apiKey) => apiKey.name)) | ||
| const createApiKey = useMutationCallback(backendMutationOptions(backend, 'createApiKey')) | ||
| const options = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would export this alongside ApiKeyExpiresIn, in the same module as the enum itself. worth trying export const NAME_HERE = Object.values(ApiKeyExpiresIn) for example
Pull Request Description
Important Notes
None
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
The documentation has been updated, if necessary.Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
Unit tests have been written where possible.If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,or the Snowflake database integration, a run of the Extra Tests has been scheduled.
If applicable, it is suggested to paste a link to a successful run of the Extra Tests.