Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API token URL generation #547

Merged
merged 2 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion govcd/api_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ func (vcdClient *VCDClient) GetBearerTokenFromApiToken(org, token string) (*type
return nil, fmt.Errorf("minimum API version for API token is 36.1 - Version detected: %s", vcdClient.Client.APIVersion)
}
var userDef string
urlStr := strings.Replace(vcdClient.Client.VCDHREF.String(), "/api", "", 1)
newUrl := new(url.URL)
newUrl.Scheme = vcdClient.Client.VCDHREF.Scheme
newUrl.Host = vcdClient.Client.VCDHREF.Host
urlStr := newUrl.String()
if strings.EqualFold(org, "system") {
userDef = "provider"
} else {
Expand Down
2 changes: 1 addition & 1 deletion scripts/staticcheck-config.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export STATICCHECK_URL=https://github.com/dominikh/go-tools/releases/download
export STATICCHECK_VERSION=v0.3.3
export STATICCHECK_VERSION=2023.1
export STATICCHECK_FILE=staticcheck_linux_amd64.tar.gz