X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=geni%2Futil%2Fhierarchy.py;h=5aa3bc9b433cd734c9418b0e32916424e1cd7b11;hb=01443db1ec49db8612171aa86d0a88f5a4984b7c;hp=a96ec56011edf5560604adf1736e23cf2093cdd0;hpb=2325304b7b67ef1e1d1f3426627a6e9fa99a4651;p=sfa.git diff --git a/geni/util/hierarchy.py b/geni/util/hierarchy.py index a96ec560..5aa3bc9b 100644 --- a/geni/util/hierarchy.py +++ b/geni/util/hierarchy.py @@ -264,15 +264,16 @@ class Hierarchy(): # the authority's parent. # # @param hrn the human readable name of the authority + # @param authority type of credential to return (authority | sa | ma) - def get_auth_cred(self, hrn): + def get_auth_cred(self, hrn, kind="authority"): auth_info = self.get_auth_info(hrn) gid = auth_info.get_gid_object() cred = Credential(subject=hrn) cred.set_gid_caller(gid) cred.set_gid_object(gid) - cred.set_privileges("authority") + cred.set_privileges(kind) cred.set_delegate(True) cred.set_pubkey(auth_info.get_gid_object().get_pubkey()) @@ -285,7 +286,7 @@ class Hierarchy(): # we need the parent's private key in order to sign this GID parent_auth_info = self.get_auth_info(parent_hrn) cred.set_issuer(parent_auth_info.get_pkey_object(), parent_auth_info.hrn) - cred.set_parent(self.get_auth_cred(parent_hrn)) + cred.set_parent(self.get_auth_cred(parent_hrn, kind)) cred.encode() cred.sign()