-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New overload for token auth accepting supplier #252
- Loading branch information
Showing
3 changed files
with
20 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
namespace Pulsar.Client.Api | ||
|
||
open System | ||
open Microsoft.FSharp.Core | ||
open Pulsar.Client.Auth | ||
|
||
/// Factory class that allows to create Authentication instances for all the supported authentication methods. | ||
[<AbstractClass; Sealed>] | ||
type AuthenticationFactory = | ||
|
||
/// Create an authentication provider for token based authentication. | ||
static member Token (token: string) : Authentication = | ||
DefaultImplementation.newAuthenticationToken token :> Authentication | ||
|
||
/// Create an authentication provider for token based authentication. | ||
static member Token (tokenSupplier: Func<string>) : Authentication = | ||
DefaultImplementation.newAuthenticationTokenSupplier(FuncConvert.FromFunc tokenSupplier) :> Authentication | ||
|
||
/// Create an authentication provider for TLS based authentication. | ||
static member Tls (certFilePath: string) : Authentication = | ||
DefaultImplementation.newAuthenticationTls certFilePath :> Authentication | ||
|
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