From: Tony Mack Date: Thu, 10 Jun 2010 20:29:16 +0000 (+0000) Subject: merge with geni_api branch X-Git-Tag: sfa-1.0-0~173 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3cd4cf2cd2b384fd3689681e7708cfc63825eb7c;p=sfa.git merge with geni_api branch --- diff --git a/sfa/trust/credential.py b/sfa/trust/credential.py index 430cffdd..37bec48d 100644 --- a/sfa/trust/credential.py +++ b/sfa/trust/credential.py @@ -709,8 +709,8 @@ class Credential(object): return list ## - # Make sure the credential's target gid was signed by (or is the same) as the entity that signed - # the original credential. + # Make sure the credential's target gid was signed by (or is the same) the entity that signed + # the original credential or an authority over that namespace. def verify_issuer(self): root_cred = self.get_credential_list()[-1] root_target_gid = root_cred.get_gid_object() diff --git a/sfa/util/namespace.py b/sfa/util/namespace.py index 45ce06a7..e898f3ca 100644 --- a/sfa/util/namespace.py +++ b/sfa/util/namespace.py @@ -2,7 +2,6 @@ ### $URL$ from sfa.util.faults import * - URN_PREFIX = "urn:publicid:IDN" def get_leaf(hrn): @@ -75,6 +74,9 @@ def urn_to_hrn(urn): # replace ':' with '.' # join list elements using '.' hrn = '.'.join([part.replace(':', '.') for part in hrn_parts if part]) + + if type == 'authority': + hrn = hrn.replace ('.sa', '') return str(hrn), str(type) @@ -89,6 +91,10 @@ def hrn_to_urn(hrn, type=None): authority = get_authority(hrn) name = get_leaf(hrn) + + if type == 'authority': + authority = hrn + name = 'sa' if authority.startswith("plc"): if type == None: