X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FAccessors%2FAccessors_sliverauth.py;h=5fcfbf31811da2cb603052a82f6490adfc0fcd88;hb=b9b8ba17171d7d5abe9eb6d8008a1e7e94153ba5;hp=921645b02c2aae2f0bc212d74817024f4854e41f;hpb=6b1baab4130de9f65ec81c4b6d7182c76b69433d;p=plcapi.git diff --git a/PLC/Accessors/Accessors_sliverauth.py b/PLC/Accessors/Accessors_sliverauth.py index 921645b..5fcfbf3 100644 --- a/PLC/Accessors/Accessors_sliverauth.py +++ b/PLC/Accessors/Accessors_sliverauth.py @@ -1,7 +1,9 @@ +# +# Thierry Parmentelat - INRIA +# from PLC.Nodes import Node from PLC.Interfaces import Interface from PLC.Slices import Slice -from PLC.Slices import Slice from PLC.Sites import Site from PLC.Persons import Person @@ -10,11 +12,27 @@ from PLC.Accessors.Factory import define_accessors, admin_roles, all_roles, tech import sys current_module = sys.modules[__name__] +# this is how to request the features define_accessors(current_module, Slice, "OmfControl","omf_control", "slice/usertools","Pre-install and configure OMF Resource Controller in slice if set", - get_roles=all_roles, set_roles=all_roles, expose_in_api=True) + set_roles=all_roles, expose_in_api=True) define_accessors(current_module, Slice, "SliverHMAC","enable_hmac", "slice/usertools","Create HMAC keys for node in slice (slivers)", - get_roles=all_roles, set_roles=all_roles, expose_in_api=True) + set_roles=all_roles, expose_in_api=True) + +# this is where the crypto stuff gets stored +# this ends up in a sliver tag - the node creates that +# the accessors engine does not know how to create sliver accessors +# like e.g. GetSliverHmac(node,slice) +# but they are mentioned here as they are related to the above + +# Security capability to empower a slice to make an authenticated API call, set by silverauth NM plugin. +define_accessors(current_module, Slice, "Hmac","hmac", + "slice/auth", "Sliver authorization key, for authenticated API call", + set_roles=['admin','node']) +# sliver-dependant ssh key, used to authenticate the experimental plane with OMF tools +define_accessors(current_module, Slice, "SshKey", "ssh_key", + 'slice/auth', "Sliver public ssh key", + set_roles= ['admin','node'])