public async Task <string> GetStrSetting(string settingName) { if (string.IsNullOrEmpty(settingName)) { throw new CallerException("Valid Setting Name Required"); } string settingValue = await Cache.Get <string>(GetCacheKey(settingName)); if (settingValue != null) { return(settingValue); } var setting = await GetSetting(settingName); if (setting == null || setting.SettingValue == null) { settingValue = ""; } else { settingValue = setting.SettingValue; } await Cache.Insert(GetCacheKey(settingName), settingValue, new TimeSpan(6, 0, 0)); return(settingValue); }
public async Task<int> ValidateCode(TokenRequest tokenRequest) { var codeData = await Cache.Get<AuthCodeData>(GetCacheKey(tokenRequest.Code)); if (codeData == null) { throw new CallerException("Invalid code"); } await Cache.Remove(GetCacheKey(tokenRequest.Code)); if (codeData.ClientId != tokenRequest.ClientId) { throw new CallerException("Invalid client"); } if (string.IsNullOrEmpty(codeData.CodeChallenge) || string.IsNullOrEmpty(tokenRequest.CodeVerifier)) { throw new CallerException("Missing PKCE info"); } VerifyCode(codeData.CodeChallenge, tokenRequest.CodeVerifier); return codeData.UserId; }
public async Task <string> GetSetting(string settingName) { if (string.IsNullOrEmpty(settingName)) { throw new CallerException("SettingName Cannot Be Blank"); } string settingValue = await Cache.Get <string>(GetCacheKey(settingName)); if (settingValue != null) { return(settingValue); } var settingLogic = new SettingsLogic(Cache, Context); settingValue = await settingLogic.GetStrSetting(settingName); return(settingValue); }
internal async Task <List <SiteList> > GetSiteListsFromCache(bool isAdmin) { var key = GetCacheKey(isAdmin); return(await Cache.Get <List <SiteList> >(key)); }
internal async Task <List <UserRole> > GetUserRolesFromCache(int userId, bool isAdmin) { var key = GetCacheKey(userId, isAdmin); return(await Cache.Get <List <UserRole> >(key)); }
internal async Task <List <SiteListEntry> > GetSiteEntriesFromCache(int listId, bool isAdmin) { var key = GetCacheKey(listId, isAdmin); return(await Cache.Get <List <SiteListEntry> >(key)); }
public async Task <BudgetUser> GetUserFromCache(int userId) { var key = GetCacheKey(userId); return(await Cache.Get <BudgetUser>(key)); }
internal async Task <AppModel> GetAppFromCache(string clientId) { var Key = GetCacheKey(clientId); return(await Cache.Get <AppModel>(Key)); }
internal async Task <Page <UserSearchResponse> > GetSearchResponseFromCache(UserSearch searchOptions) { var key = GetCacheKey(searchOptions); return(await Cache.Get <Page <UserSearchResponse> >(key)); }
public async Task <List <ProfileProperty> > GetProfilePropertiesFromCache(bool requiredOnly, bool isAdmin) { var key = GetCacheKey(requiredOnly, isAdmin); return(await Cache.Get <List <ProfileProperty> >(key)); }
internal async Task <List <Role> > GetRolesFromCache(bool isAdmin) { var Key = GetCacheKey(isAdmin); return(await Cache.Get <List <Role> >(Key)); }
public async Task <List <UserProfileProperty> > GetUserProfilePropertiesFromCache(int userId, bool showAdminProperties) { var key = GetCacheKey(userId, showAdminProperties); return(await Cache.Get <List <UserProfileProperty> >(key)); }