Skip to content

Commit

Permalink
create acl folder
Browse files Browse the repository at this point in the history
move token code to acl/token.py
  • Loading branch information
cpaillet committed May 14, 2024
1 parent 4094461 commit 2d10c70
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
7 changes: 7 additions & 0 deletions consul/api/acl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from consul.api.acl.token import Token


class ACL:
def __init__(self, agent):
self.agent = agent
self.token = Token(agent)
6 changes: 0 additions & 6 deletions consul/api/acl.py → consul/api/acl/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
from consul.callback import CB


class ACL:
def __init__(self, agent):
self.agent = agent
self.token = Token(agent)


class Token:
def __init__(self, agent):
self.agent = agent
Expand Down
16 changes: 8 additions & 8 deletions tests/api/test_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class TestConsulAcl:
def test_acl_permission_denied(self, acl_consul):
def test_acl_token_permission_denied(self, acl_consul):
port, _master_token, _consul_version = acl_consul
c = consul.Consul(port=port)

Expand Down Expand Up @@ -49,7 +49,7 @@ def test_acl_permission_denied(self, acl_consul):
token="anonymous",
)

def test_acl_list(self, acl_consul):
def test_acl_token_list(self, acl_consul):
port, master_token, _consul_version = acl_consul
c = consul.Consul(port=port)

Expand All @@ -68,7 +68,7 @@ def test_acl_list(self, acl_consul):
assert find_recursive(acls, master_token_repr)
assert find_recursive(acls, anonymous_token_repr)

def test_acl_read(self, acl_consul):
def test_acl_token_read(self, acl_consul):
port, master_token, _consul_version = acl_consul
c = consul.Consul(port=port)

Expand All @@ -82,7 +82,7 @@ def test_acl_read(self, acl_consul):
acl = c.acl.token.read(accessor_id="00000000-0000-0000-0000-000000000002", token=master_token)
assert find_recursive(acl, anonymous_token_repr)

def test_acl_create(self, acl_consul):
def test_acl_token_create(self, acl_consul):
port, master_token, _consul_version = acl_consul
c = consul.Consul(port=port)

Expand Down Expand Up @@ -116,7 +116,7 @@ def test_acl_create(self, acl_consul):
acl = c.acl.token.list(token=master_token)
assert find_recursive(acl, expected)

def test_acl_clone(self, acl_consul):
def test_acl_token_clone(self, acl_consul):
port, master_token, _consul_version = acl_consul
c = consul.Consul(port=port)

Expand All @@ -140,7 +140,7 @@ def test_acl_clone(self, acl_consul):
acl = c.acl.token.list(token=master_token)
assert find_recursive(acl, expected)

def test_acl_update(self, acl_consul):
def test_acl_token_update(self, acl_consul):
port, master_token, _consul_version = acl_consul
c = consul.Consul(port=port)

Expand All @@ -164,7 +164,7 @@ def test_acl_update(self, acl_consul):
acl = c.acl.token.read(accessor_id="00000000-DEAD-BEEF-0000-000000000000", token=master_token)
assert find_recursive(acl, expected)

def test_acl_delete(self, acl_consul):
def test_acl_token_delete(self, acl_consul):
port, master_token, _consul_version = acl_consul
c = consul.Consul(port=port)

Expand All @@ -184,7 +184,7 @@ def test_acl_delete(self, acl_consul):
)

#
# def test_acl_implicit_token_use(self, acl_consul):
# def test_acl_token_implicit_token_use(self, acl_consul):
# # configure client to use the master token by default
# port, _token, _consul_version = acl_consul
# c = consul.Consul(port=port)
Expand Down

0 comments on commit 2d10c70

Please sign in to comment.