File tree Expand file tree Collapse file tree 3 files changed +7
-35
lines changed
Expand file tree Collapse file tree 3 files changed +7
-35
lines changed Original file line number Diff line number Diff line change @@ -14,19 +14,6 @@ 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- // }
29-
3017// ObtainToken fetches and sets an authentication token using the stored basic authentication credentials.
3118func (c * Client ) ObtainToken (log logger.Logger ) error {
3219
Original file line number Diff line number Diff line change @@ -26,19 +26,6 @@ type OAuthResponse struct {
2626 Error string `json:"error,omitempty"`
2727}
2828
29- // // OAuthCredentials contains the client ID and client secret required for OAuth authentication.
30- // type OAuthCredentials struct {
31- // ClientID string
32- // ClientSecret string
33- // }
34-
35- // // SetOAuthCredentials sets the OAuth credentials (Client ID and Client Secret)
36- // // for the client instance. These credentials are used for obtaining and refreshing
37- // // OAuth tokens for authentication.
38- // func (c *Client) SetOAuthCredentials(credentials OAuthCredentials) {
39- // c.OAuthCredentials = credentials
40- // }
41-
4229// ObtainOAuthToken fetches an OAuth access token using the provided OAuthCredentials (Client ID and Client Secret).
4330// It updates the client's Token and Expiry fields with the obtained values.
4431func (c * Client ) ObtainOAuthToken (credentials AuthConfig ) error {
Original file line number Diff line number Diff line change @@ -24,15 +24,13 @@ type Client struct {
2424 AuthMethod string // Specifies the authentication method: "bearer" or "oauth"
2525 Token string // Authentication Token
2626 OverrideBaseDomain string // Base domain override used when the default in the api handler isn't suitable
27- //OAuthCredentials OAuthCredentials // ClientID / Client Secret
28- //BearerTokenAuthCredentials BearerTokenAuthCredentials // Username and Password for Basic Authentication
29- Expiry time.Time // Expiry time set for the auth token
30- httpClient * http.Client
31- tokenLock sync.Mutex
32- clientConfig ClientConfig
33- Logger logger.Logger
34- ConcurrencyMgr * ConcurrencyManager
35- PerfMetrics PerformanceMetrics
27+ Expiry time.Time // Expiry time set for the auth token
28+ httpClient * http.Client
29+ tokenLock sync.Mutex
30+ clientConfig ClientConfig
31+ Logger logger.Logger
32+ ConcurrencyMgr * ConcurrencyManager
33+ PerfMetrics PerformanceMetrics
3634}
3735
3836// Config holds configuration options for the HTTP Client.
You can’t perform that action at this time.
0 commit comments