-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
1 parent
71ed7d3
commit 1332212
Showing
5 changed files
with
131 additions
and
119 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
47 changes: 47 additions & 0 deletions
47
test/Swashbuckle.AspNetCore.SwaggerGen.Test/Fixtures/FakeAuthenticationSchemeProvider.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,47 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Authentication; | ||
|
||
namespace Swashbuckle.AspNetCore.SwaggerGen.Test | ||
{ | ||
public class FakeAuthenticationSchemeProvider : IAuthenticationSchemeProvider | ||
{ | ||
private readonly IEnumerable<AuthenticationScheme> _authenticationSchemes; | ||
|
||
public FakeAuthenticationSchemeProvider(IEnumerable<AuthenticationScheme> authenticationSchemes) | ||
{ | ||
_authenticationSchemes = authenticationSchemes; | ||
} | ||
|
||
public void AddScheme(AuthenticationScheme scheme) | ||
=> throw new NotImplementedException(); | ||
public Task<IEnumerable<AuthenticationScheme>> GetAllSchemesAsync() | ||
=> Task.FromResult(_authenticationSchemes); | ||
|
||
public Task<AuthenticationScheme> GetDefaultAuthenticateSchemeAsync() | ||
=> Task.FromResult(_authenticationSchemes.First()); | ||
|
||
public Task<AuthenticationScheme> GetDefaultChallengeSchemeAsync() | ||
=> Task.FromResult(_authenticationSchemes.First()); | ||
|
||
public Task<AuthenticationScheme> GetDefaultForbidSchemeAsync() | ||
=> Task.FromResult(_authenticationSchemes.First()); | ||
|
||
public Task<AuthenticationScheme> GetDefaultSignInSchemeAsync() | ||
=> Task.FromResult(_authenticationSchemes.First()); | ||
|
||
public Task<AuthenticationScheme> GetDefaultSignOutSchemeAsync() | ||
=> Task.FromResult(_authenticationSchemes.First()); | ||
|
||
public Task<IEnumerable<AuthenticationScheme>> GetRequestHandlerSchemesAsync() | ||
=> throw new NotImplementedException(); | ||
|
||
public Task<AuthenticationScheme> GetSchemeAsync(string name) | ||
=> Task.FromResult(_authenticationSchemes.First()); | ||
|
||
public void RemoveScheme(string name) | ||
=> throw new NotImplementedException(); | ||
} | ||
} |
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