Skip to content

Commit fd58876

Browse files
committed
Add the ACL model
1 parent 585420c commit fd58876

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

consulate/models/acl.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# coding=utf-8
2+
"""Models for the ACL endpoints"""
3+
import uuid
4+
5+
from consulate.models import base
6+
7+
8+
class ACL(base.Model):
9+
"""Defines the model used for an individual ACL token."""
10+
__slots__ = ['id', 'name', 'type', 'rules']
11+
12+
__attributes__ = {
13+
'id': {
14+
'key': 'ID',
15+
'type': uuid.UUID,
16+
'cast_from': str,
17+
'cast_to': str
18+
},
19+
'name': {
20+
'key': 'Name',
21+
'type': str
22+
},
23+
'type': {
24+
'key': 'Type',
25+
'type': str,
26+
'enum': {'client', 'management'},
27+
'required': True
28+
},
29+
'rules': {
30+
'key': 'Rules',
31+
'type': str
32+
}
33+
}

0 commit comments

Comments
 (0)