made vorg be dictionary
This commit is contained in:
@@ -448,20 +448,19 @@ class SAML2Plugin(FormPluginBase):
|
|||||||
def add_metadata(self, environ, identity):
|
def add_metadata(self, environ, identity):
|
||||||
""" Add information to the knowledge I have about the user """
|
""" Add information to the knowledge I have about the user """
|
||||||
subject_id = identity['repoze.who.userid']
|
subject_id = identity['repoze.who.userid']
|
||||||
|
|
||||||
logger = environ.get('repoze.who.logger','')
|
logger = environ.get('repoze.who.logger','')
|
||||||
|
|
||||||
|
_cli = self.saml_client
|
||||||
logger.debug("[add_metadata] for %s" % subject_id)
|
logger.debug("[add_metadata] for %s" % subject_id)
|
||||||
try:
|
try:
|
||||||
logger.debug("Issuers: %s" % self.saml_client.users.sources(
|
logger.debug("Issuers: %s" % _cli.users.sources(subject_id))
|
||||||
subject_id))
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if "user" not in identity:
|
if "user" not in identity:
|
||||||
identity["user"] = {}
|
identity["user"] = {}
|
||||||
try:
|
try:
|
||||||
(ava, _) = self.saml_client.users.get_identity(subject_id)
|
(ava, _) = _cli.users.get_identity(subject_id)
|
||||||
#now = time.gmtime()
|
#now = time.gmtime()
|
||||||
logger.debug("[add_metadata] adds: %s" % ava)
|
logger.debug("[add_metadata] adds: %s" % ava)
|
||||||
identity["user"].update(ava)
|
identity["user"].update(ava)
|
||||||
@@ -470,12 +469,11 @@ class SAML2Plugin(FormPluginBase):
|
|||||||
|
|
||||||
if "pysaml2_vo_expanded" not in identity:
|
if "pysaml2_vo_expanded" not in identity:
|
||||||
# is this a Virtual Organization situation
|
# is this a Virtual Organization situation
|
||||||
for vo in self.saml_client.vorg.values():
|
for vo in _cli.vorg.values():
|
||||||
try:
|
try:
|
||||||
if vo.do_aggregation(subject_id):
|
if vo.do_aggregation(subject_id):
|
||||||
# Get the extended identity
|
# Get the extended identity
|
||||||
identity["user"] = self.saml_client.users.get_identity(
|
identity["user"] = _cli.users.get_identity(subject_id)[0]
|
||||||
subject_id)[0]
|
|
||||||
# Only do this once, mark that the identity has been
|
# Only do this once, mark that the identity has been
|
||||||
# expanded
|
# expanded
|
||||||
identity["pysaml2_vo_expanded"] = 1
|
identity["pysaml2_vo_expanded"] = 1
|
||||||
|
@@ -129,7 +129,7 @@ class Base(object):
|
|||||||
elif isinstance(virtual_organization, VirtualOrg):
|
elif isinstance(virtual_organization, VirtualOrg):
|
||||||
self.vorg = virtual_organization
|
self.vorg = virtual_organization
|
||||||
else:
|
else:
|
||||||
self.vorg = None
|
self.vorg = {}
|
||||||
|
|
||||||
for foo in ["allow_unsolicited", "authn_requests_signed",
|
for foo in ["allow_unsolicited", "authn_requests_signed",
|
||||||
"logout_requests_signed"]:
|
"logout_requests_signed"]:
|
||||||
|
Reference in New Issue
Block a user