diff --git a/index.d.ts b/index.d.ts index 3cf4a1b..160fd52 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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; }); diff --git a/tstest.ts b/tstest.ts index 5b1a85f..c58f660 100644 --- a/tstest.ts +++ b/tstest.ts @@ -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';