open-nomad/nomad/structs
Tim Gross 32f6ce1c54
Authenticate method improvements (#15734)
This changeset covers a sidebar discussion that @schmichael and I had around the
design for pre-forwarding auth. This includes some changes extracted out of
#15513 to make it easier to review both and leave a clean history.

* Remove fast path for NodeID. Previously-connected clients will have a NodeID
  set on the context, and because this is a large portion of the RPCs sent we
  fast-pathed it at the top of the `Authenticate` method. But the context is
  shared for all yamux streams over the same yamux session (and TCP
  connection). This lets an authenticated HTTP request to a client use the
  NodeID for authentication, which is a privilege escalation. Remove the fast
  path and annotate it so that we don't break it again.

* Add context to decisions around AuthenticatedIdentity. The `Authenticate`
  method taken on its own looks like it wants to return an `acl.ACL` that folds
  over all the various identity types (creating an ephemeral ACL on the fly if
  neccessary). But keeping these fields idependent allows RPC handlers to
  differentiate between internal and external origins so we most likely want to
  avoid this. Leave some docstrings as a warning as to why this is built the way
  it is.

* Mutate the request rather than returning. When reviewing #15513 we decided
  that forcing the request handler to call `SetIdentity` was repetitive and
  error prone. Instead, the `Authenticate` method mutates the request by setting
  its `AuthenticatedIdentity`.
2023-01-10 09:46:38 -05:00
..
config artifact: enable inheriting environment variables from client (#15514) 2022-12-09 15:46:07 -06:00
acl.go acl: modify update endpoints behavior (#15580) 2022-12-20 11:22:19 +01:00
acl_test.go acl: modify update endpoints behavior (#15580) 2022-12-20 11:22:19 +01:00
alloc.go Add Namespace, Job and Group to envoy stats (#14311) 2022-09-22 10:38:21 -04:00
alloc_test.go client: fixed a problem calculating a service namespace. (#13493) 2022-06-28 09:47:28 +02:00
autopilot.go migrate autopilot implementation to raft-autopilot (#14441) 2022-09-01 14:27:10 -04:00
batch_future.go
batch_future_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
bitmap.go
bitmap_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
check_test.go cleanup: use constants for on_update values 2022-07-21 13:09:47 -05:00
checks.go cleanup: use constants for on_update values 2022-07-21 13:09:47 -05:00
connect.go e2e: consul namespace tests from nomad ent 2021-04-19 15:35:31 -06:00
connect_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
consul.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
consul_oss.go gofmt all the files 2021-10-01 10:14:28 -04:00
consul_oss_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
consul_test.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
csi.go cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
csi_test.go CSI: enforce single access mode at validation time (#12337) 2022-03-23 09:21:26 -04:00
devices.go scheduler: stopped-yet-running allocs are still running (#10446) 2022-09-13 12:52:47 -07:00
devices_test.go scheduler: stopped-yet-running allocs are still running (#10446) 2022-09-13 12:52:47 -07:00
diff.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
diff_test.go template: error on missing key (#15141) 2022-11-04 13:23:01 -04:00
encoding.go json handles were moved to a new package in #10202 2021-04-02 13:31:10 +00:00
errors.go Pre forwarding authentication (#15417) 2022-12-06 14:44:03 -05:00
errors_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
eval.go eval delete: move batching of deletes into RPC handler and state (#15117) 2022-11-14 14:08:13 -05:00
event.go events: add ACL binding rules to core events stream topics. (#15544) 2022-12-14 14:49:49 +01:00
extensions.go keyring: wrap root key in key encryption key (#14388) 2022-08-30 10:59:25 -04:00
funcs.go cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
funcs_test.go scheduler: stopped-yet-running allocs are still running (#10446) 2022-09-13 12:52:47 -07:00
generate.sh workload identity (#13223) 2022-07-11 13:34:05 -04:00
handlers.go json handles were moved to a new package in #10202 2021-04-02 13:31:10 +00:00
job.go servicedisco: implicit constraint for nomad v1.4 when using nsd checks (#14868) 2022-10-11 08:21:42 -05:00
job_test.go servicedisco: implicit constraint for nomad v1.4 when using nsd checks (#14868) 2022-10-11 08:21:42 -05:00
keyring.go keyring: safely handle missing keys and restore GC (#15092) 2022-11-01 15:00:50 -04:00
network.go cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
network_test.go scheduler: stopped-yet-running allocs are still running (#10446) 2022-09-13 12:52:47 -07:00
node.go cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
node_class.go use allow/deny instead of the colored alternatives (#9019) 2020-10-12 08:47:05 -04:00
node_class_test.go build: run gofmt on all go source files 2022-08-16 11:14:11 -05:00
node_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
operator.go client: fix data races in config handling (#14139) 2022-08-18 16:32:04 -07:00
search.go rename SecureVariables to Variables throughout 2022-08-26 16:06:24 -04:00
service_identities.go consul: plubming for specifying consul namespace in job/group 2021-04-05 10:03:19 -06:00
service_registration.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
service_registration_test.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
services.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
services_test.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
streaming_rpc.go Fix some errcheck errors (#9811) 2021-01-14 12:46:35 -08:00
structs.go Authenticate method improvements (#15734) 2023-01-10 09:46:38 -05:00
structs_codegen.go
structs_oss.go gofmt all the files 2021-10-01 10:14:28 -04:00
structs_periodic_test.go build: run gofmt on all go source files 2022-08-16 11:14:11 -05:00
structs_test.go acl: sso auth method RPC endpoints (#15221) 2022-11-21 10:15:39 +01:00
testing.go chore: fix incorrect docstring formatting. 2021-08-30 11:08:12 +02:00
uuid.go core: allow deleting of evaluations (#13492) 2022-07-06 16:30:11 +02:00
variables.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
variables_test.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
vault.go vault: revert support for entity aliases (#12723) 2022-04-22 10:46:34 -04:00
volume_test.go CSI: enforce single access mode at validation time (#12337) 2022-03-23 09:21:26 -04:00
volumes.go CSI: enforce single access mode at validation time (#12337) 2022-03-23 09:21:26 -04:00