Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,13 @@ export class AuthenticationToken {
export class AuthenticationOauth2 {
constructor(params: {
type: string;
tokenEndpointAuthMethod?: 'client_secret_post' | 'tls_client_auth';
issuer_url: string;
client_id?: string;
client_secret?: string;
private_key?: string;
tls_cert_file?: string;
tls_key_file?: string;
audience?: string;
scope?: string;
});
Expand Down
10 changes: 10 additions & 0 deletions tstest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ import Pulsar = require('./index');
scope: "scope"
});

const authOauth2Tls: Pulsar.AuthenticationOauth2 = new Pulsar.AuthenticationOauth2({
type: "client_credentials",
tokenEndpointAuthMethod: "tls_client_auth",
issuer_url: "issuer-url",
tls_cert_file: "certificate-file-path",
tls_key_file: "private-key-file-path",
audience: "audience",
scope: "scope"
});

const authToken: Pulsar.AuthenticationToken = new Pulsar.AuthenticationToken({
token: async () => {
return 'foobar';
Expand Down
Loading