mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-25 08:21:05 -06:00
908d2eaba4
There were 2 issues with session logouts, one is that the logout_cookie was checked and acted on in the wrong place, the other is that the wrong value was set in the IPASESSION header. Fixes https://fedorahosted.org/freeipa/ticket/6685 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
29 lines
699 B
Python
29 lines
699 B
Python
#
|
|
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
|
#
|
|
|
|
from ipalib import Command
|
|
from ipalib.request import context
|
|
from ipalib.plugable import Registry
|
|
|
|
register = Registry()
|
|
|
|
|
|
@register()
|
|
class session_logout(Command):
|
|
'''
|
|
RPC command used to log the current user out of their session.
|
|
'''
|
|
NO_CLI = True
|
|
|
|
def execute(self, *args, **options):
|
|
ccache_name = getattr(context, 'ccache_name', None)
|
|
if ccache_name is None:
|
|
self.debug('session logout command: no ccache_name found')
|
|
else:
|
|
delattr(context, 'ccache_name')
|
|
|
|
setattr(context, 'logout_cookie', 'MagBearerToken=')
|
|
|
|
return dict(result=None)
|