-
Notifications
You must be signed in to change notification settings - Fork 2k
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
WI: allow workloads to use RPCs associated with HTTP API #15870
Conversation
Also wires up pre-forwarding authentication for RPCs that don't support the API, so that we can reuse the shared `ResolveACLorClient` method here.
e402842
to
18f5cec
Compare
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.
LGTM! Thanks for jumping on this. I'll give it a +1 once you move it out of draft.
In addition to running the unit tests I've tested this out by spinning up a 3 server cluster along with a client, and verified that the job deployment workflow is running, that client APIs (ex. |
@@ -890,7 +898,7 @@ func (n *Node) GetNode(args *structs.NodeSpecificRequest, | |||
if err != nil { | |||
return err | |||
} | |||
if !aclObj.AllowNodeRead() { | |||
if aclObj != nil && !aclObj.AllowNodeRead() { |
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.
Huh, how did this sneak by? I would think it would panic on nomad node status ...
for everyone with ACLs disabled?
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.
Yeah that burned me here... the old ResolveToken
code returns nil, nil
in that case, so we just skip over the AllowNodeRead
check. Fortunately we have good unit test coverage of non-ACLs vs with-ACLs and that caught it.
This changeset configures the RPC rate metrics that were added in #15515 to all the RPCs that support authenticated HTTP API requests. These endpoints already configured with pre-forwarding authentication in #15870, and a handful of others were done already as part of the proof-of-concept work. So this changeset is entirely copy-and-pasting one method call into a whole mess of handlers. Upcoming PRs will wire up pre-forwarding auth and rate metrics for the remaining set of RPCs that have no API consumers or aren't authenticated, in smaller chunks that can be more thoughtfully reviewed.
This changeset configures the RPC rate metrics that were added in #15515 to all the RPCs that support authenticated HTTP API requests. These endpoints already configured with pre-forwarding authentication in #15870, and a handful of others were done already as part of the proof-of-concept work. So this changeset is entirely copy-and-pasting one method call into a whole mess of handlers. Upcoming PRs will wire up pre-forwarding auth and rate metrics for the remaining set of RPCs that have no API consumers or aren't authenticated, in smaller chunks that can be more thoughtfully reviewed.
This changeset allows Workload Identities to authenticate to all the RPCs that
support HTTP API endpoints, for use with PR #15864.
support a HTTP API endpoint.
endpoints that are currently used to support both tokens and client secrets.
Intentionally excluded from this changeset:
policies. Ideally we'll figure out an efficient way to resolve those into real
policies and then we can get rid of that custom handling.
support HTTP endpoints) have not been updated with the new pre-forwarding auth
We'll be doing this under a separate PR to support RPC rate metrics.