git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
22f44fa
)
allow this method to be called without a credential
author
Tony Mack
<tmack@cs.princeton.edu>
Mon, 5 Apr 2010 20:56:39 +0000
(20:56 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Mon, 5 Apr 2010 20:56:39 +0000
(20:56 +0000)
sfa/methods/get_trusted_certs.py
patch
|
blob
|
history
diff --git
a/sfa/methods/get_trusted_certs.py
b/sfa/methods/get_trusted_certs.py
index
7c62240
..
c687314
100644
(file)
--- a/
sfa/methods/get_trusted_certs.py
+++ b/
sfa/methods/get_trusted_certs.py
@@
-10,22
+10,32
@@
from sfa.trust.credential import Credential
class get_trusted_certs(Method):
"""
@param cred credential string specifying the rights of the caller
class get_trusted_certs(Method):
"""
@param cred credential string specifying the rights of the caller
- @return
1 is successful, faults otherwise
+ @return
list of gid strings
"""
interfaces = ['registry']
accepts = [
"""
interfaces = ['registry']
accepts = [
- Parameter(str, "Credential string")
+ Mixed(Parameter(str, "Credential string"),
+ Parameter(None, "Credential not specified"))
]
]
- returns = Parameter(
int, "1 if successful
")
+ returns = Parameter(
[str], "List of GID strings
")
- def call(self, cred):
+ def call(self, cred = None):
+ # If cred is not specified just return the gid for this interface.
+ # This is true when when a peer is attempting to initiate federation
+ # with this interface
+ if not cred:
+ gid_strings = []
+ for gid in self.api.auth.trusted_cert_list:
+ if gid.get_hrn() == self.api.config.SFA_INTERFACE_HRN:
+ gid_strings.append[gid.save_to_string(save_parents=True)]
+ return gid_strings
+
# authenticate the cred
self.api.auth.check(cred, 'gettrustedcerts')
# authenticate the cred
self.api.auth.check(cred, 'gettrustedcerts')
-
- trusted_cert_strings = [gid.save_to_string(save_parents=True) for \
+ gid_strings = [gid.save_to_string(save_parents=True) for \
gid in self.api.auth.trusted_cert_list]
gid in self.api.auth.trusted_cert_list]
- return
trusted_cert
_strings
+ return
gid
_strings