-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create interface for dist metadata cache options
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/Microsoft.IdentityModel.Protocols/Configuration/DistributedMetadataCacheOptions.cs
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,19 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Extensions.Caching.Distributed; | ||
|
||
namespace Microsoft.IdentityModel.Protocols.Configuration | ||
{ | ||
/// <summary> | ||
/// Specifies the DistributedMetadataCacheOptions which can be used to configure the distributed metadata cache. | ||
/// </summary> | ||
public class DistributedMetadataCacheOptions | ||
{ | ||
/// <inheritdoc/> | ||
public IDistributedCache DistributedCache { get; set; } | ||
|
||
/// <inheritdoc/> | ||
public IByteArrayCacheTransformer ByteArrayCacheTransformer { get; set; } | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Microsoft.IdentityModel.Protocols/Configuration/IByteArrayCacheTransformer.cs
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,25 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.IdentityModel.Protocols.Configuration | ||
{ | ||
/// <summary> | ||
/// Interface that defines methods to transform byte arrays before they are written to a cache and after they are retrieved from a cache. | ||
/// </summary> | ||
public interface IByteArrayCacheTransformer | ||
{ | ||
/// <summary> | ||
/// Transform the provided <see cref="byte"/> array before it is written to a cache. | ||
/// </summary> | ||
/// <param name="data">The <see cref="byte"/>s to be transformed.</param> | ||
/// <returns>The result of the transformation.</returns> | ||
byte[] TransformBeforeCaching(byte[] data); | ||
|
||
/// <summary> | ||
/// TRansform the provided <see cref="byte"/> array after it is retrieved from a cache. | ||
/// </summary> | ||
/// <param name="data">The <see cref="byte"/>s to be transformed.</param> | ||
/// <returns>The result of the transformation.</returns> | ||
byte[] TransformAfterRetrieval(byte[] data); | ||
} | ||
} |
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