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

NAS-132865 / 25.04 / Clean up old validation for keychaincredential, make API definitions more precise #15392

Merged
merged 7 commits into from
Jan 16, 2025

Conversation

creatorcary
Copy link
Contributor

@creatorcary creatorcary commented Jan 14, 2025

This will improve readability of our docs and move away from our old schema definitions/validation.

http://jenkins.eng.ixsystems.net:8080/job/tests/job/api_tests/2608/

@creatorcary creatorcary requested review from yocalebo and a team January 14, 2025 21:41
@bugclerk bugclerk changed the title Clean up old validation for keychaincredential, make API definitions more precise NAS-132865 / 25.04 / Clean up old validation for keychaincredential, make API definitions more precise Jan 14, 2025
@bugclerk
Copy link
Contributor

Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

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

Fantastic!

type: str
attributes: Secret[dict]
"""Distinguishes this Keychain Credential from others."""
type: Literal["SSH_KEY_PAIR", "SSH_CREDENTIALS"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move type inside attributes and use the more native discriminator approach? Basically, the same thing that's already done for cloud credentials.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would change the schema of most of our keychaincredential endpoints which are used in too many places to make this change worth it given that using a discriminated union would only slightly make our validation more performant. If we make this change in the future it should be its own PR.

@creatorcary creatorcary merged commit 237a19c into master Jan 16, 2025
2 checks passed
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Jan 16, 2025
@creatorcary creatorcary deleted the NAS-132865 branch January 16, 2025 15:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants