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:
0f9ef89
)
check xrns arg at beginning of method
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 17 Jan 2013 19:58:35 +0000
(14:58 -0500)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 17 Jan 2013 19:58:35 +0000
(14:58 -0500)
sfa/trust/auth.py
patch
|
blob
|
history
diff --git
a/sfa/trust/auth.py
b/sfa/trust/auth.py
index
da7e91f
..
4eedb09
100644
(file)
--- a/
sfa/trust/auth.py
+++ b/
sfa/trust/auth.py
@@
-36,6
+36,13
@@
class Auth:
self.trusted_cert_file_list = TrustedRoots(self.config.get_trustedroots_dir()).get_file_list()
def checkCredentials(self, creds, operation, xrns=[], check_sliver_callback=None):
self.trusted_cert_file_list = TrustedRoots(self.config.get_trustedroots_dir()).get_file_list()
def checkCredentials(self, creds, operation, xrns=[], check_sliver_callback=None):
+ # if xrns are specified they cannot be None or empty string
+ if xrns:
+ for xrn in xrns:
+ if not xrn:
+ raise BadArgs("Invalid urn or hrn: %s" % hrn)
+
+
if not isinstance(xrns, list):
xrns = [xrns]
if not isinstance(xrns, list):
xrns = [xrns]
@@
-54,10
+61,6
@@
class Auth:
if not hrns: hrns = [None]
for cred in creds:
for hrn in hrns:
if not hrns: hrns = [None]
for cred in creds:
for hrn in hrns:
- # if an hrn is specified it cannot be None or empty string
- if not hrn:
- raise BadArgs("Invalid urn or hrn: %s" % hrn)
-
try:
self.check(cred, operation, hrn)
valid.append(cred)
try:
self.check(cred, operation, hrn)
valid.append(cred)