Skip to content

Commit 0561d53

Browse files
Add string method to kerberos AuthType (#47687) (#47695)
(cherry picked from commit d4ec033) Co-authored-by: Khushi Jain <[email protected]>
1 parent f5e8322 commit 0561d53

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

libbeat/common/transport/kerberos/config.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ var (
3939
authPasswordStr: authPassword,
4040
authKeytabStr: authKeytab,
4141
}
42+
43+
authTypeInverse = map[AuthType]string{
44+
authPassword: authPasswordStr,
45+
authKeytab: authKeytabStr,
46+
}
4247
)
4348

4449
type Config struct {
@@ -69,3 +74,7 @@ func (t *AuthType) Unpack(value string) error {
6974

7075
return nil
7176
}
77+
78+
func (t *AuthType) String() string {
79+
return authTypeInverse[*t]
80+
}

x-pack/otel/extension/beatsauthextension/authenticator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func getHttpClient(a *authenticator) (roundTripperProvider, error) {
126126
return nil, fmt.Errorf("failed creating config: %w", err)
127127
}
128128

129-
beatAuthConfig := esAuthConfig{}
129+
beatAuthConfig := BeatsAuthConfig{}
130130
err = parsedCfg.Unpack(&beatAuthConfig)
131131
if err != nil {
132132
return nil, fmt.Errorf("failed unpacking config: %w", err)

x-pack/otel/extension/beatsauthextension/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type Config struct {
1616
ContinueOnError bool `mapstructure:"continue_on_error"`
1717
}
1818

19-
type esAuthConfig struct {
19+
type BeatsAuthConfig struct {
2020
Kerberos *kerberos.Config `config:"kerberos"`
2121
Transport httpcommon.HTTPTransportSettings `config:",inline"`
2222
}

0 commit comments

Comments
 (0)