88
99 "github.com/apache/pulsar-client-go/pulsar"
1010 "go.opentelemetry.io/collector/component"
11+ "go.opentelemetry.io/collector/config/configopaque"
1112)
1213
1314type Config struct {
@@ -42,17 +43,17 @@ type TLS struct {
4243}
4344
4445type Token struct {
45- Token string `mapstructure:"token"`
46+ Token configopaque. String `mapstructure:"token"`
4647}
4748
4849type Athenz struct {
49- ProviderDomain string `mapstructure:"provider_domain"`
50- TenantDomain string `mapstructure:"tenant_domain"`
51- TenantService string `mapstructure:"tenant_service"`
52- PrivateKey string `mapstructure:"private_key"`
53- KeyID string `mapstructure:"key_id"`
54- PrincipalHeader string `mapstructure:"principal_header"`
55- ZtsURL string `mapstructure:"zts_url"`
50+ ProviderDomain string `mapstructure:"provider_domain"`
51+ TenantDomain string `mapstructure:"tenant_domain"`
52+ TenantService string `mapstructure:"tenant_service"`
53+ PrivateKey configopaque. String `mapstructure:"private_key"`
54+ KeyID string `mapstructure:"key_id"`
55+ PrincipalHeader string `mapstructure:"principal_header"`
56+ ZtsURL string `mapstructure:"zts_url"`
5657}
5758
5859type OAuth2 struct {
@@ -74,7 +75,7 @@ func (cfg *Config) auth() pulsar.Authentication {
7475 return pulsar .NewAuthenticationTLS (authentication .TLS .CertFile , authentication .TLS .KeyFile )
7576 }
7677 if authentication .Token != nil {
77- return pulsar .NewAuthenticationToken (authentication .Token .Token )
78+ return pulsar .NewAuthenticationToken (string ( authentication .Token .Token ) )
7879 }
7980 if authentication .OAuth2 != nil {
8081 return pulsar .NewAuthenticationOAuth2 (map [string ]string {
@@ -88,7 +89,7 @@ func (cfg *Config) auth() pulsar.Authentication {
8889 "providerDomain" : authentication .Athenz .ProviderDomain ,
8990 "tenantDomain" : authentication .Athenz .TenantDomain ,
9091 "tenantService" : authentication .Athenz .TenantService ,
91- "privateKey" : authentication .Athenz .PrivateKey ,
92+ "privateKey" : string ( authentication .Athenz .PrivateKey ) ,
9293 "keyId" : authentication .Athenz .KeyID ,
9394 "principalHeader" : authentication .Athenz .PrincipalHeader ,
9495 "ztsUrl" : authentication .Athenz .ZtsURL ,
0 commit comments