- def call(self, cred, type, hrn, origin_hrn=None, request_hash=None):
-
- self.api.auth.authenticateCred(cred, [cred, type, hrn], request_hash)
- self.api.auth.check(cred, 'getcredential')
- self.api.auth.verify_object_belongs_to_me(hrn)
- auth_hrn = self.api.auth.get_authority(hrn)
-
- # Is this a root or sub authority
- if not auth_hrn or hrn == self.api.config.SFA_INTERFACE_HRN:
- auth_hrn = hrn
-
- # get record info
- auth_info = self.api.auth.get_auth_info(auth_hrn)
- table = GeniTable()
- records = table.find({'type': type, 'hrn': hrn})
- if not records:
- raise RecordNotFound(hrn)
- record = records[0]
-
- # get the origin caller's gid (this is the caller's gid by default)
- if origin_hrn:
- orgin_records = table.find({'hrn': origin_hrn})
- if not origin_records:
- raise RecordNotFound(origin_hrn)
- origin_record = origin_records[0]
- origin_caller_gid_object = GID(string = record['gid'])
+ def call(self, cred, type, xrn, origin_hrn=None):
+ if type:
+ hrn = urn_to_hrn(xrn)[0]