Re: [Spacewalk-devel] [PATCH] spacecmd: Fix session validation

2013-10-02 Thread Michael Mraka
David Juran wrote:
% Turns out that although spacewalk (Red Hat Satellite 5.5) takes a
% session argument for the api.getApiNamespaces() API call, this session is not
% validated, i.e. the call will succeed no matter if the session is
% valid or not. Which makes this particular call quite a bad choice
% validating the session... Trying now to use user.listAssignableRoles
% instead

Hi David,

fix commited.

Thanks.

--
Michael Mráka
Satellite Engineering, Red Hat

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] spacecmd: Fix session validation

2013-10-01 Thread David Juran

Turns out that although spacewalk (Red Hat Satellite 5.5) takes a
session argument for the api.getApiNamespaces() API call, this session is not
validated, i.e. the call will succeed no matter if the session is
valid or not. Which makes this particular call quite a bad choice
validating the session... Trying now to use user.listAssignableRoles
instead
---
 spacecmd/src/lib/misc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index dff6fb3..f2769d5 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -307,7 +307,7 @@ def do_login(self, args):
 try:
 logging.debug('Using cached credentials from %s' % session_file)
 
-self.client.api.getApiNamespaces(self.session)
+self.client.user.listAssignableRoles(self.session)
 except:
 logging.warning('Cached credentials are invalid')
 self.current_user = ''
-- 
1.8.3.1

-- 
David Juran
Sr. Consultant
Red Hat
+46-725-345801

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel