open-nomad/nomad/state
Mahmood Ali 02e20c720b acl_endpoint: permission denied for unauthenticated requests
If ACL Request is unauthenticated, we should honor the anonymous token.
This PR makes few changes:

* `GetPolicy` endpoints may return policy if anonymous policy allows it,
or return permission denied otherwise.
* `ListPolicies` returns an empty policy list, or one with anonymous
policy if one exists.

Without this PR, the we return an incomprehensible error.

Before:
```
$ curl http://localhost:4646/v1/acl/policy/doesntexist; echo
acl token lookup failed: index error: UUID must be 36 characters
$ curl http://localhost:4646/v1/acl/policies; echo
acl token lookup failed: index error: UUID must be 36 characters
```

After:
```
$ curl http://localhost:4646/v1/acl/policy/doesntexist; echo
Permission denied
$ curl http://localhost:4646/v1/acl/policies; echo
[]
```
2019-11-22 08:43:09 -05:00
..
autopilot.go goimports 2019-01-22 15:44:31 -08:00
autopilot_test.go Refactor redundancy_zone/upgrade_version out of client meta 2018-01-29 20:03:38 -08:00
schema.go goimports 2019-01-22 15:44:31 -08:00
schema_test.go goimports 2019-01-22 15:44:31 -08:00
state_store.go acl_endpoint: permission denied for unauthenticated requests 2019-11-22 08:43:09 -05:00
state_store_oss.go sync 2017-10-13 14:36:02 -07:00
state_store_test.go Merge pull request #5791 from hashicorp/b-plan-snapshotindex 2019-07-17 09:25:00 -07:00
testing.go goimports 2019-01-22 15:44:31 -08:00
testing_oss.go goimports 2019-01-22 15:44:31 -08:00