-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpc: simplify and enhance the client cert validation
TLDR: this commit enhances various aspects of TLS client cert validation. Between other things, it makes the error clearer in case of authentication failure. Example, before: ``` ERROR: requested user demo is not authorized for tenant {2} ``` Example, after: ``` ERROR: certificate authentication failed for user "demo" DETAIL: The client certificate is valid for "root" on all tenants. ``` ---- Changes to client cert authentication: The error message was improved. Changes to tenant authentication in the RPC subsystem: Prior to this change, there was a function `getActiveNodeOrUserScope` whose purpose as not obvious at first sight -- it was merely checking that the client cert contained the `root` or `node` identity. This commit reduces the complexity of this function to make it more maintainable. Additionally, upon an authn error the text of the error was a bit complex to read, and did not include details about the client cert. This commit enhances the error and makes it show the user scopes included in the client cert. Finally, the function contained an exception to prevent the `node` principal from running RPCs on a non-system tenant. This was too restrictive; it prevents us (in a later commit) from reusing the node cert for tenant-tenant connections when using shared-process multitenancy. So this commit removes that exception. Release note: None
- Loading branch information
Showing
5 changed files
with
86 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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