File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ export class AuthenticationTls {
186186}
187187
188188export class AuthenticationAthenz {
189- constructor ( params : string | AthenzConfig ) ;
189+ constructor ( params : string | AthenzConfig | AthenzX509Config ) ;
190190}
191191
192192export interface AthenzConfig {
@@ -198,9 +198,22 @@ export interface AthenzConfig {
198198 keyId ?: string ;
199199 principalHeader ?: string ;
200200 roleHeader ?: string ;
201+ caCert ?: string ;
202+ /**
203+ * @deprecated
204+ */
201205 tokenExpirationTime ?: string ;
202206}
203207
208+ export class AthenzX509Config {
209+ providerDomain : string ;
210+ privateKey : string ;
211+ x509CertChain : string ;
212+ ztsUrl : string ;
213+ roleHeader ?: string ;
214+ caCert ?: string ;
215+ }
216+
204217export class AuthenticationToken {
205218 constructor ( params : { token : string } ) ;
206219}
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ import Pulsar = require('./index');
3737 principalHeader : 'Athenz-Principal-Auth' ,
3838 roleHeader : 'Athenz-Role-Auth' ,
3939 tokenExpirationTime : '3600' ,
40+ caCert : 'file:///path/to/cacert.pem' ,
41+ } ) ;
42+
43+ const authAthenz3 : Pulsar . AuthenticationAthenz = new Pulsar . AuthenticationAthenz ( {
44+ providerDomain : 'athenz.provider.domain' ,
45+ privateKey : 'file:///path/to/private.key' ,
46+ ztsUrl : 'https://localhost:8443' ,
47+ roleHeader : 'Athenz-Role-Auth' ,
48+ x509CertChain : 'file:///path/to/x509cert.pem' ,
49+ caCert : 'file:///path/to/cacert.pem' ,
4050 } ) ;
4151
4252 const authOauth2PrivateKey : Pulsar . AuthenticationOauth2 = new Pulsar . AuthenticationOauth2 ( {
You can’t perform that action at this time.
0 commit comments