diff --git a/acceptance/auth/oauth/out.requests.txt b/acceptance/auth/oauth/out.requests.txt index 2234d54b8..25e0fbf3a 100644 --- a/acceptance/auth/oauth/out.requests.txt +++ b/acceptance/auth/oauth/out.requests.txt @@ -1,3 +1,3 @@ {"headers":{"User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS]"},"method":"GET","path":"/oidc/.well-known/oauth-authorization-server","body":""} -{"headers":{"Authorization":"Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS]"},"method":"POST","path":"/oidc/v1/token","body":"Z3JhbnRfdHlwZT1jbGllbnRfY3JlZGVudGlhbHMmc2NvcGU9YWxsLWFwaXM="} +{"headers":{"Authorization":"Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS]"},"method":"POST","path":"/oidc/v1/token","body":"grant_type=client_credentials\u0026scope=all-apis"} {"headers":{"Authorization":"Bearer oauth-token","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/current-user_me cmd-exec-id/[UUID] auth/oauth-m2m"},"method":"GET","path":"/api/2.0/preview/scim/v2/Me","body":""} diff --git a/libs/testserver/server.go b/libs/testserver/server.go index 03db53aa3..42fd5fde3 100644 --- a/libs/testserver/server.go +++ b/libs/testserver/server.go @@ -68,7 +68,9 @@ func (s *Server) Handle(pattern string, handler HandlerFunc) { // as is, which is what we want because the body is already a JSON. reqBody = json.RawMessage(body) } else { - reqBody = body + // JSON marshal encodes []byte to base64. Typecase it to string + // to avoid this. + reqBody = string(body) } s.Requests = append(s.Requests, Request{