-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin configuration methods are now public.
added base classes for authN and authZ. removed Log dependency from authN provider factory.
- Loading branch information
1 parent
eca0063
commit 3a35e89
Showing
6 changed files
with
62 additions
and
12 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/EventStore.Plugins/Authentication/AuthenticationProviderBase.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,29 @@ | ||
using Microsoft.AspNetCore.Routing; | ||
|
||
namespace EventStore.Plugins.Authentication; | ||
|
||
public abstract class AuthenticationProviderBase(PluginOptions options) : Plugin(options), IAuthenticationProvider { | ||
protected AuthenticationProviderBase( | ||
string? name = null, | ||
string? version = null, | ||
string? licensePublicKey = null, | ||
string? diagnosticsName = null, | ||
params KeyValuePair<string, object?>[] diagnosticsTags | ||
) : this(new() { | ||
Name = name, | ||
Version = version, | ||
LicensePublicKey = licensePublicKey, | ||
DiagnosticsName = diagnosticsName, | ||
DiagnosticsTags = diagnosticsTags | ||
}) { } | ||
|
||
public virtual Task Initialize() => Task.CompletedTask; | ||
|
||
public abstract void Authenticate(AuthenticationRequest authenticationRequest); | ||
|
||
public virtual IEnumerable<KeyValuePair<string, string>> GetPublicProperties() => []; | ||
|
||
public virtual void ConfigureEndpoints(IEndpointRouteBuilder endpointRouteBuilder) { } | ||
|
||
public virtual IReadOnlyList<string> GetSupportedAuthenticationSchemes() => []; | ||
} |
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
21 changes: 21 additions & 0 deletions
21
src/EventStore.Plugins/Authorization/AuthorizationProviderBase.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,21 @@ | ||
using System.Security.Claims; | ||
|
||
namespace EventStore.Plugins.Authorization; | ||
|
||
public abstract class AuthorizationProviderBase(PluginOptions options) : Plugin(options), IAuthorizationProvider { | ||
protected AuthorizationProviderBase( | ||
string? name = null, | ||
string? version = null, | ||
string? licensePublicKey = null, | ||
string? diagnosticsName = null, | ||
params KeyValuePair<string, object?>[] diagnosticsTags | ||
) : this(new() { | ||
Name = name, | ||
Version = version, | ||
LicensePublicKey = licensePublicKey, | ||
DiagnosticsName = diagnosticsName, | ||
DiagnosticsTags = diagnosticsTags | ||
}) { } | ||
|
||
public abstract ValueTask<bool> CheckAccessAsync(ClaimsPrincipal principal, Operation operation, CancellationToken cancellationToken); | ||
} |
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