e0fddee386
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. |
||
---|---|---|
.. | ||
config | ||
acl.go | ||
acl_test.go | ||
alloc.go | ||
alloc_test.go | ||
autopilot.go | ||
batch_future.go | ||
batch_future_test.go | ||
bitmap.go | ||
bitmap_test.go | ||
check_test.go | ||
checks.go | ||
connect.go | ||
connect_test.go | ||
consul.go | ||
consul_oss.go | ||
consul_oss_test.go | ||
consul_test.go | ||
csi.go | ||
csi_test.go | ||
devices.go | ||
devices_test.go | ||
diff.go | ||
diff_test.go | ||
encoding.go | ||
errors.go | ||
errors_test.go | ||
eval.go | ||
event.go | ||
extensions.go | ||
funcs.go | ||
funcs_test.go | ||
generate.sh | ||
handlers.go | ||
job.go | ||
job_test.go | ||
keyring.go | ||
network.go | ||
network_test.go | ||
node.go | ||
node_class.go | ||
node_class_test.go | ||
node_test.go | ||
operator.go | ||
search.go | ||
service_identities.go | ||
service_registration.go | ||
service_registration_test.go | ||
services.go | ||
services_test.go | ||
streaming_rpc.go | ||
structs.go | ||
structs_codegen.go | ||
structs_oss.go | ||
structs_periodic_test.go | ||
structs_test.go | ||
testing.go | ||
uuid.go | ||
variables.go | ||
variables_test.go | ||
vault.go | ||
volume_test.go | ||
volumes.go |