-
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.
- Loading branch information
Showing
9 changed files
with
693 additions
and
207 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
237 changes: 166 additions & 71 deletions
237
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
356 changes: 232 additions & 124 deletions
356
test/Microsoft.IdentityModel.Protocols.OpenIdConnect.Tests/ConfigurationManagerTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
215 changes: 215 additions & 0 deletions
215
test/Microsoft.IdentityModel.Protocols.OpenIdConnect.Tests/OpenIdConfigData.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
38 changes: 38 additions & 0 deletions
38
test/Microsoft.IdentityModel.TestUtils/InMemoryDocumentRetriever.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,38 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.IdentityModel.Protocols; | ||
|
||
namespace Microsoft.IdentityModel.TestUtils | ||
{ | ||
/// <summary> | ||
/// Returns a string set in the constructor. | ||
/// Simplifies testing. | ||
/// </summary> | ||
public class InMemoryDocumentRetriever : IDocumentRetriever | ||
{ | ||
private readonly IDictionary<string, string> _configurations; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="FileDocumentRetriever"/> class. | ||
/// </summary> | ||
public InMemoryDocumentRetriever(IDictionary<string, string> configuration) | ||
{ | ||
_configurations = configuration; | ||
} | ||
|
||
/// <summary> | ||
/// Returns the document passed in constructor in dictionary./> | ||
/// </summary> | ||
/// <param name="address">Fully qualified path to a file. Ignored for now.</param> | ||
/// <param name="cancel"><see cref="CancellationToken"/> Ignored for now.</param> | ||
/// <returns>UTF8 decoding of bytes in the file.</returns> | ||
public async Task<string> GetDocumentAsync(string address, CancellationToken cancel) | ||
{ | ||
return await Task.FromResult(_configurations[address]).ConfigureAwait(false); | ||
} | ||
} | ||
} |
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