From 6840fbb96c25dee846aa8280e8e79e4e4cd4210a Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 2 Nov 2012 15:29:02 -0400 Subject: [PATCH] added methods for supporting SAML2 persistence --- SoObjects/SOGo/SOGoCache.h | 5 +++++ SoObjects/SOGo/SOGoCache.m | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/SoObjects/SOGo/SOGoCache.h b/SoObjects/SOGo/SOGoCache.h index 663c7934d..b1277937b 100644 --- a/SoObjects/SOGo/SOGoCache.h +++ b/SoObjects/SOGo/SOGoCache.h @@ -111,6 +111,11 @@ - (void) setCASPGTId: (NSString *) pgtId forPGTIOU: (NSString *) pgtIou; +// SAML2 support +- (NSDictionary *) saml2LoginDumpsForIdentifier: (NSString *) identifier; +- (void) setSaml2LoginDumps: (NSDictionary *) dump + forIdentifier: (NSString *) identifier; + // // ACL caching support // diff --git a/SoObjects/SOGo/SOGoCache.m b/SoObjects/SOGo/SOGoCache.m index 7ede34230..e815224e1 100644 --- a/SoObjects/SOGo/SOGoCache.m +++ b/SoObjects/SOGo/SOGoCache.m @@ -520,6 +520,27 @@ static memcached_st *handle = NULL; forKey: [NSString stringWithFormat: @"cas-pgtiou:%@", pgtIou]]; } +// SAML2 support +- (NSDictionary *) saml2LoginDumpsForIdentifier: (NSString *) identifier +{ + NSString *key, *jsonString; + + key = [NSString stringWithFormat: @"saml2-login:%@", identifier]; + jsonString = [self valueForKey: key]; + + return [jsonString objectFromJSONString]; +} + +- (void) setSaml2LoginDumps: (NSDictionary *) dump + forIdentifier: (NSString *) identifier +{ + NSString *key; + + key = [NSString stringWithFormat: @"saml2-login:%@", identifier]; + + [self setValue: [dump jsonRepresentation] forKey: key]; +} + // // ACL caching code //