Skip to content

Commit

Permalink
[TASKSCLOUD-689] - Deployed new 23.02 version.
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanAndreychikov committed Feb 10, 2023
1 parent e7e54c0 commit 28e6572
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions api/client.go
Expand Up @@ -232,8 +232,13 @@ func (c *APIClient) NewContextWithToken(ctx context.Context) (ctxWithToken conte
ctx = context.Background()
}

tokenUrl, _ := url.Parse(c.cfg.BaseUrl)
tokenUrl.Path = "/connect/token"
var tokenUrl *url.URL
if c.cfg.AuthUrl != "" {
tokenUrl, _ = url.Parse(c.cfg.AuthUrl)
} else {
tokenUrl, _ = url.Parse(c.cfg.BaseUrl)
tokenUrl.Path = "/connect/token"
}

response, err := http.PostForm(tokenUrl.String(), url.Values{
"grant_type": {"client_credentials"},
Expand Down
3 changes: 2 additions & 1 deletion api/models/configuration.go
Expand Up @@ -75,6 +75,7 @@ type Configuration struct {
BaseUrl string `json:"BaseUrl,omitempty"`
AppKey string `json:"AppKey"`
AppSid string `json:"AppSid"`
AuthUrl string `json:"AuthUrl,omitempty"`
DebugMode bool `json:"DebugMode,omitempty"`
DefaultHeader map[string]string `json:"DefaultHeader,omitempty"`
HttpClient *http.Client
Expand All @@ -91,7 +92,7 @@ func NewConfiguration(configFilePath string) (pConfig *Configuration, err error)
cfg := Configuration{
BaseUrl: "https://api.aspose.cloud",
DebugMode: false,
DefaultHeader: map[string]string{"x-aspose-client": "go sdk", "x-aspose-client-version": "22.12"},
DefaultHeader: map[string]string{"x-aspose-client": "go sdk", "x-aspose-client-version": "23.02"},
}
err = json.Unmarshal(data, &cfg)

Expand Down

0 comments on commit 28e6572

Please sign in to comment.