diff --git a/atlan/assets/client.go b/atlan/assets/client.go index 3e3fea6..53fff3d 100644 --- a/atlan/assets/client.go +++ b/atlan/assets/client.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/json" "fmt" + "github.com/atlanhq/atlan-go/config" "io" "net/http" "net/url" @@ -108,17 +109,15 @@ func configureClient() (*http.Client, *logger.Logger) { // defaultRequestParams returns default request parameters. func defaultRequestParams(apiKey string) map[string]interface{} { - VERSION := "0.0" headers := map[string]string{ - "x-atlan-agent": "sdk", - "x-atlan-agent-id": "go", - "User-Agent": fmt.Sprintf("Atlan-GOSDK/%s", VERSION), + "x-atlan-agent": "sdk", + "x-atlan-agent-id": "go", + "x-atlan-client-origin": "product_sdk", + "User-Agent": fmt.Sprintf("Atlan-GOSDK/%s", config.Version()), } - headers["Authorization"] = "Bearer " + apiKey headers["Accept"] = "application/json" headers["Content-type"] = "application/json" - return map[string]interface{}{ "headers": headers, } diff --git a/VERSION b/config/VERSION similarity index 100% rename from VERSION rename to config/VERSION diff --git a/config/version.go b/config/version.go new file mode 100644 index 0000000..dbe2e81 --- /dev/null +++ b/config/version.go @@ -0,0 +1,14 @@ +package config + +import ( + _ "embed" + "strings" +) + +//go:embed VERSION +var versionFile string + +// Version returns the SDK version. +func Version() string { + return strings.TrimSpace(versionFile) +}