@@ -14,18 +14,18 @@ import (
14
14
"go.uber.org/zap"
15
15
)
16
16
17
- // BearerTokenAuthCredentials represents the username and password for basic authentication.
18
- type BearerTokenAuthCredentials struct {
19
- Username string
20
- Password string
21
- }
22
-
23
- // SetBearerTokenAuthCredentials sets the BearerTokenAuthCredentials (Username and Password)
24
- // for the client instance. These credentials are used for obtaining and refreshing
25
- // bearer tokens for authentication.
26
- func (c * Client ) SetBearerTokenAuthCredentials (credentials BearerTokenAuthCredentials ) {
27
- c .BearerTokenAuthCredentials = credentials
28
- }
17
+ // // BearerTokenAuthCredentials represents the username and password for basic authentication.
18
+ // type BearerTokenAuthCredentials struct {
19
+ // Username string
20
+ // Password string
21
+ // }
22
+
23
+ // // SetBearerTokenAuthCredentials sets the BearerTokenAuthCredentials (Username and Password)
24
+ // // for the client instance. These credentials are used for obtaining and refreshing
25
+ // // bearer tokens for authentication.
26
+ // func (c *Client) SetBearerTokenAuthCredentials(credentials BearerTokenAuthCredentials) {
27
+ // c.BearerTokenAuthCredentials = credentials
28
+ // }
29
29
30
30
// ObtainToken fetches and sets an authentication token using the stored basic authentication credentials.
31
31
func (c * Client ) ObtainToken (log logger.Logger ) error {
@@ -36,14 +36,14 @@ func (c *Client) ObtainToken(log logger.Logger) error {
36
36
// Construct the full authentication endpoint URL
37
37
authenticationEndpoint := c .APIHandler .ConstructAPIAuthEndpoint (c .InstanceName , bearerTokenEndpoint , c .Logger )
38
38
39
- log .Debug ("Attempting to obtain token for user" , zap .String ("Username" , c .BearerTokenAuthCredentials .Username ))
39
+ log .Debug ("Attempting to obtain token for user" , zap .String ("Username" , c .clientConfig . Auth .Username ))
40
40
41
41
req , err := http .NewRequest ("POST" , authenticationEndpoint , nil )
42
42
if err != nil {
43
43
log .LogError ("authentication_request_creation_error" , "POST" , authenticationEndpoint , 0 , "" , err , "Failed to create new request for token" )
44
44
return err
45
45
}
46
- req .SetBasicAuth (c .BearerTokenAuthCredentials . Username , c .BearerTokenAuthCredentials .Password )
46
+ req .SetBasicAuth (c .clientConfig . Auth . Username , c .clientConfig . Auth .Password )
47
47
48
48
resp , err := c .httpClient .Do (req )
49
49
if err != nil {
0 commit comments