Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Chore: Moved universalAuthLogin function to utils

Daniel Hougaard13629223fb16
diff --git a/cli/packages/cmd/agent.go b/cli/packages/cmd/agent.go
index 80f3213962..d32afa9867 100644
--- a/cli/packages/cmd/agent.go
+++ b/cli/packages/cmd/agent.go
@@ -509,7 +509,7 @@ func (tm *AgentManager) FetchNewAccessToken() error {
// save as cache in memory
tm.cachedClientSecret = clientSecret
- err, loginResponse := universalAuthLogin(clientID, clientSecret)
+ loginResponse, err := util.UniversalAuthLogin(clientID, clientSecret)
if err != nil {
return err
}
@@ -725,20 +725,6 @@ func (tm *AgentManager) MonitorSecretChanges(secretTemplate Template, templateId
}
}
-func universalAuthLogin(clientId string, clientSecret string) (error, api.UniversalAuthLoginResponse) {
- httpClient := resty.New()
- httpClient.SetRetryCount(10000).
- SetRetryMaxWaitTime(20 * time.Second).
- SetRetryWaitTime(5 * time.Second)
-
- tokenResponse, err := api.CallUniversalAuthLogin(httpClient, api.UniversalAuthLoginRequest{ClientId: clientId, ClientSecret: clientSecret})
- if err != nil {
- return err, api.UniversalAuthLoginResponse{}
- }
-
- return nil, tokenResponse
-}
-
// runCmd represents the run command
var agentCmd = &cobra.Command{
Example: `