@@ -14,18 +14,18 @@ import (
1414 "go.uber.org/zap"
1515)
1616
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+ // }
2929
3030// ObtainToken fetches and sets an authentication token using the stored basic authentication credentials.
3131func (c * Client ) ObtainToken (log logger.Logger ) error {
@@ -36,14 +36,14 @@ func (c *Client) ObtainToken(log logger.Logger) error {
3636 // Construct the full authentication endpoint URL
3737 authenticationEndpoint := c .APIHandler .ConstructAPIAuthEndpoint (c .InstanceName , bearerTokenEndpoint , c .Logger )
3838
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 ))
4040
4141 req , err := http .NewRequest ("POST" , authenticationEndpoint , nil )
4242 if err != nil {
4343 log .LogError ("authentication_request_creation_error" , "POST" , authenticationEndpoint , 0 , "" , err , "Failed to create new request for token" )
4444 return err
4545 }
46- req .SetBasicAuth (c .BearerTokenAuthCredentials . Username , c .BearerTokenAuthCredentials .Password )
46+ req .SetBasicAuth (c .clientConfig . Auth . Username , c .clientConfig . Auth .Password )
4747
4848 resp , err := c .httpClient .Do (req )
4949 if err != nil {
0 commit comments