Update kvs assignment backend docs
The "key to data" mapping was not documented for the KVS assignment backend. Change-Id: Id3cf3e0d9b52ceae5099e6d3833cc88f7aa0f347
This commit is contained in:
parent
8557e4756e
commit
f26dbfccba
@ -23,8 +23,37 @@ from keystone import exception
|
||||
|
||||
@dependency.requires('identity_api')
|
||||
class Assignment(kvs.Base, assignment.Driver):
|
||||
def __init__(self):
|
||||
super(Assignment, self).__init__()
|
||||
"""KVS Assignment backend.
|
||||
|
||||
This backend uses the following mappings to store data:
|
||||
|
||||
* Domains:
|
||||
|
||||
* domain_list -> [domain_id, ...]
|
||||
* domain-{id} -> domain_ref
|
||||
* domain_name-{name} -> domain_ref
|
||||
|
||||
* Projects:
|
||||
|
||||
* tenant-{id} -> project_ref
|
||||
* tenant_name-{name} -> project_ref
|
||||
|
||||
* Roles:
|
||||
|
||||
* role_list -> [role_id, ...]
|
||||
* role-{id} -> role_ref
|
||||
|
||||
* Role assignments:
|
||||
|
||||
* metadata-{target}-{actor} -> {'roles': [{'id': role-id, ...}, ...]}
|
||||
|
||||
Also uses:
|
||||
|
||||
* Users:
|
||||
|
||||
* user-{id} -> user_ref
|
||||
|
||||
"""
|
||||
|
||||
# Public interface
|
||||
|
||||
@ -155,14 +184,8 @@ class Assignment(kvs.Base, assignment.Driver):
|
||||
def list_role_assignments(self):
|
||||
"""List the role assignments.
|
||||
|
||||
The kvs backend stores role assignments as key-values:
|
||||
|
||||
"metadata-{target}-{actor}", with the value being a role list
|
||||
|
||||
i.e. "metadata-MyProjectID-MyUserID" [{'id': role1}, {'id': role2}]
|
||||
|
||||
...so we enumerate the list and extract the targets, actors
|
||||
and roles.
|
||||
We enumerate the metadata entries and extract the targets, actors, and
|
||||
roles.
|
||||
|
||||
"""
|
||||
assignment_list = []
|
||||
|
Loading…
Reference in New Issue
Block a user