generated from Kentico/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Kentico/feat/1PhaseCRfixes
1st phase CR fixes
- Loading branch information
Showing
19 changed files
with
533 additions
and
503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using CMS.Helpers; | ||
using Kentico.Integration.Zapier; | ||
|
||
namespace Kentico.Xperience.Zapier; | ||
|
||
|
||
public interface IApiKeyCachedService | ||
{ | ||
string? GetApiKeyToken(); | ||
} | ||
|
||
public class ApiKeyCachedService : IApiKeyCachedService | ||
{ | ||
private readonly IProgressiveCache progressiveCache; | ||
private readonly IApiKeyInfoProvider apiKeyInfoProvider; | ||
|
||
public ApiKeyCachedService(IProgressiveCache progressiveCache, IApiKeyInfoProvider apiKeyInfoProvider) | ||
{ | ||
this.progressiveCache = progressiveCache; | ||
this.apiKeyInfoProvider = apiKeyInfoProvider; | ||
} | ||
|
||
public string? GetApiKeyToken() | ||
{ | ||
var data = progressiveCache.Load(cacheSettings => | ||
{ | ||
var result = apiKeyInfoProvider.Get().FirstOrDefault(); | ||
cacheSettings.CacheDependency = CacheHelper.GetCacheDependency($"{ApiKeyInfo.OBJECT_TYPE}|all"); | ||
return result; | ||
}, new CacheSettings(TimeSpan.FromHours(1).TotalMinutes, $"{ApiKeyInfo.OBJECT_TYPE}-resultstring")); | ||
|
||
return data?.ApiKeyToken; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/Kentico.Xperience.Zapier/Resources/Localization.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.