Merge branch 'master' of ssh://git.onelab.eu/git/plcapi
[plcapi.git] / PLC / Accessors / Accessors_sliverauth.py
1 #
2 # Thierry Parmentelat - INRIA
3 #
4 from PLC.Nodes import Node
5 from PLC.Interfaces import Interface
6 from PLC.Slices import Slice
7 from PLC.Slices import Slice
8 from PLC.Sites import Site
9 from PLC.Persons import Person
10
11 from PLC.Accessors.Factory import define_accessors, admin_roles, all_roles, tech_roles
12
13 import sys
14 current_module = sys.modules[__name__]
15
16 # this is how to request the features
17 define_accessors(current_module, Slice, "OmfControl","omf_control",
18                  "slice/usertools","Pre-install and configure OMF Resource Controller in slice if set",
19                  set_roles=all_roles, expose_in_api=True)
20
21
22 define_accessors(current_module, Slice, "SliverHMAC","enable_hmac",
23                  "slice/usertools","Create HMAC keys for node in slice (slivers)",
24                  set_roles=all_roles, expose_in_api=True)
25
26 # this is where the crypto stuff gets stored 
27 # this ends up in a sliver tag - the node creates that
28 # the accessors engine does not know how to create sliver accessors
29 # like e.g. GetSliverHmac(node,slice)
30 # but they are mentioned here as they are related to the above
31
32 # Security capability to empower a slice to make an authenticated API call, set by silverauth NM plugin.
33 define_accessors(current_module, Slice, "Hmac","hmac",
34                  "slice/auth", "Sliver authorization key, for authenticated API call",
35                  set_roles=['admin','node'])
36 # sliver-dependant ssh key, used to authenticate the experimental plane with OMF tools
37 define_accessors(current_module, Slice, "SshKey", "ssh_key",
38                  'slice/auth', "Sliver public ssh key",
39                  set_roles= ['admin','node'])