From 1f8c38dd1357c93e4be8d94456b7274a591d2db4 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Fri, 27 Oct 2006 15:38:09 +0000 Subject: [PATCH] (most) all functions now take SessionAuth in addition to PasswordAuth --- PLC/Methods/AddAddressType.py | 4 ++-- PLC/Methods/AddAddressTypeToAddress.py | 4 ++-- PLC/Methods/AddBootState.py | 4 ++-- PLC/Methods/AddConfFile.py | 4 ++-- PLC/Methods/AddConfFileToNode.py | 4 ++-- PLC/Methods/AddConfFileToNodeGroup.py | 4 ++-- PLC/Methods/AddKeyType.py | 4 ++-- PLC/Methods/AddNetworkMethod.py | 4 ++-- PLC/Methods/AddNetworkType.py | 4 ++-- PLC/Methods/AddNode.py | 4 ++-- PLC/Methods/AddNodeGroup.py | 4 ++-- PLC/Methods/AddNodeNetwork.py | 4 ++-- PLC/Methods/AddNodeToNodeGroup.py | 4 ++-- PLC/Methods/AddNodeToPCU.py | 4 ++-- PLC/Methods/AddPCU.py | 4 ++-- PLC/Methods/AddPerson.py | 4 ++-- PLC/Methods/AddPersonKey.py | 4 ++-- PLC/Methods/AddPersonToSite.py | 4 ++-- PLC/Methods/AddPersonToSlice.py | 4 ++-- PLC/Methods/AddRole.py | 4 ++-- PLC/Methods/AddRoleToPerson.py | 4 ++-- PLC/Methods/AddSite.py | 4 ++-- PLC/Methods/AddSiteAddress.py | 4 ++-- PLC/Methods/AddSlice.py | 4 ++-- PLC/Methods/AddSliceAttribute.py | 4 ++-- PLC/Methods/AddSliceAttributeType.py | 4 ++-- PLC/Methods/AddSliceToNodes.py | 4 ++-- PLC/Methods/AdmAddAddressType.py | 4 ++-- PLC/Methods/AdmAddNode.py | 4 ++-- PLC/Methods/AdmAddNodeGroup.py | 4 ++-- PLC/Methods/AdmAddNodeNetwork.py | 4 ++-- PLC/Methods/AdmAddPerson.py | 4 ++-- PLC/Methods/AdmAddPersonKey.py | 4 ++-- PLC/Methods/AdmAddSite.py | 4 ++-- PLC/Methods/AdmAssociateNodeToPowerControlUnitPort.py | 4 ++-- PLC/Methods/AdmDeleteAllPersonKeys.py | 4 ++-- PLC/Methods/AdmDeleteNodeNetwork.py | 4 ++-- PLC/Methods/AdmDeletePersonKeys.py | 4 ++-- PLC/Methods/AdmDisassociatePowerControlUnitPort.py | 4 ++-- PLC/Methods/AdmGenerateNodeConfFile.py | 4 ++-- PLC/Methods/AdmGetAllNodeNetworks.py | 4 ++-- PLC/Methods/AdmGetAllRoles.py | 2 +- PLC/Methods/AdmGetNodeGroupNodes.py | 4 ++-- PLC/Methods/AdmGetPersonKeys.py | 4 ++-- PLC/Methods/AdmGetPersonRoles.py | 4 ++-- PLC/Methods/AdmGetPersonSites.py | 4 ++-- PLC/Methods/AdmGetPowerControlUnitNodes.py | 4 ++-- PLC/Methods/AdmGetSiteNodes.py | 4 ++-- PLC/Methods/AdmGetSitePIs.py | 4 ++-- PLC/Methods/AdmGetSitePersons.py | 4 ++-- PLC/Methods/AdmGetSitePowerControlUnits.py | 4 ++-- PLC/Methods/AdmGetSiteTechContacts.py | 4 ++-- PLC/Methods/AdmIsPersonInRole.py | 4 ++-- PLC/Methods/AdmQueryConfFile.py | 4 ++-- PLC/Methods/AdmQueryNode.py | 4 ++-- PLC/Methods/AdmQueryPerson.py | 4 ++-- PLC/Methods/AdmQueryPowerControlUnit.py | 4 ++-- PLC/Methods/AdmQuerySite.py | 4 ++-- PLC/Methods/AdmSetPersonEnabled.py | 4 ++-- PLC/Methods/AdmUpdateNodeGroup.py | 4 ++-- PLC/Methods/BlacklistKey.py | 4 ++-- PLC/Methods/BootUpdateNode.py | 2 +- PLC/Methods/DeleteAddress.py | 4 ++-- PLC/Methods/DeleteAddressType.py | 4 ++-- PLC/Methods/DeleteAddressTypeFromAddress.py | 4 ++-- PLC/Methods/DeleteBootState.py | 4 ++-- PLC/Methods/DeleteConfFile.py | 4 ++-- PLC/Methods/DeleteConfFileFromNode.py | 4 ++-- PLC/Methods/DeleteConfFileFromNodeGroup.py | 4 ++-- PLC/Methods/DeleteKey.py | 4 ++-- PLC/Methods/DeleteKeyType.py | 4 ++-- PLC/Methods/DeleteNetworkMethod.py | 4 ++-- PLC/Methods/DeleteNetworkType.py | 4 ++-- PLC/Methods/DeleteNode.py | 4 ++-- PLC/Methods/DeleteNodeFromNodeGroup.py | 4 ++-- PLC/Methods/DeleteNodeFromPCU.py | 4 ++-- PLC/Methods/DeleteNodeGroup.py | 4 ++-- PLC/Methods/DeleteNodeNetwork.py | 4 ++-- PLC/Methods/DeletePCU.py | 4 ++-- PLC/Methods/DeletePerson.py | 4 ++-- PLC/Methods/DeletePersonFromSite.py | 4 ++-- PLC/Methods/DeletePersonFromSlice.py | 4 ++-- PLC/Methods/DeleteRole.py | 4 ++-- PLC/Methods/DeleteRoleFromPerson.py | 4 ++-- PLC/Methods/DeleteSite.py | 4 ++-- PLC/Methods/DeleteSlice.py | 4 ++-- PLC/Methods/DeleteSliceAttribute.py | 4 ++-- PLC/Methods/DeleteSliceAttributeType.py | 4 ++-- PLC/Methods/DeleteSliceFromNodes.py | 4 ++-- PLC/Methods/GetAddressTypes.py | 4 ++-- PLC/Methods/GetAddresses.py | 4 ++-- PLC/Methods/GetBootStates.py | 4 ++-- PLC/Methods/GetConfFiles.py | 4 ++-- PLC/Methods/GetEvents.py | 4 ++-- PLC/Methods/GetKeyTypes.py | 4 ++-- PLC/Methods/GetKeys.py | 4 ++-- PLC/Methods/GetNetworkMethods.py | 4 ++-- PLC/Methods/GetNetworkTypes.py | 4 ++-- PLC/Methods/GetNodeGroups.py | 4 ++-- PLC/Methods/GetNodeNetworks.py | 4 ++-- PLC/Methods/GetNodes.py | 4 ++-- PLC/Methods/GetPCUs.py | 4 ++-- PLC/Methods/GetPersons.py | 4 ++-- PLC/Methods/GetRoles.py | 4 ++-- PLC/Methods/GetSites.py | 4 ++-- PLC/Methods/GetSliceAttributeTypes.py | 4 ++-- PLC/Methods/GetSliceAttributes.py | 4 ++-- PLC/Methods/GetSlices.py | 4 ++-- PLC/Methods/GetSlivers.py | 4 ++-- PLC/Methods/RebootNode.py | 4 ++-- PLC/Methods/SetPersonPrimarySite.py | 4 ++-- PLC/Methods/SliceCreate.py | 4 ++-- PLC/Methods/UpdateAddress.py | 4 ++-- PLC/Methods/UpdateAddressType.py | 4 ++-- PLC/Methods/UpdateConfFile.py | 4 ++-- PLC/Methods/UpdateKey.py | 4 ++-- PLC/Methods/UpdateNode.py | 4 ++-- PLC/Methods/UpdateNodeGroup.py | 4 ++-- PLC/Methods/UpdateNodeNetwork.py | 4 ++-- PLC/Methods/UpdatePCU.py | 4 ++-- PLC/Methods/UpdatePerson.py | 4 ++-- PLC/Methods/UpdateSite.py | 4 ++-- PLC/Methods/UpdateSlice.py | 4 ++-- PLC/Methods/UpdateSliceAttribute.py | 4 ++-- PLC/Methods/UpdateSliceAttributeType.py | 4 ++-- PLC/Methods/__init__.py | 2 +- 126 files changed, 249 insertions(+), 249 deletions(-) diff --git a/PLC/Methods/AddAddressType.py b/PLC/Methods/AddAddressType.py index 904a432b..ceb1807a 100644 --- a/PLC/Methods/AddAddressType.py +++ b/PLC/Methods/AddAddressType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.AddressTypes import AddressType, AddressTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field not in ['address_type_id'] @@ -19,7 +19,7 @@ class AddAddressType(Method): address_type_fields = dict(filter(can_update, AddressType.fields.items())) accepts = [ - PasswordAuth(), + Auth(), address_type_fields ] diff --git a/PLC/Methods/AddAddressTypeToAddress.py b/PLC/Methods/AddAddressTypeToAddress.py index 1a20e0ed..b3045b51 100644 --- a/PLC/Methods/AddAddressTypeToAddress.py +++ b/PLC/Methods/AddAddressTypeToAddress.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.AddressTypes import AddressType, AddressTypes from PLC.Addresses import Address, Addresses -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddAddressTypeToAddress(Method): """ @@ -17,7 +17,7 @@ class AddAddressTypeToAddress(Method): roles = ['admin', 'pi'] accepts = [ - PasswordAuth(), + Auth(), Mixed(AddressType.fields['address_type_id'], AddressType.fields['name']), Address.fields['address_id'] diff --git a/PLC/Methods/AddBootState.py b/PLC/Methods/AddBootState.py index ba39b66c..c8c916c0 100644 --- a/PLC/Methods/AddBootState.py +++ b/PLC/Methods/AddBootState.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.BootStates import BootState, BootStates -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddBootState(Method): """ @@ -14,7 +14,7 @@ class AddBootState(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), BootState.fields['boot_state'] ] diff --git a/PLC/Methods/AddConfFile.py b/PLC/Methods/AddConfFile.py index 4109d1bb..39007eb9 100644 --- a/PLC/Methods/AddConfFile.py +++ b/PLC/Methods/AddConfFile.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.ConfFiles import ConfFile, ConfFiles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field not in \ ['conf_file_id', 'node_ids', 'nodegroup_ids'] @@ -20,7 +20,7 @@ class AddConfFile(Method): conf_file_fields = dict(filter(can_update, ConfFile.fields.items())) accepts = [ - PasswordAuth(), + Auth(), conf_file_fields ] diff --git a/PLC/Methods/AddConfFileToNode.py b/PLC/Methods/AddConfFileToNode.py index e5b16ba1..09de2333 100644 --- a/PLC/Methods/AddConfFileToNode.py +++ b/PLC/Methods/AddConfFileToNode.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.ConfFiles import ConfFile, ConfFiles from PLC.Nodes import Node, Nodes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddConfFileToNode(Method): """ @@ -16,7 +16,7 @@ class AddConfFileToNode(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), ConfFile.fields['conf_file_id'], Mixed(Node.fields['node_id'], Node.fields['hostname']) diff --git a/PLC/Methods/AddConfFileToNodeGroup.py b/PLC/Methods/AddConfFileToNodeGroup.py index af4d574d..32b9f073 100644 --- a/PLC/Methods/AddConfFileToNodeGroup.py +++ b/PLC/Methods/AddConfFileToNodeGroup.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.ConfFiles import ConfFile, ConfFiles from PLC.NodeGroups import NodeGroup, NodeGroups -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddConfFileToNodeGroup(Method): """ @@ -17,7 +17,7 @@ class AddConfFileToNodeGroup(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), ConfFile.fields['conf_file_id'], Mixed(NodeGroup.fields['nodegroup_id'], NodeGroup.fields['name']) diff --git a/PLC/Methods/AddKeyType.py b/PLC/Methods/AddKeyType.py index 914323c3..329654ff 100644 --- a/PLC/Methods/AddKeyType.py +++ b/PLC/Methods/AddKeyType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.KeyTypes import KeyType, KeyTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddKeyType(Method): """ @@ -14,7 +14,7 @@ class AddKeyType(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), KeyType.fields['key_type'] ] diff --git a/PLC/Methods/AddNetworkMethod.py b/PLC/Methods/AddNetworkMethod.py index d243ae39..e9bf31d2 100644 --- a/PLC/Methods/AddNetworkMethod.py +++ b/PLC/Methods/AddNetworkMethod.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NetworkMethods import NetworkMethod, NetworkMethods -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddNetworkMethod(Method): """ @@ -14,7 +14,7 @@ class AddNetworkMethod(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), NetworkMethod.fields['method'] ] diff --git a/PLC/Methods/AddNetworkType.py b/PLC/Methods/AddNetworkType.py index cd28d052..858bf573 100644 --- a/PLC/Methods/AddNetworkType.py +++ b/PLC/Methods/AddNetworkType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NetworkTypes import NetworkType, NetworkTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddNetworkType(Method): """ @@ -14,7 +14,7 @@ class AddNetworkType(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), NetworkType.fields['type'] ] diff --git a/PLC/Methods/AddNode.py b/PLC/Methods/AddNode.py index 1b243d05..b702b53a 100644 --- a/PLC/Methods/AddNode.py +++ b/PLC/Methods/AddNode.py @@ -4,7 +4,7 @@ from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.NodeGroups import NodeGroup, NodeGroups from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['hostname', 'boot_state', 'model', 'version'] @@ -25,7 +25,7 @@ class AddNode(Method): node_fields = dict(filter(can_update, Node.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(Site.fields['site_id'], Site.fields['login_base']), node_fields diff --git a/PLC/Methods/AddNodeGroup.py b/PLC/Methods/AddNodeGroup.py index f0dd56de..8ea74330 100644 --- a/PLC/Methods/AddNodeGroup.py +++ b/PLC/Methods/AddNodeGroup.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NodeGroups import NodeGroup, NodeGroups -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['name', 'description'] @@ -20,7 +20,7 @@ class AddNodeGroup(Method): nodegroup_fields = dict(filter(can_update, NodeGroup.fields.items())) accepts = [ - PasswordAuth(), + Auth(), nodegroup_fields ] diff --git a/PLC/Methods/AddNodeNetwork.py b/PLC/Methods/AddNodeNetwork.py index 1ffebfc9..a37ce400 100644 --- a/PLC/Methods/AddNodeNetwork.py +++ b/PLC/Methods/AddNodeNetwork.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field not in ['nodenetwork_id', 'node_id'] @@ -31,7 +31,7 @@ class AddNodeNetwork(Method): nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(Node.fields['node_id'], Node.fields['hostname']), nodenetwork_fields diff --git a/PLC/Methods/AddNodeToNodeGroup.py b/PLC/Methods/AddNodeToNodeGroup.py index c1e70d61..9036195a 100644 --- a/PLC/Methods/AddNodeToNodeGroup.py +++ b/PLC/Methods/AddNodeToNodeGroup.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NodeGroups import NodeGroup, NodeGroups from PLC.Nodes import Node, Nodes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddNodeToNodeGroup(Method): """ @@ -16,7 +16,7 @@ class AddNodeToNodeGroup(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(NodeGroup.fields['nodegroup_id'], NodeGroup.fields['name']), Mixed(Node.fields['node_id'], diff --git a/PLC/Methods/AddNodeToPCU.py b/PLC/Methods/AddNodeToPCU.py index 2d06f9f6..8debf2c1 100644 --- a/PLC/Methods/AddNodeToPCU.py +++ b/PLC/Methods/AddNodeToPCU.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddNodeToPCU(Method): """ @@ -18,7 +18,7 @@ class AddNodeToPCU(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Node.fields['node_id'], Node.fields['hostname']), PCU.fields['pcu_id'], diff --git a/PLC/Methods/AddPCU.py b/PLC/Methods/AddPCU.py index 83cb00db..fb779772 100644 --- a/PLC/Methods/AddPCU.py +++ b/PLC/Methods/AddPCU.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Sites import Site, Sites can_update = lambda (field, value): field in \ @@ -26,7 +26,7 @@ class AddPCU(Method): pcu_fields = dict(filter(can_update, PCU.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(Site.fields['site_id'], Site.fields['login_base']), pcu_fields diff --git a/PLC/Methods/AddPerson.py b/PLC/Methods/AddPerson.py index 63b3cf31..11d97334 100644 --- a/PLC/Methods/AddPerson.py +++ b/PLC/Methods/AddPerson.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['first_name', 'last_name', 'title', @@ -24,7 +24,7 @@ class AddPerson(Method): person_fields = dict(filter(can_update, Person.fields.items())) accepts = [ - PasswordAuth(), + Auth(), person_fields ] diff --git a/PLC/Methods/AddPersonKey.py b/PLC/Methods/AddPersonKey.py index 3749ecd0..74a65035 100644 --- a/PLC/Methods/AddPersonKey.py +++ b/PLC/Methods/AddPersonKey.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Keys import Key, Keys from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field not in ['key_id'] @@ -21,7 +21,7 @@ class AddPersonKey(Method): key_fields = dict(filter(can_update, Key.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), key_fields diff --git a/PLC/Methods/AddPersonToSite.py b/PLC/Methods/AddPersonToSite.py index e4719ab0..8d46624a 100644 --- a/PLC/Methods/AddPersonToSite.py +++ b/PLC/Methods/AddPersonToSite.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddPersonToSite(Method): """ @@ -17,7 +17,7 @@ class AddPersonToSite(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), Mixed(Site.fields['site_id'], diff --git a/PLC/Methods/AddPersonToSlice.py b/PLC/Methods/AddPersonToSlice.py index c60b5fd9..a74389e1 100644 --- a/PLC/Methods/AddPersonToSlice.py +++ b/PLC/Methods/AddPersonToSlice.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Slices import Slice, Slices -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddPersonToSlice(Method): """ @@ -16,7 +16,7 @@ class AddPersonToSlice(Method): roles = ['admin', 'pi'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), Mixed(Slice.fields['slice_id'], diff --git a/PLC/Methods/AddRole.py b/PLC/Methods/AddRole.py index 3da92aab..e556d0ef 100644 --- a/PLC/Methods/AddRole.py +++ b/PLC/Methods/AddRole.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Roles import Role, Roles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddRole(Method): """ @@ -14,7 +14,7 @@ class AddRole(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Role.fields['role_id'], Role.fields['name'] ] diff --git a/PLC/Methods/AddRoleToPerson.py b/PLC/Methods/AddRoleToPerson.py index 0d82dea9..dbc0215c 100644 --- a/PLC/Methods/AddRoleToPerson.py +++ b/PLC/Methods/AddRoleToPerson.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Roles import Role, Roles class AddRoleToPerson(Method): @@ -18,7 +18,7 @@ class AddRoleToPerson(Method): roles = ['admin', 'pi'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Role.fields['role_id'], Role.fields['name']), Mixed(Person.fields['person_id'], diff --git a/PLC/Methods/AddSite.py b/PLC/Methods/AddSite.py index 10d65859..5fcfe9fa 100644 --- a/PLC/Methods/AddSite.py +++ b/PLC/Methods/AddSite.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['name', 'abbreviated_name', 'login_base', @@ -22,7 +22,7 @@ class AddSite(Method): site_fields = dict(filter(can_update, Site.fields.items())) accepts = [ - PasswordAuth(), + Auth(), site_fields ] diff --git a/PLC/Methods/AddSiteAddress.py b/PLC/Methods/AddSiteAddress.py index 7baf7714..8a9c8a72 100644 --- a/PLC/Methods/AddSiteAddress.py +++ b/PLC/Methods/AddSiteAddress.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Addresses import Address, Addresses -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Sites import Site, Sites can_update = lambda (field, value): field in \ @@ -24,7 +24,7 @@ class AddSiteAddress(Method): address_fields = dict(filter(can_update, Address.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(Site.fields['site_id'], Site.fields['login_base']), address_fields diff --git a/PLC/Methods/AddSlice.py b/PLC/Methods/AddSlice.py index f0adebeb..c166e70a 100644 --- a/PLC/Methods/AddSlice.py +++ b/PLC/Methods/AddSlice.py @@ -4,7 +4,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Slices import Slice, Slices -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Sites import Site, Sites can_update = lambda (field, value): field in \ @@ -32,7 +32,7 @@ class AddSlice(Method): slice_fields = dict(filter(can_update, Slice.fields.items())) accepts = [ - PasswordAuth(), + Auth(), slice_fields ] diff --git a/PLC/Methods/AddSliceAttribute.py b/PLC/Methods/AddSliceAttribute.py index 58fdac76..6f808c49 100644 --- a/PLC/Methods/AddSliceAttribute.py +++ b/PLC/Methods/AddSliceAttribute.py @@ -5,7 +5,7 @@ from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes from PLC.Slices import Slice, Slices from PLC.Nodes import Node, Nodes from PLC.SliceAttributes import SliceAttribute, SliceAttributes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddSliceAttribute(Method): """ @@ -25,7 +25,7 @@ class AddSliceAttribute(Method): roles = ['admin', 'pi', 'user'] accepts = [ - PasswordAuth(), + Auth(), Mixed(SliceAttribute.fields['slice_id'], SliceAttribute.fields['name']), Mixed(SliceAttribute.fields['attribute_type_id'], diff --git a/PLC/Methods/AddSliceAttributeType.py b/PLC/Methods/AddSliceAttributeType.py index ddb3bf59..640ee50d 100644 --- a/PLC/Methods/AddSliceAttributeType.py +++ b/PLC/Methods/AddSliceAttributeType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['name', 'description', 'min_role_id'] @@ -21,7 +21,7 @@ class AddSliceAttributeType(Method): attribute_type_fields = dict(filter(can_update, SliceAttributeType.fields.items())) accepts = [ - PasswordAuth(), + Auth(), attribute_type_fields ] diff --git a/PLC/Methods/AddSliceToNodes.py b/PLC/Methods/AddSliceToNodes.py index 290dbc76..8cc9ad77 100644 --- a/PLC/Methods/AddSliceToNodes.py +++ b/PLC/Methods/AddSliceToNodes.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.Slices import Slice, Slices -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddSliceToNodes(Method): """ @@ -16,7 +16,7 @@ class AddSliceToNodes(Method): roles = ['admin', 'pi', 'user'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Slice.fields['slice_id'], Slice.fields['name']), [Mixed(Node.fields['node_id'], diff --git a/PLC/Methods/AdmAddAddressType.py b/PLC/Methods/AdmAddAddressType.py index fb56b49e..e0cd09dc 100644 --- a/PLC/Methods/AdmAddAddressType.py +++ b/PLC/Methods/AdmAddAddressType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.AddressTypes import AddressType, AddressTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.AddAddressType import AddAddressType class AdmAddAddressType(AddAddressType): @@ -13,7 +13,7 @@ class AdmAddAddressType(AddAddressType): status = "deprecated" accepts = [ - PasswordAuth(), + Auth(), AddressType.fields['name'] ] diff --git a/PLC/Methods/AdmAddNode.py b/PLC/Methods/AdmAddNode.py index 77bc9f13..dda5c99d 100644 --- a/PLC/Methods/AdmAddNode.py +++ b/PLC/Methods/AdmAddNode.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.AddNode import AddNode can_update = lambda (field, value): field in \ @@ -19,7 +19,7 @@ class AdmAddNode(AddNode): node_fields = dict(filter(can_update, Node.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Site.fields['site_id'], Node.fields['hostname'], Node.fields['boot_state'], diff --git a/PLC/Methods/AdmAddNodeGroup.py b/PLC/Methods/AdmAddNodeGroup.py index 03faa7b4..6bbb59e4 100644 --- a/PLC/Methods/AdmAddNodeGroup.py +++ b/PLC/Methods/AdmAddNodeGroup.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NodeGroups import NodeGroup, NodeGroups -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.AddNodeGroup import AddNodeGroup class AdmAddNodeGroup(AddNodeGroup): @@ -13,7 +13,7 @@ class AdmAddNodeGroup(AddNodeGroup): status = "deprecated" accepts = [ - PasswordAuth(), + Auth(), NodeGroup.fields['name'], NodeGroup.fields['description'] ] diff --git a/PLC/Methods/AdmAddNodeNetwork.py b/PLC/Methods/AdmAddNodeNetwork.py index 58c98746..c309a772 100644 --- a/PLC/Methods/AdmAddNodeNetwork.py +++ b/PLC/Methods/AdmAddNodeNetwork.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NodeNetworks import NodeNetwork, NodeNetworks -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.AddNodeNetwork import AddNodeNetwork can_update = lambda (field, value): field not in ['nodenetwork_id', 'node_id', 'method', 'type'] @@ -17,7 +17,7 @@ class AdmAddNodeNetwork(AddNodeNetwork): nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items())) accepts = [ - PasswordAuth(), + Auth(), NodeNetwork.fields['node_id'], NodeNetwork.fields['method'], NodeNetwork.fields['type'], diff --git a/PLC/Methods/AdmAddPerson.py b/PLC/Methods/AdmAddPerson.py index c43b4d9b..2b90f61a 100644 --- a/PLC/Methods/AdmAddPerson.py +++ b/PLC/Methods/AdmAddPerson.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.AddPerson import AddPerson can_update = lambda (field, value): field in \ @@ -18,7 +18,7 @@ class AdmAddPerson(AddPerson): person_fields = dict(filter(can_update, Person.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Person.fields['first_name'], Person.fields['last_name'], person_fields diff --git a/PLC/Methods/AdmAddPersonKey.py b/PLC/Methods/AdmAddPersonKey.py index b30fe149..05d0a69d 100644 --- a/PLC/Methods/AdmAddPersonKey.py +++ b/PLC/Methods/AdmAddPersonKey.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Keys import Key, Keys from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.AddPersonKey import AddPersonKey class AdmAddPersonKey(AddPersonKey): @@ -15,7 +15,7 @@ class AdmAddPersonKey(AddPersonKey): status = "deprecated" accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), Key.fields['key_type'], diff --git a/PLC/Methods/AdmAddSite.py b/PLC/Methods/AdmAddSite.py index fa85a4eb..929c0a73 100644 --- a/PLC/Methods/AdmAddSite.py +++ b/PLC/Methods/AdmAddSite.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.AddSite import AddSite can_update = lambda (field, value): field in \ @@ -18,7 +18,7 @@ class AdmAddSite(AddSite): site_fields = dict(filter(can_update, Site.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Site.fields['name'], Site.fields['abbreviated_name'], Site.fields['login_base'], diff --git a/PLC/Methods/AdmAssociateNodeToPowerControlUnitPort.py b/PLC/Methods/AdmAssociateNodeToPowerControlUnitPort.py index c13233cf..9e955be3 100644 --- a/PLC/Methods/AdmAssociateNodeToPowerControlUnitPort.py +++ b/PLC/Methods/AdmAssociateNodeToPowerControlUnitPort.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.AddNodeToPCU import AddNodeToPCU class AdmAssociateNodeToPowerControlUnitPort(AddNodeToPCU): @@ -16,7 +16,7 @@ class AdmAssociateNodeToPowerControlUnitPort(AddNodeToPCU): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), PCU.fields['pcu_id'], Parameter(int, 'PCU port number'), Mixed(Node.fields['node_id'], diff --git a/PLC/Methods/AdmDeleteAllPersonKeys.py b/PLC/Methods/AdmDeleteAllPersonKeys.py index 374bbb96..9cda950a 100644 --- a/PLC/Methods/AdmDeleteAllPersonKeys.py +++ b/PLC/Methods/AdmDeleteAllPersonKeys.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Keys import Key, Keys -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmDeleteAllPersonKeys(Method): """ @@ -23,7 +23,7 @@ class AdmDeleteAllPersonKeys(Method): roles = ['admin', 'pi', 'tech', 'user'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']) ] diff --git a/PLC/Methods/AdmDeleteNodeNetwork.py b/PLC/Methods/AdmDeleteNodeNetwork.py index dd9f386c..8750104a 100644 --- a/PLC/Methods/AdmDeleteNodeNetwork.py +++ b/PLC/Methods/AdmDeleteNodeNetwork.py @@ -1,7 +1,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks from PLC.Methods.DeleteNodeNetwork import DeleteNodeNetwork @@ -14,7 +14,7 @@ class AdmDeleteNodeNetwork(DeleteNodeNetwork): status = "deprecated" accepts = [ - PasswordAuth(), + Auth(), Mixed(Node.fields['node_id'], Node.fields['hostname']), Mixed(NodeNetwork.fields['nodenetwork_id'], diff --git a/PLC/Methods/AdmDeletePersonKeys.py b/PLC/Methods/AdmDeletePersonKeys.py index 7a72e6c8..0b9cd402 100644 --- a/PLC/Methods/AdmDeletePersonKeys.py +++ b/PLC/Methods/AdmDeletePersonKeys.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Keys import Key, Keys -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmDeletePersonKeys(Method): """ @@ -21,7 +21,7 @@ class AdmDeletePersonKeys(Method): roles = ['admin', 'pi', 'tech', 'user'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), [Key.fields['key_id']] diff --git a/PLC/Methods/AdmDisassociatePowerControlUnitPort.py b/PLC/Methods/AdmDisassociatePowerControlUnitPort.py index 0b52c7eb..fa173c64 100644 --- a/PLC/Methods/AdmDisassociatePowerControlUnitPort.py +++ b/PLC/Methods/AdmDisassociatePowerControlUnitPort.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.DeleteNodeFromPCU import DeleteNodeFromPCU class AdmDisassociatePowerControlUnitPort(DeleteNodeFromPCU): @@ -16,7 +16,7 @@ class AdmDisassociatePowerControlUnitPort(DeleteNodeFromPCU): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), PCU.fields['pcu_id'], Parameter(int, 'PCU port number'), ] diff --git a/PLC/Methods/AdmGenerateNodeConfFile.py b/PLC/Methods/AdmGenerateNodeConfFile.py index 0afbabb4..a2c7dbd7 100644 --- a/PLC/Methods/AdmGenerateNodeConfFile.py +++ b/PLC/Methods/AdmGenerateNodeConfFile.py @@ -6,7 +6,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmGenerateNodeConfFile(Method): """ @@ -28,7 +28,7 @@ class AdmGenerateNodeConfFile(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Node.fields['node_id'], Node.fields['hostname']) ] diff --git a/PLC/Methods/AdmGetAllNodeNetworks.py b/PLC/Methods/AdmGetAllNodeNetworks.py index c947d256..1504050b 100644 --- a/PLC/Methods/AdmGetAllNodeNetworks.py +++ b/PLC/Methods/AdmGetAllNodeNetworks.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.GetNodeNetworks import GetNodeNetworks class AdmGetAllNodeNetworks(GetNodeNetworks): @@ -17,7 +17,7 @@ class AdmGetAllNodeNetworks(GetNodeNetworks): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Node.fields['node_id'], Node.fields['hostname']) ] diff --git a/PLC/Methods/AdmGetAllRoles.py b/PLC/Methods/AdmGetAllRoles.py index 1a2ce423..2b887145 100644 --- a/PLC/Methods/AdmGetAllRoles.py +++ b/PLC/Methods/AdmGetAllRoles.py @@ -1,7 +1,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.GetRoles import GetRoles class AdmGetAllRoles(GetRoles): diff --git a/PLC/Methods/AdmGetNodeGroupNodes.py b/PLC/Methods/AdmGetNodeGroupNodes.py index a040685d..2daed59e 100644 --- a/PLC/Methods/AdmGetNodeGroupNodes.py +++ b/PLC/Methods/AdmGetNodeGroupNodes.py @@ -1,7 +1,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.NodeGroups import NodeGroup, NodeGroups class AdmGetNodeGroupNodes(Method): @@ -16,7 +16,7 @@ class AdmGetNodeGroupNodes(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(NodeGroup.fields['nodegroup_id'], NodeGroup.fields['name']) ] diff --git a/PLC/Methods/AdmGetPersonKeys.py b/PLC/Methods/AdmGetPersonKeys.py index 548fade5..515d3937 100644 --- a/PLC/Methods/AdmGetPersonKeys.py +++ b/PLC/Methods/AdmGetPersonKeys.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Keys import Key, Keys -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.GetKeys import GetKeys class AdmGetPersonKeys(GetKeys): @@ -17,7 +17,7 @@ class AdmGetPersonKeys(GetKeys): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), [Key.fields['key_id']] diff --git a/PLC/Methods/AdmGetPersonRoles.py b/PLC/Methods/AdmGetPersonRoles.py index 16cc9bc2..2a862aae 100644 --- a/PLC/Methods/AdmGetPersonRoles.py +++ b/PLC/Methods/AdmGetPersonRoles.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmGetPersonRoles(Method): """ @@ -26,7 +26,7 @@ class AdmGetPersonRoles(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']) ] diff --git a/PLC/Methods/AdmGetPersonSites.py b/PLC/Methods/AdmGetPersonSites.py index 8e0c9bac..1807ef13 100644 --- a/PLC/Methods/AdmGetPersonSites.py +++ b/PLC/Methods/AdmGetPersonSites.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmGetPersonSites(Method): """ @@ -22,7 +22,7 @@ class AdmGetPersonSites(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']) ] diff --git a/PLC/Methods/AdmGetPowerControlUnitNodes.py b/PLC/Methods/AdmGetPowerControlUnitNodes.py index f9590878..7319e684 100644 --- a/PLC/Methods/AdmGetPowerControlUnitNodes.py +++ b/PLC/Methods/AdmGetPowerControlUnitNodes.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmGetPowerControlUnitNodes(Method): """ @@ -20,7 +20,7 @@ class AdmGetPowerControlUnitNodes(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), PCU.fields['pcu_id'] ] diff --git a/PLC/Methods/AdmGetSiteNodes.py b/PLC/Methods/AdmGetSiteNodes.py index 7eb822b9..ea09c095 100644 --- a/PLC/Methods/AdmGetSiteNodes.py +++ b/PLC/Methods/AdmGetSiteNodes.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmGetSiteNodes(Method): """ @@ -23,7 +23,7 @@ class AdmGetSiteNodes(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(Site.fields['site_id'], Site.fields['name'])], ] diff --git a/PLC/Methods/AdmGetSitePIs.py b/PLC/Methods/AdmGetSitePIs.py index 7bf8fd80..5d482856 100644 --- a/PLC/Methods/AdmGetSitePIs.py +++ b/PLC/Methods/AdmGetSitePIs.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Sites import Site, Sites from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmGetSitePIs(Method): """ @@ -18,7 +18,7 @@ class AdmGetSitePIs(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Site.fields['site_id'], Site.fields['login_base']) ] diff --git a/PLC/Methods/AdmGetSitePersons.py b/PLC/Methods/AdmGetSitePersons.py index 58bd51e9..ca6b47fc 100644 --- a/PLC/Methods/AdmGetSitePersons.py +++ b/PLC/Methods/AdmGetSitePersons.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmGetSitePersons(Method): """ @@ -19,7 +19,7 @@ class AdmGetSitePersons(Method): roles = ['admin', 'pi'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Site.fields['site_id'], Site.fields['login_base']) ] diff --git a/PLC/Methods/AdmGetSitePowerControlUnits.py b/PLC/Methods/AdmGetSitePowerControlUnits.py index 8128b0b1..dd0b9a54 100644 --- a/PLC/Methods/AdmGetSitePowerControlUnits.py +++ b/PLC/Methods/AdmGetSitePowerControlUnits.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.PCUs import PCU, PCUs from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmGetSitePowerControlUnits(Method): """ @@ -15,7 +15,7 @@ class AdmGetSitePowerControlUnits(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Site.fields['site_id'], Site.fields['login_base']) ] diff --git a/PLC/Methods/AdmGetSiteTechContacts.py b/PLC/Methods/AdmGetSiteTechContacts.py index 93a98196..b7eeaad0 100644 --- a/PLC/Methods/AdmGetSiteTechContacts.py +++ b/PLC/Methods/AdmGetSiteTechContacts.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Sites import Site, Sites from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmGetSiteTechContacts(Method): """ @@ -19,7 +19,7 @@ class AdmGetSiteTechContacts(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Site.fields['site_id'], Site.fields['login_base']) ] diff --git a/PLC/Methods/AdmIsPersonInRole.py b/PLC/Methods/AdmIsPersonInRole.py index 615546d5..119d0a1e 100644 --- a/PLC/Methods/AdmIsPersonInRole.py +++ b/PLC/Methods/AdmIsPersonInRole.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Roles import Role, Roles class AdmIsPersonInRole(Method): @@ -20,7 +20,7 @@ class AdmIsPersonInRole(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), Mixed(Parameter(int, "Role identifier"), diff --git a/PLC/Methods/AdmQueryConfFile.py b/PLC/Methods/AdmQueryConfFile.py index 28771d23..2fb0bcf0 100644 --- a/PLC/Methods/AdmQueryConfFile.py +++ b/PLC/Methods/AdmQueryConfFile.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.ConfFiles import ConfFile, ConfFiles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmQueryConfFile(Method): """ @@ -15,7 +15,7 @@ class AdmQueryConfFile(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), {'node_id': Node.fields['node_id']} ] diff --git a/PLC/Methods/AdmQueryNode.py b/PLC/Methods/AdmQueryNode.py index 8297f246..b2fe695d 100644 --- a/PLC/Methods/AdmQueryNode.py +++ b/PLC/Methods/AdmQueryNode.py @@ -5,7 +5,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks, valid_ip -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmQueryNode(Method): """ @@ -18,7 +18,7 @@ class AdmQueryNode(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), {'node_hostname': Node.fields['hostname'], 'nodenetwork_ip': NodeNetwork.fields['ip'], 'nodenetwork_mac': NodeNetwork.fields['mac'], diff --git a/PLC/Methods/AdmQueryPerson.py b/PLC/Methods/AdmQueryPerson.py index f1f1e500..8d0c8535 100644 --- a/PLC/Methods/AdmQueryPerson.py +++ b/PLC/Methods/AdmQueryPerson.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmQueryPerson(Method): """ @@ -14,7 +14,7 @@ class AdmQueryPerson(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), {'email': Person.fields['email']} ] diff --git a/PLC/Methods/AdmQueryPowerControlUnit.py b/PLC/Methods/AdmQueryPowerControlUnit.py index 25bbc0e5..93925302 100644 --- a/PLC/Methods/AdmQueryPowerControlUnit.py +++ b/PLC/Methods/AdmQueryPowerControlUnit.py @@ -6,7 +6,7 @@ from PLC.Parameter import Parameter, Mixed from PLC.PCUs import PCU, PCUs from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks, valid_ip -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmQueryPowerControlUnit(Method): """ @@ -19,7 +19,7 @@ class AdmQueryPowerControlUnit(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), {'pcu_hostname': PCU.fields['hostname'], 'pcu_ip': PCU.fields['ip'], 'node_hostname': Node.fields['hostname'], diff --git a/PLC/Methods/AdmQuerySite.py b/PLC/Methods/AdmQuerySite.py index ef3a2eb6..dbc2c3f9 100644 --- a/PLC/Methods/AdmQuerySite.py +++ b/PLC/Methods/AdmQuerySite.py @@ -6,7 +6,7 @@ from PLC.Parameter import Parameter, Mixed from PLC.Sites import Site, Sites from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks, valid_ip -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AdmQuerySite(Method): """ @@ -19,7 +19,7 @@ class AdmQuerySite(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), {'site_name': Site.fields['name'], 'site_abbreviatedname': Site.fields['abbreviated_name'], 'site_loginbase': Site.fields['login_base'], diff --git a/PLC/Methods/AdmSetPersonEnabled.py b/PLC/Methods/AdmSetPersonEnabled.py index 662347fb..2009f006 100644 --- a/PLC/Methods/AdmSetPersonEnabled.py +++ b/PLC/Methods/AdmSetPersonEnabled.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.UpdatePerson import UpdatePerson class AdmSetPersonEnabled(UpdatePerson): @@ -13,7 +13,7 @@ class AdmSetPersonEnabled(UpdatePerson): status = "deprecated" accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), Person.fields['enabled'] diff --git a/PLC/Methods/AdmUpdateNodeGroup.py b/PLC/Methods/AdmUpdateNodeGroup.py index b63dcfaa..b53198ac 100644 --- a/PLC/Methods/AdmUpdateNodeGroup.py +++ b/PLC/Methods/AdmUpdateNodeGroup.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NodeGroups import NodeGroup, NodeGroups -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Methods.UpdateNodeGroup import UpdateNodeGroup class AdmUpdateNodeGroup(UpdateNodeGroup): @@ -13,7 +13,7 @@ class AdmUpdateNodeGroup(UpdateNodeGroup): status = "deprecated" accepts = [ - PasswordAuth(), + Auth(), Mixed(NodeGroup.fields['nodegroup_id'], NodeGroup.fields['name']), NodeGroup.fields['name'], diff --git a/PLC/Methods/BlacklistKey.py b/PLC/Methods/BlacklistKey.py index 27339ecd..9b72492c 100644 --- a/PLC/Methods/BlacklistKey.py +++ b/PLC/Methods/BlacklistKey.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Keys import Key, Keys -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class BlacklistKey(Method): """ @@ -18,7 +18,7 @@ class BlacklistKey(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Key.fields['key_id'], ] diff --git a/PLC/Methods/BootUpdateNode.py b/PLC/Methods/BootUpdateNode.py index 032328c6..48e02193 100644 --- a/PLC/Methods/BootUpdateNode.py +++ b/PLC/Methods/BootUpdateNode.py @@ -1,6 +1,6 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth, BootAuth +from PLC.Auth import Auth, BootAuth class BootUpdateNode(Method): """ diff --git a/PLC/Methods/DeleteAddress.py b/PLC/Methods/DeleteAddress.py index 363896f0..3fecaec2 100644 --- a/PLC/Methods/DeleteAddress.py +++ b/PLC/Methods/DeleteAddress.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Addresses import Address, Addresses -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteAddress(Method): """ @@ -16,7 +16,7 @@ class DeleteAddress(Method): roles = ['admin', 'pi'] accepts = [ - PasswordAuth(), + Auth(), Address.fields['address_id'], ] diff --git a/PLC/Methods/DeleteAddressType.py b/PLC/Methods/DeleteAddressType.py index 0ccb168b..445469eb 100644 --- a/PLC/Methods/DeleteAddressType.py +++ b/PLC/Methods/DeleteAddressType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.AddressTypes import AddressType, AddressTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteAddressType(Method): """ @@ -14,7 +14,7 @@ class DeleteAddressType(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(AddressType.fields['address_type_id'], AddressType.fields['name']) ] diff --git a/PLC/Methods/DeleteAddressTypeFromAddress.py b/PLC/Methods/DeleteAddressTypeFromAddress.py index 266a9ffe..68a48403 100644 --- a/PLC/Methods/DeleteAddressTypeFromAddress.py +++ b/PLC/Methods/DeleteAddressTypeFromAddress.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.AddressTypes import AddressType, AddressTypes from PLC.Addresses import Address, Addresses -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteAddressTypeFromAddress(Method): """ @@ -17,7 +17,7 @@ class DeleteAddressTypeFromAddress(Method): roles = ['admin', 'pi'] accepts = [ - PasswordAuth(), + Auth(), Mixed(AddressType.fields['address_type_id'], AddressType.fields['name']), Address.fields['address_id'] diff --git a/PLC/Methods/DeleteBootState.py b/PLC/Methods/DeleteBootState.py index bf4175d9..b516ef12 100644 --- a/PLC/Methods/DeleteBootState.py +++ b/PLC/Methods/DeleteBootState.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.BootStates import BootState, BootStates -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteBootState(Method): """ @@ -17,7 +17,7 @@ class DeleteBootState(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), BootState.fields['boot_state'] ] diff --git a/PLC/Methods/DeleteConfFile.py b/PLC/Methods/DeleteConfFile.py index 226e9ddb..0c7f0bf9 100644 --- a/PLC/Methods/DeleteConfFile.py +++ b/PLC/Methods/DeleteConfFile.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.ConfFiles import ConfFile, ConfFiles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteConfFile(Method): """ @@ -14,7 +14,7 @@ class DeleteConfFile(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), ConfFile.fields['conf_file_id'] ] diff --git a/PLC/Methods/DeleteConfFileFromNode.py b/PLC/Methods/DeleteConfFileFromNode.py index bd4d01a1..e82c2f6f 100644 --- a/PLC/Methods/DeleteConfFileFromNode.py +++ b/PLC/Methods/DeleteConfFileFromNode.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.ConfFiles import ConfFile, ConfFiles from PLC.Nodes import Node, Nodes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteConfFileFromNode(Method): """ @@ -16,7 +16,7 @@ class DeleteConfFileFromNode(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), ConfFile.fields['conf_file_id'], Mixed(Node.fields['node_id'], Node.fields['hostname']) diff --git a/PLC/Methods/DeleteConfFileFromNodeGroup.py b/PLC/Methods/DeleteConfFileFromNodeGroup.py index 183d431c..22523dba 100644 --- a/PLC/Methods/DeleteConfFileFromNodeGroup.py +++ b/PLC/Methods/DeleteConfFileFromNodeGroup.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.ConfFiles import ConfFile, ConfFiles from PLC.NodeGroups import NodeGroup, NodeGroups -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteConfFileFromNodeGroup(Method): """ @@ -16,7 +16,7 @@ class DeleteConfFileFromNodeGroup(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), ConfFile.fields['conf_file_id'], Mixed(NodeGroup.fields['nodegroup_id'], NodeGroup.fields['name']) diff --git a/PLC/Methods/DeleteKey.py b/PLC/Methods/DeleteKey.py index fdd7b5f1..aef60842 100644 --- a/PLC/Methods/DeleteKey.py +++ b/PLC/Methods/DeleteKey.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Keys import Key, Keys -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteKey(Method): """ @@ -16,7 +16,7 @@ class DeleteKey(Method): roles = ['admin', 'pi', 'tech', 'user'] accepts = [ - PasswordAuth(), + Auth(), Key.fields['key_id'], ] diff --git a/PLC/Methods/DeleteKeyType.py b/PLC/Methods/DeleteKeyType.py index 9f230a94..2a25c711 100644 --- a/PLC/Methods/DeleteKeyType.py +++ b/PLC/Methods/DeleteKeyType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.KeyTypes import KeyType, KeyTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteKeyType(Method): """ @@ -16,7 +16,7 @@ class DeleteKeyType(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), KeyType.fields['key_type'] ] diff --git a/PLC/Methods/DeleteNetworkMethod.py b/PLC/Methods/DeleteNetworkMethod.py index 13c527eb..2238469e 100644 --- a/PLC/Methods/DeleteNetworkMethod.py +++ b/PLC/Methods/DeleteNetworkMethod.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NetworkMethods import NetworkMethod, NetworkMethods -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteNetworkMethod(Method): """ @@ -17,7 +17,7 @@ class DeleteNetworkMethod(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), NetworkMethod.fields['method'] ] diff --git a/PLC/Methods/DeleteNetworkType.py b/PLC/Methods/DeleteNetworkType.py index 22a90aed..f26232bc 100644 --- a/PLC/Methods/DeleteNetworkType.py +++ b/PLC/Methods/DeleteNetworkType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NetworkTypes import NetworkType, NetworkTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteNetworkType(Method): """ @@ -17,7 +17,7 @@ class DeleteNetworkType(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), NetworkType.fields['type'] ] diff --git a/PLC/Methods/DeleteNode.py b/PLC/Methods/DeleteNode.py index 95553177..038ed59e 100644 --- a/PLC/Methods/DeleteNode.py +++ b/PLC/Methods/DeleteNode.py @@ -1,7 +1,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Nodes import Node, Nodes class DeleteNode(Method): @@ -17,7 +17,7 @@ class DeleteNode(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Node.fields['node_id'], Node.fields['hostname']) ] diff --git a/PLC/Methods/DeleteNodeFromNodeGroup.py b/PLC/Methods/DeleteNodeFromNodeGroup.py index aa80631b..1e61fe54 100644 --- a/PLC/Methods/DeleteNodeFromNodeGroup.py +++ b/PLC/Methods/DeleteNodeFromNodeGroup.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NodeGroups import NodeGroup, NodeGroups from PLC.Nodes import Node, Nodes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteNodeFromNodeGroup(Method): """ @@ -15,7 +15,7 @@ class DeleteNodeFromNodeGroup(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(NodeGroup.fields['nodegroup_id'], NodeGroup.fields['name']), Mixed(Node.fields['node_id'], diff --git a/PLC/Methods/DeleteNodeFromPCU.py b/PLC/Methods/DeleteNodeFromPCU.py index 9e2afec3..70252f09 100644 --- a/PLC/Methods/DeleteNodeFromPCU.py +++ b/PLC/Methods/DeleteNodeFromPCU.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteNodeFromPCU(Method): """ @@ -17,7 +17,7 @@ class DeleteNodeFromPCU(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Node.fields['node_id'], Node.fields['hostname']), PCU.fields['pcu_id'] diff --git a/PLC/Methods/DeleteNodeGroup.py b/PLC/Methods/DeleteNodeGroup.py index cf6dd8aa..d6de9b78 100644 --- a/PLC/Methods/DeleteNodeGroup.py +++ b/PLC/Methods/DeleteNodeGroup.py @@ -1,7 +1,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.NodeGroups import NodeGroup, NodeGroups class DeleteNodeGroup(Method): @@ -16,7 +16,7 @@ class DeleteNodeGroup(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(NodeGroup.fields['nodegroup_id'], NodeGroup.fields['name']) ] diff --git a/PLC/Methods/DeleteNodeNetwork.py b/PLC/Methods/DeleteNodeNetwork.py index 47910e30..9deb4f17 100644 --- a/PLC/Methods/DeleteNodeNetwork.py +++ b/PLC/Methods/DeleteNodeNetwork.py @@ -1,7 +1,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks @@ -19,7 +19,7 @@ class DeleteNodeNetwork(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(NodeNetwork.fields['nodenetwork_id'], NodeNetwork.fields['ip']) ] diff --git a/PLC/Methods/DeletePCU.py b/PLC/Methods/DeletePCU.py index ae52b43f..4b50a3f3 100644 --- a/PLC/Methods/DeletePCU.py +++ b/PLC/Methods/DeletePCU.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeletePCU(Method): """ @@ -16,7 +16,7 @@ class DeletePCU(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), PCU.fields['pcu_id'], ] diff --git a/PLC/Methods/DeletePerson.py b/PLC/Methods/DeletePerson.py index 8375439b..2a6e8cc5 100644 --- a/PLC/Methods/DeletePerson.py +++ b/PLC/Methods/DeletePerson.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeletePerson(Method): """ @@ -18,7 +18,7 @@ class DeletePerson(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']) ] diff --git a/PLC/Methods/DeletePersonFromSite.py b/PLC/Methods/DeletePersonFromSite.py index b7be3ac9..4479183b 100644 --- a/PLC/Methods/DeletePersonFromSite.py +++ b/PLC/Methods/DeletePersonFromSite.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeletePersonFromSite(Method): """ @@ -17,7 +17,7 @@ class DeletePersonFromSite(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), Mixed(Site.fields['site_id'], diff --git a/PLC/Methods/DeletePersonFromSlice.py b/PLC/Methods/DeletePersonFromSlice.py index b9a5977f..8b5293cd 100644 --- a/PLC/Methods/DeletePersonFromSlice.py +++ b/PLC/Methods/DeletePersonFromSlice.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Slices import Slice, Slices -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeletePersonFromSlice(Method): """ @@ -16,7 +16,7 @@ class DeletePersonFromSlice(Method): roles = ['admin', 'pi'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), Mixed(Slice.fields['slice_id'], diff --git a/PLC/Methods/DeleteRole.py b/PLC/Methods/DeleteRole.py index 38287a9c..bb4a471c 100644 --- a/PLC/Methods/DeleteRole.py +++ b/PLC/Methods/DeleteRole.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Roles import Role, Roles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteRole(Method): """ @@ -18,7 +18,7 @@ class DeleteRole(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Role.fields['role_id'], Role.fields['name']) ] diff --git a/PLC/Methods/DeleteRoleFromPerson.py b/PLC/Methods/DeleteRoleFromPerson.py index a1333675..175c672c 100644 --- a/PLC/Methods/DeleteRoleFromPerson.py +++ b/PLC/Methods/DeleteRoleFromPerson.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Roles import Role, Roles class DeleteRoleFromPerson(Method): @@ -18,7 +18,7 @@ class DeleteRoleFromPerson(Method): roles = ['admin', 'pi'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Role.fields['role_id'], Role.fields['name']), Mixed(Person.fields['person_id'], diff --git a/PLC/Methods/DeleteSite.py b/PLC/Methods/DeleteSite.py index d16946db..28bfceef 100644 --- a/PLC/Methods/DeleteSite.py +++ b/PLC/Methods/DeleteSite.py @@ -5,7 +5,7 @@ from PLC.Sites import Site, Sites from PLC.Persons import Person, Persons from PLC.Nodes import Node, Nodes from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteSite(Method): """ @@ -20,7 +20,7 @@ class DeleteSite(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Site.fields['site_id'], Site.fields['login_base']) ] diff --git a/PLC/Methods/DeleteSlice.py b/PLC/Methods/DeleteSlice.py index ff895448..6fdaa7a1 100644 --- a/PLC/Methods/DeleteSlice.py +++ b/PLC/Methods/DeleteSlice.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Slices import Slice, Slices -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteSlice(Method): """ @@ -18,7 +18,7 @@ class DeleteSlice(Method): roles = ['admin', 'pi', 'user'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Slice.fields['slice_id'], Slice.fields['name']), ] diff --git a/PLC/Methods/DeleteSliceAttribute.py b/PLC/Methods/DeleteSliceAttribute.py index b1a9f493..1afc9ce9 100644 --- a/PLC/Methods/DeleteSliceAttribute.py +++ b/PLC/Methods/DeleteSliceAttribute.py @@ -4,7 +4,7 @@ from PLC.Parameter import Parameter, Mixed from PLC.SliceAttributes import SliceAttribute, SliceAttributes from PLC.Slices import Slice, Slices from PLC.Nodes import Node, Nodes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteSliceAttribute(Method): """ @@ -22,7 +22,7 @@ class DeleteSliceAttribute(Method): roles = ['admin', 'pi', 'user'] accepts = [ - PasswordAuth(), + Auth(), SliceAttribute.fields['slice_attribute_id'] ] diff --git a/PLC/Methods/DeleteSliceAttributeType.py b/PLC/Methods/DeleteSliceAttributeType.py index 45626f7d..66b64e8d 100644 --- a/PLC/Methods/DeleteSliceAttributeType.py +++ b/PLC/Methods/DeleteSliceAttributeType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteSliceAttributeType(Method): """ @@ -14,7 +14,7 @@ class DeleteSliceAttributeType(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), Mixed(SliceAttributeType.fields['attribute_type_id'], SliceAttributeType.fields['name']), ] diff --git a/PLC/Methods/DeleteSliceFromNodes.py b/PLC/Methods/DeleteSliceFromNodes.py index 12a9b264..524a648f 100644 --- a/PLC/Methods/DeleteSliceFromNodes.py +++ b/PLC/Methods/DeleteSliceFromNodes.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.Slices import Slice, Slices -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteSliceFromNodes(Method): """ @@ -16,7 +16,7 @@ class DeleteSliceFromNodes(Method): roles = ['admin', 'pi', 'user'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Slice.fields['slice_id'], Slice.fields['name']), [Mixed(Node.fields['node_id'], diff --git a/PLC/Methods/GetAddressTypes.py b/PLC/Methods/GetAddressTypes.py index 0aaef9b6..df3a1b61 100644 --- a/PLC/Methods/GetAddressTypes.py +++ b/PLC/Methods/GetAddressTypes.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.AddressTypes import AddressType, AddressTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetAddressTypes(Method): """ @@ -14,7 +14,7 @@ class GetAddressTypes(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(AddressType.fields['address_type_id'], AddressType.fields['name'])] ] diff --git a/PLC/Methods/GetAddresses.py b/PLC/Methods/GetAddresses.py index 0cc3538c..75b8ad65 100644 --- a/PLC/Methods/GetAddresses.py +++ b/PLC/Methods/GetAddresses.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Addresses import Address, Addresses -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetAddresses(Method): """ @@ -14,7 +14,7 @@ class GetAddresses(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Address.fields['address_id']], ] diff --git a/PLC/Methods/GetBootStates.py b/PLC/Methods/GetBootStates.py index fd7bdd27..71e2cd43 100644 --- a/PLC/Methods/GetBootStates.py +++ b/PLC/Methods/GetBootStates.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.BootStates import BootState, BootStates -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetBootStates(Method): """ @@ -12,7 +12,7 @@ class GetBootStates(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth() + Auth() ] returns = [BootState.fields['boot_state']] diff --git a/PLC/Methods/GetConfFiles.py b/PLC/Methods/GetConfFiles.py index 7c41e2f6..fe3cb79b 100644 --- a/PLC/Methods/GetConfFiles.py +++ b/PLC/Methods/GetConfFiles.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.ConfFiles import ConfFile, ConfFiles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetConfFiles(Method): """ @@ -14,7 +14,7 @@ class GetConfFiles(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), [ConfFile.fields['conf_file_id']] ] diff --git a/PLC/Methods/GetEvents.py b/PLC/Methods/GetEvents.py index 34b6ed62..4d293112 100644 --- a/PLC/Methods/GetEvents.py +++ b/PLC/Methods/GetEvents.py @@ -4,7 +4,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Events import Event, Events -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetEvents(Method): """ @@ -18,7 +18,7 @@ class GetEvents(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Event.fields['event_id']], [Event.fields['person_id']], Event.fields['object_ids'], diff --git a/PLC/Methods/GetKeyTypes.py b/PLC/Methods/GetKeyTypes.py index 64e93990..50828a02 100644 --- a/PLC/Methods/GetKeyTypes.py +++ b/PLC/Methods/GetKeyTypes.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.KeyTypes import KeyType, KeyTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetKeyTypes(Method): """ @@ -12,7 +12,7 @@ class GetKeyTypes(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth() + Auth() ] returns = [KeyType.fields['key_type']] diff --git a/PLC/Methods/GetKeys.py b/PLC/Methods/GetKeys.py index f54c8e71..910707b8 100644 --- a/PLC/Methods/GetKeys.py +++ b/PLC/Methods/GetKeys.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Keys import Key, Keys -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetKeys(Method): """ @@ -16,7 +16,7 @@ class GetKeys(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Key.fields['key_id']] ] diff --git a/PLC/Methods/GetNetworkMethods.py b/PLC/Methods/GetNetworkMethods.py index aacfd3c5..c6784474 100644 --- a/PLC/Methods/GetNetworkMethods.py +++ b/PLC/Methods/GetNetworkMethods.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NetworkMethods import NetworkMethod, NetworkMethods -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetNetworkMethods(Method): """ @@ -12,7 +12,7 @@ class GetNetworkMethods(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth() + Auth() ] returns = [NetworkMethod.fields['method']] diff --git a/PLC/Methods/GetNetworkTypes.py b/PLC/Methods/GetNetworkTypes.py index 55af009c..ed6ec881 100644 --- a/PLC/Methods/GetNetworkTypes.py +++ b/PLC/Methods/GetNetworkTypes.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NetworkTypes import NetworkType, NetworkTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetNetworkTypes(Method): """ @@ -12,7 +12,7 @@ class GetNetworkTypes(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth() + Auth() ] returns = [NetworkType.fields['type']] diff --git a/PLC/Methods/GetNodeGroups.py b/PLC/Methods/GetNodeGroups.py index 07af57af..8601a050 100644 --- a/PLC/Methods/GetNodeGroups.py +++ b/PLC/Methods/GetNodeGroups.py @@ -1,7 +1,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.NodeGroups import NodeGroup, NodeGroups class GetNodeGroups(Method): @@ -14,7 +14,7 @@ class GetNodeGroups(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(NodeGroup.fields['nodegroup_id'], NodeGroup.fields['name'])] ] diff --git a/PLC/Methods/GetNodeNetworks.py b/PLC/Methods/GetNodeNetworks.py index fda60a32..e20487fb 100644 --- a/PLC/Methods/GetNodeNetworks.py +++ b/PLC/Methods/GetNodeNetworks.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NodeNetworks import NodeNetwork, NodeNetworks -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetNodeNetworks(Method): """ @@ -14,7 +14,7 @@ class GetNodeNetworks(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(NodeNetwork.fields['nodenetwork_id'], NodeNetwork.fields['ip'])] ] diff --git a/PLC/Methods/GetNodes.py b/PLC/Methods/GetNodes.py index 038aaac7..d552bcd8 100644 --- a/PLC/Methods/GetNodes.py +++ b/PLC/Methods/GetNodes.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetNodes(Method): """ @@ -16,7 +16,7 @@ class GetNodes(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(Node.fields['node_id'], Node.fields['hostname'])], ] diff --git a/PLC/Methods/GetPCUs.py b/PLC/Methods/GetPCUs.py index 6c8731be..881a85f6 100644 --- a/PLC/Methods/GetPCUs.py +++ b/PLC/Methods/GetPCUs.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetPCUs(Method): """ @@ -16,7 +16,7 @@ class GetPCUs(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [PCU.fields['pcu_id']] ] diff --git a/PLC/Methods/GetPersons.py b/PLC/Methods/GetPersons.py index 1ab08c27..ecac4290 100644 --- a/PLC/Methods/GetPersons.py +++ b/PLC/Methods/GetPersons.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetPersons(Method): """ @@ -18,7 +18,7 @@ class GetPersons(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(Person.fields['person_id'], Person.fields['email'])], Parameter([str], 'List of fields to return') diff --git a/PLC/Methods/GetRoles.py b/PLC/Methods/GetRoles.py index df7dce55..9f7e7b10 100644 --- a/PLC/Methods/GetRoles.py +++ b/PLC/Methods/GetRoles.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Roles import Role, Roles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetRoles(Method): """ @@ -12,7 +12,7 @@ class GetRoles(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth() + Auth() ] returns = [Role.fields] diff --git a/PLC/Methods/GetSites.py b/PLC/Methods/GetSites.py index 448fae93..0f0257aa 100644 --- a/PLC/Methods/GetSites.py +++ b/PLC/Methods/GetSites.py @@ -1,6 +1,6 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Sites import Site, Sites class GetSites(Method): @@ -13,7 +13,7 @@ class GetSites(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(Site.fields['site_id'], Site.fields['login_base'])] ] diff --git a/PLC/Methods/GetSliceAttributeTypes.py b/PLC/Methods/GetSliceAttributeTypes.py index 9c92c342..a0db661e 100644 --- a/PLC/Methods/GetSliceAttributeTypes.py +++ b/PLC/Methods/GetSliceAttributeTypes.py @@ -1,6 +1,6 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes class GetSliceAttributeTypes(Method): @@ -13,7 +13,7 @@ class GetSliceAttributeTypes(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(SliceAttributeType.fields['attribute_type_id'], SliceAttributeType.fields['name'])], ] diff --git a/PLC/Methods/GetSliceAttributes.py b/PLC/Methods/GetSliceAttributes.py index a92db989..9a37c934 100644 --- a/PLC/Methods/GetSliceAttributes.py +++ b/PLC/Methods/GetSliceAttributes.py @@ -5,7 +5,7 @@ from PLC.SliceAttributes import SliceAttribute, SliceAttributes from PLC.Sites import Site, Sites from PLC.Slices import Slice, Slices from PLC.Nodes import Node, Nodes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetSliceAttributes(Method): """ @@ -23,7 +23,7 @@ class GetSliceAttributes(Method): roles = ['admin', 'pi', 'user'] accepts = [ - PasswordAuth(), + Auth(), [SliceAttribute.fields['slice_attribute_id']], ] diff --git a/PLC/Methods/GetSlices.py b/PLC/Methods/GetSlices.py index 8560367f..6c870f2d 100644 --- a/PLC/Methods/GetSlices.py +++ b/PLC/Methods/GetSlices.py @@ -1,6 +1,6 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Slices import Slice, Slices class GetSlices(Method): @@ -19,7 +19,7 @@ class GetSlices(Method): roles = ['admin', 'pi', 'user'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(Slice.fields['slice_id'], Slice.fields['name'])] ] diff --git a/PLC/Methods/GetSlivers.py b/PLC/Methods/GetSlivers.py index b870f068..11db4759 100644 --- a/PLC/Methods/GetSlivers.py +++ b/PLC/Methods/GetSlivers.py @@ -3,7 +3,7 @@ import time from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks from PLC.NodeGroups import NodeGroup, NodeGroups @@ -28,7 +28,7 @@ class GetSlivers(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), [Mixed(Node.fields['node_id'], Node.fields['hostname'])] ] diff --git a/PLC/Methods/RebootNode.py b/PLC/Methods/RebootNode.py index 59eb688b..d7b4c837 100644 --- a/PLC/Methods/RebootNode.py +++ b/PLC/Methods/RebootNode.py @@ -5,7 +5,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.POD import udp_pod class RebootNode(Method): @@ -23,7 +23,7 @@ class RebootNode(Method): roles = ['admin', 'pi', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Node.fields['node_id'], Node.fields['hostname']) ] diff --git a/PLC/Methods/SetPersonPrimarySite.py b/PLC/Methods/SetPersonPrimarySite.py index ada63c59..1f7cd39e 100644 --- a/PLC/Methods/SetPersonPrimarySite.py +++ b/PLC/Methods/SetPersonPrimarySite.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class SetPersonPrimarySite(Method): """ @@ -16,7 +16,7 @@ class SetPersonPrimarySite(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), Mixed(Site.fields['site_id'], diff --git a/PLC/Methods/SliceCreate.py b/PLC/Methods/SliceCreate.py index 11a700cf..27b4611e 100644 --- a/PLC/Methods/SliceCreate.py +++ b/PLC/Methods/SliceCreate.py @@ -1,7 +1,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Slices import Slice, Slices from PLC.Methods.AddSlice import AddSlice @@ -13,7 +13,7 @@ class SliceCreate(AddSlice): status = "deprecated" accepts = [ - PasswordAuth(), + Auth(), Slice.fields['name'], AddSlice.accepts[1] ] diff --git a/PLC/Methods/UpdateAddress.py b/PLC/Methods/UpdateAddress.py index c0687b6f..e6b11a3a 100644 --- a/PLC/Methods/UpdateAddress.py +++ b/PLC/Methods/UpdateAddress.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Addresses import Address, Addresses -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['line1', 'line2', 'line3', @@ -23,7 +23,7 @@ class UpdateAddress(Method): address_fields = dict(filter(can_update, Address.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Address.fields['address_id'], address_fields ] diff --git a/PLC/Methods/UpdateAddressType.py b/PLC/Methods/UpdateAddressType.py index 29566800..c4e9d521 100644 --- a/PLC/Methods/UpdateAddressType.py +++ b/PLC/Methods/UpdateAddressType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.AddressTypes import AddressType, AddressTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in ['name', 'description'] @@ -19,7 +19,7 @@ class UpdateAddressType(Method): address_type_fields = dict(filter(can_update, AddressType.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(AddressType.fields['address_type_id'], AddressType.fields['name']), address_type_fields diff --git a/PLC/Methods/UpdateConfFile.py b/PLC/Methods/UpdateConfFile.py index e236ce9f..0963db75 100644 --- a/PLC/Methods/UpdateConfFile.py +++ b/PLC/Methods/UpdateConfFile.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.ConfFiles import ConfFile, ConfFiles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field not in \ ['conf_file_id', 'node_ids', 'nodegroup_ids'] @@ -20,7 +20,7 @@ class UpdateConfFile(Method): conf_file_fields = dict(filter(can_update, ConfFile.fields.items())) accepts = [ - PasswordAuth(), + Auth(), ConfFile.fields['conf_file_id'], conf_file_fields ] diff --git a/PLC/Methods/UpdateKey.py b/PLC/Methods/UpdateKey.py index db32663a..19acbe39 100644 --- a/PLC/Methods/UpdateKey.py +++ b/PLC/Methods/UpdateKey.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Keys import Key, Keys -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['key_type', 'key'] @@ -22,7 +22,7 @@ class UpdateKey(Method): key_fields = dict(filter(can_update, Key.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Key.fields['key_id'], key_fields ] diff --git a/PLC/Methods/UpdateNode.py b/PLC/Methods/UpdateNode.py index 4c2f2846..6c6a21b5 100644 --- a/PLC/Methods/UpdateNode.py +++ b/PLC/Methods/UpdateNode.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['hostname', 'boot_state', 'model', 'version', @@ -24,7 +24,7 @@ class UpdateNode(Method): node_fields = dict(filter(can_update, Node.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(Node.fields['node_id'], Node.fields['hostname']), node_fields diff --git a/PLC/Methods/UpdateNodeGroup.py b/PLC/Methods/UpdateNodeGroup.py index 60882308..6ef1146b 100644 --- a/PLC/Methods/UpdateNodeGroup.py +++ b/PLC/Methods/UpdateNodeGroup.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NodeGroups import NodeGroup, NodeGroups -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['name', 'description'] @@ -19,7 +19,7 @@ class UpdateNodeGroup(Method): nodegroup_fields = dict(filter(can_update, NodeGroup.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(NodeGroup.fields['nodegroup_id'], NodeGroup.fields['name']), nodegroup_fields diff --git a/PLC/Methods/UpdateNodeNetwork.py b/PLC/Methods/UpdateNodeNetwork.py index dc52700c..ca1e91fc 100644 --- a/PLC/Methods/UpdateNodeNetwork.py +++ b/PLC/Methods/UpdateNodeNetwork.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes from PLC.NodeNetworks import NodeNetwork, NodeNetworks -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field not in \ ['nodenetwork_id'] @@ -28,7 +28,7 @@ class UpdateNodeNetwork(Method): nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(NodeNetwork.fields['nodenetwork_id'], NodeNetwork.fields['ip']), nodenetwork_fields diff --git a/PLC/Methods/UpdatePCU.py b/PLC/Methods/UpdatePCU.py index f133af96..5980f0c0 100644 --- a/PLC/Methods/UpdatePCU.py +++ b/PLC/Methods/UpdatePCU.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.PCUs import PCU, PCUs -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field not in \ ['pcu_id', 'site_id'] @@ -22,7 +22,7 @@ class UpdatePCU(Method): update_fields = dict(filter(can_update, PCU.fields.items())) accepts = [ - PasswordAuth(), + Auth(), PCU.fields['pcu_id'], update_fields ] diff --git a/PLC/Methods/UpdatePerson.py b/PLC/Methods/UpdatePerson.py index 4e91a8f0..71c47bfb 100644 --- a/PLC/Methods/UpdatePerson.py +++ b/PLC/Methods/UpdatePerson.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['first_name', 'last_name', 'title', 'email', @@ -25,7 +25,7 @@ class UpdatePerson(Method): person_fields = dict(filter(can_update, Person.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(Person.fields['person_id'], Person.fields['email']), person_fields diff --git a/PLC/Methods/UpdateSite.py b/PLC/Methods/UpdateSite.py index 09d7b139..7f79f090 100644 --- a/PLC/Methods/UpdateSite.py +++ b/PLC/Methods/UpdateSite.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Sites import Site, Sites -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['name', 'abbreviated_name', @@ -25,7 +25,7 @@ class UpdateSite(Method): site_fields = dict(filter(can_update, Site.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(Site.fields['site_id'], Site.fields['login_base']), site_fields diff --git a/PLC/Methods/UpdateSlice.py b/PLC/Methods/UpdateSlice.py index 6d046de1..f6c99432 100644 --- a/PLC/Methods/UpdateSlice.py +++ b/PLC/Methods/UpdateSlice.py @@ -4,7 +4,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Slices import Slice, Slices -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth from PLC.Sites import Site, Sites can_update = lambda (field, value): field in \ @@ -31,7 +31,7 @@ class UpdateSlice(Method): slice_fields = dict(filter(can_update, Slice.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(Slice.fields['slice_id'], Slice.fields['name']), slice_fields diff --git a/PLC/Methods/UpdateSliceAttribute.py b/PLC/Methods/UpdateSliceAttribute.py index 425b7e6d..5557ad0b 100644 --- a/PLC/Methods/UpdateSliceAttribute.py +++ b/PLC/Methods/UpdateSliceAttribute.py @@ -3,7 +3,7 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.SliceAttributes import SliceAttribute, SliceAttributes from PLC.Slices import Slice, Slices -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class UpdateSliceAttribute(Method): """ @@ -20,7 +20,7 @@ class UpdateSliceAttribute(Method): roles = ['admin', 'pi', 'user'] accepts = [ - PasswordAuth(), + Auth(), SliceAttribute.fields['slice_attribute_id'], SliceAttribute.fields['value'] ] diff --git a/PLC/Methods/UpdateSliceAttributeType.py b/PLC/Methods/UpdateSliceAttributeType.py index f1698640..df3224cf 100644 --- a/PLC/Methods/UpdateSliceAttributeType.py +++ b/PLC/Methods/UpdateSliceAttributeType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field in \ ['name', 'description', 'min_role_id'] @@ -20,7 +20,7 @@ class UpdateSliceAttributeType(Method): attribute_type_fields = dict(filter(can_update, SliceAttributeType.fields.items())) accepts = [ - PasswordAuth(), + Auth(), Mixed(SliceAttributeType.fields['attribute_type_id'], SliceAttributeType.fields['name']), attribute_type_fields diff --git a/PLC/Methods/__init__.py b/PLC/Methods/__init__.py index 0f9e3b51..b2d47eaf 100644 --- a/PLC/Methods/__init__.py +++ b/PLC/Methods/__init__.py @@ -1 +1 @@ -methods = 'AddAddressType AddAddressTypeToAddress AddBootState AddConfFile AddConfFileToNodeGroup AddConfFileToNode AddKeyType AddNetworkMethod AddNetworkType AddNodeGroup AddNodeNetwork AddNode AddNodeToNodeGroup AddNodeToPCU AddPCU AddPersonKey AddPerson AddPersonToSite AddPersonToSlice AddRole AddRoleToPerson AddSiteAddress AddSite AddSliceAttribute AddSliceAttributeType AddSlice AddSliceToNodes AdmAddAddressType AdmAddNodeGroup AdmAddNodeNetwork AdmAddNode AdmAddNodeToNodeGroup AdmAddPersonKey AdmAddPerson AdmAddPersonToSite AdmAddSitePowerControlUnit AdmAddSite AdmAssociateNodeToPowerControlUnitPort AdmAuthCheck AdmDeleteAddressType AdmDeleteAllPersonKeys AdmDeleteNodeGroup AdmDeleteNodeNetwork AdmDeleteNode AdmDeletePersonKeys AdmDeletePerson AdmDeleteSitePowerControlUnit AdmDeleteSite AdmDisassociatePowerControlUnitPort AdmGenerateNodeConfFile AdmGetAllAddressTypes AdmGetAllKeyTypes AdmGetAllNodeNetworks AdmGetAllRoles AdmGetNodeGroupNodes AdmGetNodeGroups AdmGetNodes AdmGetPersonKeys AdmGetPersonRoles AdmGetPersonSites AdmGetPersons AdmGetPowerControlUnitNodes AdmGetPowerControlUnits AdmGetSiteNodes AdmGetSitePersons AdmGetSitePIs AdmGetSitePowerControlUnits AdmGetSites AdmGetSiteTechContacts AdmGrantRoleToPerson AdmIsPersonInRole AdmQueryConfFile AdmQueryNode AdmQueryPerson AdmQueryPowerControlUnit AdmQuerySite AdmRebootNode AdmRemoveNodeFromNodeGroup AdmRemovePersonFromSite AdmRevokeRoleFromPerson AdmSetPersonEnabled AdmSetPersonPrimarySite AdmUpdateNodeGroup AdmUpdateNodeNetwork AdmUpdateNode AdmUpdatePerson AdmUpdateSitePowerControlUnit AdmUpdateSite AuthCheck BlacklistKey BootCheckAuthentication BootUpdateNode DeleteAddress DeleteAddressTypeFromAddress DeleteAddressType DeleteBootState DeleteConfFileFromNodeGroup DeleteConfFileFromNode DeleteConfFile DeleteKey DeleteKeyType DeleteNetworkMethod DeleteNetworkType DeleteNodeFromNodeGroup DeleteNodeFromPCU DeleteNodeGroup DeleteNodeNetwork DeleteNode DeletePCU DeletePersonFromSite DeletePersonFromSlice DeletePerson DeleteRoleFromPerson DeleteRole DeleteSite DeleteSliceAttribute DeleteSliceAttributeType DeleteSliceFromNodes DeleteSlice GetAddresses GetAddressTypes GetBootStates GetConfFiles GetEvents GetKeys GetKeyTypes GetNetworkMethods GetNetworkTypes GetNodeGroups GetNodeNetworks GetNodes GetPCUs GetPersons GetRoles GetSites GetSliceAttributes GetSliceAttributeTypes GetSlices GetSlivers RebootNode SetPersonPrimarySite SliceCreate SliceDelete UpdateAddress UpdateAddressType UpdateConfFile UpdateKey UpdateNodeGroup UpdateNodeNetwork UpdateNode UpdatePCU UpdatePerson UpdateSite UpdateSliceAttribute UpdateSliceAttributeType UpdateSlice system.listMethods system.methodHelp system.methodSignature system.multicall'.split() +methods = 'AddAddressType AddAddressTypeToAddress AddBootState AddConfFile AddConfFileToNodeGroup AddConfFileToNode AddKeyType AddNetworkMethod AddNetworkType AddNodeGroup AddNodeNetwork AddNode AddNodeToNodeGroup AddNodeToPCU AddPCU AddPersonKey AddPerson AddPersonToSite AddPersonToSlice AddRole AddRoleToPerson AddSiteAddress AddSite AddSliceAttribute AddSliceAttributeType AddSlice AddSliceToNodes AdmAddAddressType AdmAddNodeGroup AdmAddNodeNetwork AdmAddNode AdmAddNodeToNodeGroup AdmAddPersonKey AdmAddPerson AdmAddPersonToSite AdmAddSitePowerControlUnit AdmAddSite AdmAssociateNodeToPowerControlUnitPort AdmAuthCheck AdmDeleteAddressType AdmDeleteAllPersonKeys AdmDeleteNodeGroup AdmDeleteNodeNetwork AdmDeleteNode AdmDeletePersonKeys AdmDeletePerson AdmDeleteSitePowerControlUnit AdmDeleteSite AdmDisassociatePowerControlUnitPort AdmGenerateNodeConfFile AdmGetAllAddressTypes AdmGetAllKeyTypes AdmGetAllNodeNetworks AdmGetAllRoles AdmGetNodeGroupNodes AdmGetNodeGroups AdmGetNodes AdmGetPersonKeys AdmGetPersonRoles AdmGetPersonSites AdmGetPersons AdmGetPowerControlUnitNodes AdmGetPowerControlUnits AdmGetSiteNodes AdmGetSitePersons AdmGetSitePIs AdmGetSitePowerControlUnits AdmGetSites AdmGetSiteTechContacts AdmGrantRoleToPerson AdmIsPersonInRole AdmQueryConfFile AdmQueryNode AdmQueryPerson AdmQueryPowerControlUnit AdmQuerySite AdmRebootNode AdmRemoveNodeFromNodeGroup AdmRemovePersonFromSite AdmRevokeRoleFromPerson AdmSetPersonEnabled AdmSetPersonPrimarySite AdmUpdateNodeGroup AdmUpdateNodeNetwork AdmUpdateNode AdmUpdatePerson AdmUpdateSitePowerControlUnit AdmUpdateSite AuthCheck BlacklistKey BootCheckAuthentication BootGetNodeDetails BootUpdateNode DeleteAddress DeleteAddressTypeFromAddress DeleteAddressType DeleteBootState DeleteConfFileFromNodeGroup DeleteConfFileFromNode DeleteConfFile DeleteKey DeleteKeyType DeleteNetworkMethod DeleteNetworkType DeleteNodeFromNodeGroup DeleteNodeFromPCU DeleteNodeGroup DeleteNodeNetwork DeleteNode DeletePCU DeletePersonFromSite DeletePersonFromSlice DeletePerson DeleteRoleFromPerson DeleteRole DeleteSession DeleteSite DeleteSliceAttribute DeleteSliceAttributeType DeleteSliceFromNodes DeleteSlice GetAddresses GetAddressTypes GetBootStates GetConfFiles GetEvents GetKeys GetKeyTypes GetNetworkMethods GetNetworkTypes GetNodeGroups GetNodeNetworks GetNodes GetPCUs GetPersons GetRoles GetSession GetSites GetSliceAttributes GetSliceAttributeTypes GetSlices GetSlivers RebootNode SetPersonPrimarySite SliceCreate SliceDelete UpdateAddress UpdateAddressType UpdateConfFile UpdateKey UpdateNodeGroup UpdateNodeNetwork UpdateNode UpdatePCU UpdatePerson UpdateSite UpdateSliceAttribute UpdateSliceAttributeType UpdateSlice system.listMethods system.methodHelp system.methodSignature system.multicall'.split() -- 2.47.0