Move database validation to gRPC methods#28619
Merged
gabrielcorado merged 2 commits intomasterfrom Jul 4, 2023
Merged
Conversation
espadolini
approved these changes
Jul 4, 2023
Contributor
espadolini
left a comment
There was a problem hiding this comment.
Why should the rpc layer be responsible for this, other than tradition? Is it to have the validation done before authz?
LGTM for consistency but would also LGTM if the check was moved to (*Server)CreateDatabase and (*Server)UpdateDatabase, not sure which one is the "more correct" one.
smallinsky
approved these changes
Jul 4, 2023
smallinsky
reviewed
Jul 4, 2023
Contributor
smallinsky
left a comment
There was a problem hiding this comment.
@gabrielcorado
Seems that one of UT needs to be aligned.
greedy52
approved these changes
Jul 4, 2023
|
@gabrielcorado See the table below for backport results.
|
gabrielcorado
added a commit
that referenced
this pull request
Jul 4, 2023
* refactor: move database validation to grpc * test(local): update CRUD databases test
gabrielcorado
added a commit
that referenced
this pull request
Jul 4, 2023
* refactor: move database validation to grpc * test(local): update CRUD databases test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #27904 by not calling the
services.ValidateDatabaseon cache initialization and not preventing cache initialization when database validation fails. TheCheckAndSetDefaultsis still being called on the database service.The
services.ValidateDatabasecall is now into gRPC methodsCreateDatabaseandUpdateDatabase. Following other resources that perform their validations on gRPC methods (such as Access requests and Users).Regarding invalid databases being stored on the database agent cache, this behavior will be similar to before #18776. This PR is not intended to change it, and it will be done in future PRs.