diff --git a/acceptance/auth/basic/out.requests.txt b/acceptance/auth/basic/out.requests.txt index 0d005d5e6..abeefabb2 100644 --- a/acceptance/auth/basic/out.requests.txt +++ b/acceptance/auth/basic/out.requests.txt @@ -1 +1 @@ -{"headers":{"Authorization":"Basic dXNlcm5hbWU6cGFzc3dvcmQ=","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/current-user_me cmd-exec-id/[UUID] auth/basic"},"method":"GET","path":"/api/2.0/preview/scim/v2/Me","body":""} +{"headers":{"Authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="],"User-Agent":["cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/current-user_me cmd-exec-id/[UUID] auth/basic"]},"method":"GET","path":"/api/2.0/preview/scim/v2/Me","body":""} diff --git a/acceptance/auth/oauth/out.requests.txt b/acceptance/auth/oauth/out.requests.txt index 25e0fbf3a..b090b4ef2 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":"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":""} +{"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":"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/acceptance/auth/pat/out.requests.txt b/acceptance/auth/pat/out.requests.txt index cb1a8d4dd..3268cf813 100644 --- a/acceptance/auth/pat/out.requests.txt +++ b/acceptance/auth/pat/out.requests.txt @@ -1 +1 @@ -{"headers":{"Authorization":"Bearer dapi1234","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/current-user_me cmd-exec-id/[UUID] auth/pat"},"method":"GET","path":"/api/2.0/preview/scim/v2/Me","body":""} +{"headers":{"Authorization":["Bearer dapi1234"],"User-Agent":["cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/current-user_me cmd-exec-id/[UUID] auth/pat"]},"method":"GET","path":"/api/2.0/preview/scim/v2/Me","body":""} diff --git a/acceptance/server_test.go b/acceptance/server_test.go index 556a4a1d8..19d46d1e6 100644 --- a/acceptance/server_test.go +++ b/acceptance/server_test.go @@ -162,14 +162,14 @@ func AddHandlers(server *testserver.Server) { return fakeWorkspace.JobsList() }) - server.Handle("GET /oidc/.well-known/oauth-authorization-server", func(r *http.Request) (any, int) { + server.Handle("GET /oidc/.well-known/oauth-authorization-server", func(fakeWorkspace *testserver.FakeWorkspace, r *http.Request) (any, int) { return map[string]string{ "authorization_endpoint": server.URL + "oidc/v1/authorize", "token_endpoint": server.URL + "/oidc/v1/token", }, http.StatusOK }) - server.Handle("POST /oidc/v1/token", func(r *http.Request) (any, int) { + server.Handle("POST /oidc/v1/token", func(fakeWorkspace *testserver.FakeWorkspace, r *http.Request) (any, int) { return map[string]string{ "access_token": "oauth-token", "expires_in": "3600",