from sfa.trust.hierarchy import Hierarchy
from sfa.trust.gid import create_uuid
from sfa.storage.persistentobjs import RegRecord, RegAuthority, RegUser
-from sfa.storage.persistentobjs import RegAuthoritySa, RegAuthorityAm, RegAuthoritySm
from sfa.storage.alchemy import dbsession
def _un_unicode(str):
# create the db record if it doesnt already exist
auth_info = self.AuthHierarchy.get_auth_info(hrn)
auth_record = RegAuthority()
+ auth_record.type='authority'
auth_record.hrn=hrn
auth_record.gid=auth_info.get_gid_object()
auth_record.authority=get_authority(hrn)
auth_info = self.AuthHierarchy.get_auth_info(hrn)
user_record = RegUser()
+ user_record.type='user'
user_record.hrn=hrn
user_record.gid=auth_info.get_gid_object()
user_record.authority=get_authority(hrn)
# just create certs for all sfa interfaces even if they
# aren't enabled
hrn = self.config.SFA_INTERFACE_HRN
- reg_classes_info = [ (RegAuthoritySa, 'authority+sa'),
- (RegAuthorityAm, 'authority+am'),
- (RegAuthoritySm, 'authority+sm'), ]
auth_info = self.AuthHierarchy.get_auth_info(hrn)
pkey = auth_info.get_pkey_object()
- for (reg_class, type) in reg_classes_info:
+ for type in [ 'authority+sa', 'authority+am', 'authority+sm', ]:
urn = hrn_to_urn(hrn, type)
gid = self.AuthHierarchy.create_gid(urn, create_uuid(), pkey)
# xxx this should probably use a RegAuthority, or a to-be-defined RegPeer object
# but for now we have to preserve the authority+<> stuff
- interface_record = reg_class()
+ interface_record = RegAuthority()
+ interface_record.type=type
interface_record.hrn=hrn
interface_record.gid= gid
interface_record.authority=get_authority(hrn)