8
8
9
9
"github.com/apache/pulsar-client-go/pulsar"
10
10
"go.opentelemetry.io/collector/component"
11
+ "go.opentelemetry.io/collector/config/configopaque"
11
12
)
12
13
13
14
type Config struct {
@@ -42,17 +43,17 @@ type TLS struct {
42
43
}
43
44
44
45
type Token struct {
45
- Token string `mapstructure:"token"`
46
+ Token configopaque. String `mapstructure:"token"`
46
47
}
47
48
48
49
type 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"`
56
57
}
57
58
58
59
type OAuth2 struct {
@@ -74,7 +75,7 @@ func (cfg *Config) auth() pulsar.Authentication {
74
75
return pulsar .NewAuthenticationTLS (authentication .TLS .CertFile , authentication .TLS .KeyFile )
75
76
}
76
77
if authentication .Token != nil {
77
- return pulsar .NewAuthenticationToken (authentication .Token .Token )
78
+ return pulsar .NewAuthenticationToken (string ( authentication .Token .Token ) )
78
79
}
79
80
if authentication .OAuth2 != nil {
80
81
return pulsar .NewAuthenticationOAuth2 (map [string ]string {
@@ -88,7 +89,7 @@ func (cfg *Config) auth() pulsar.Authentication {
88
89
"providerDomain" : authentication .Athenz .ProviderDomain ,
89
90
"tenantDomain" : authentication .Athenz .TenantDomain ,
90
91
"tenantService" : authentication .Athenz .TenantService ,
91
- "privateKey" : authentication .Athenz .PrivateKey ,
92
+ "privateKey" : string ( authentication .Athenz .PrivateKey ) ,
92
93
"keyId" : authentication .Athenz .KeyID ,
93
94
"principalHeader" : authentication .Athenz .PrincipalHeader ,
94
95
"ztsUrl" : authentication .Athenz .ZtsURL ,
0 commit comments