open-nomad/.semgrep
Tim Gross e0fddee386
Pre forwarding authentication (#15417)
Upcoming work to instrument the rate of RPC requests by consumer (and eventually
rate limit) require that we authenticate a RPC request before forwarding. Add a
new top-level `Authenticate` method to the server and have it return an
`AuthenticatedIdentity` struct. RPC handlers will use the relevant fields of
this identity for performing authorization.

This changeset includes:
* The main implementation of `Authenticate`
* Provide a new RPC `ACL.WhoAmI` for debugging authentication. This endpoint
  returns the same `AuthenticatedIdentity` that will be used by RPC handlers. At
  some point we might want to give this an equivalent HTTP endpoint but I didn't
  want to add that to our public API until some of the other Workload Identity
  work is solidified, especially if we don't need it yet.
* A full coverage test of the `Authenticate` method. This sets up two server
  nodes with mTLS and ACLs, some tokens, and some allocations with workload
  identities.
* Wire up an example of using `Authenticate` in the `Namespace.Upsert` RPC and
  see how authorization happens after forwarding.
* A new semgrep rule for `Authenticate`, which we'll need to update once we're
  ready to wire up more RPC endpoints with authorization steps.
2022-12-06 14:44:03 -05:00
..
api_errorf.yml api: use errors.New not fmt.Errorf when error doesn't have format. (#14027) 2022-08-05 17:05:47 +02:00
changelog.yml ci: add semgrep (#11934) 2022-01-26 16:32:47 -05:00
fsm_time.yml semgrep: add MeasureSinceWithLabels to FSM time rule (#14812) 2022-10-06 10:59:53 -04:00
go_tests.yml ci: do not exclude Parallel semgrep rule 2022-03-17 13:45:56 -05:00
http_endpoint.yml api: ensure ACL role upsert decode error returns a 400 status code. (#15253) 2022-11-18 17:47:43 +01:00
loopclosure.yml Data race fixes in tests and a new semgrep rule (#14594) 2022-09-15 10:35:08 -07:00
rpc_endpoint.yml Pre forwarding authentication (#15417) 2022-12-06 14:44:03 -05:00
time_after.yml add semgrep rule to check for potential time.After leaks (#12001) 2022-02-03 17:33:07 -05:00
ui.yml ci: add semgrep rule to catch usage of invalid string extensions (#12509) 2022-04-08 10:58:32 -04:00