hashicorp / hashicorp/consul

Proposal: move (more) of the ACL system to the acl package and subpackages

Open
#11,337 0 comments 0 reactions 0 assignees View on GitHub
theme/acls theme/internal-cleanup
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
2d 6h
Merged PRs (30d)
43

Description

The [ACL](https://www.consul.io/docs/security/acl/acl-system) sub-system is responsible for authenticating and authorizing request handled by Consul HTTP, RPC, xDS, and gRPC interfaces. Currently some of the ACL system is implemented in the `acl` package, however large parts of it are in:
* `agent/consul/acl.go`
* `agent/consul/acl_client.go`
* `agent/consul/acl_server.go`
* `agent/consul/acl_endpoint.go`
* `agent/consul/leader.go`
* `agent/structs/acl.go`
* `agent/structs/acl_cache.go`
* `agent/consul/state/acl.go`

This issue proposes we move more of the logic into packages under `acl` to make it easier to test, and easier to develop.

The proposed structure is:
* `acl` - remains the package for the rules and policies system
* `acl/aclauthz` - the `ACLResolver` and `ACLCaches`, currently in `agent/consul/acl.go` and `agent/structs/acl_cache.go`. Started in #11233 and #11221.
* `acl/aclrpc` - the RPC endpoints, currently in `agent/consul/acl_endpoint.go`
* TBD - a package for the initialization and goroutine management that is currently in the `leader.go`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.