Skip to content

Commit bd3684b

Browse files
skorandac00kiemon5ter
authored andcommitted
LDAP attribute store add found record to context
Added logic so that the LDAP attribute store will add the found record to the context so that microservices that are called later can use it if so desired.
1 parent 01c0def commit bd3684b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/satosa/micro_services/ldap_attribute_store.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
logger = logging.getLogger(__name__)
2222

23+
KEY_FOUND_LDAP_RECORD = 'ldap_attribute_store_found_record'
24+
2325

2426
class LdapAttributeStoreError(SATOSAError):
2527
"""
@@ -539,6 +541,11 @@ def process(self, context, data):
539541
# hashing of input to create a persistent NameID.
540542
self._populate_input_for_name_id(config, record, context, data)
541543

544+
# Add the record to the context so that later microservices
545+
# may use it if required.
546+
context.decorate(KEY_FOUND_LDAP_RECORD, record)
547+
msg = "Added record {} to context".format(record)
548+
satosa_logging(logger, logging.DEBUG, msg, state)
542549
else:
543550
msg = "No record found in LDAP so no attributes will be added"
544551
satosa_logging(logger, logging.WARN, msg, state)

0 commit comments

Comments
 (0)