mirror of https://github.com/databricks/cli.git
This commit is contained in:
parent
5a1f36e07d
commit
61b2e22f5e
|
@ -35,7 +35,7 @@ var (
|
||||||
// In order to debug CLI running under acceptance test, set this to full subtest name, e.g. "bundle/variables/empty"
|
// In order to debug CLI running under acceptance test, set this to full subtest name, e.g. "bundle/variables/empty"
|
||||||
// Then install your breakpoints and click "debug test" near TestAccept in VSCODE.
|
// Then install your breakpoints and click "debug test" near TestAccept in VSCODE.
|
||||||
// example: var SingleTest = "bundle/variables/empty"
|
// example: var SingleTest = "bundle/variables/empty"
|
||||||
var SingleTest = ""
|
var SingleTest = "auth/basic"
|
||||||
|
|
||||||
// If enabled, instead of compiling and running CLI externally, we'll start in-process server that accepts and runs
|
// If enabled, instead of compiling and running CLI externally, we'll start in-process server that accepts and runs
|
||||||
// CLI commands. The $CLI in test scripts is a helper that just forwards command-line arguments to this server (see bin/callserver.py).
|
// CLI commands. The $CLI in test scripts is a helper that just forwards command-line arguments to this server (see bin/callserver.py).
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"method":"GET","path":"/api/2.0/preview/scim/v2/Me","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"},"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":""}
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
LocalOnly = true
|
LocalOnly = true
|
||||||
|
|
||||||
RecordRequests = true
|
RecordRequests = true
|
||||||
IncludeReqHeaders = ["Authorization", "User-Agent"]
|
IncludeRequestHeaders = ["Authorization", "User-Agent"]
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = '(linux|darwin|windows)'
|
||||||
|
New = '[OS]'
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = " upstream/[A-Za-z0-9.-]+"
|
||||||
|
New = ""
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = " upstream-version/[A-Za-z0-9.-]+"
|
||||||
|
New = ""
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = " cicd/[A-Za-z0-9.-]+"
|
||||||
|
New = ""
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
LocalOnly = true
|
LocalOnly = true
|
||||||
|
|
||||||
RecordRequests = true
|
RecordRequests = true
|
||||||
IncludeReqHeaders = ["Authorization", "User-Agent"]
|
IncludeRequestHeaders = ["Authorization", "User-Agent"]
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = '(linux|darwin|windows)'
|
||||||
|
New = '[OS]'
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = " upstream/[A-Za-z0-9.-]+"
|
||||||
|
New = ""
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = " upstream-version/[A-Za-z0-9.-]+"
|
||||||
|
New = ""
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = " cicd/[A-Za-z0-9.-]+"
|
||||||
|
New = ""
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
LocalOnly = true
|
LocalOnly = true
|
||||||
|
|
||||||
RecordRequests = true
|
RecordRequests = true
|
||||||
IncludeReqHeaders = ["Authorization", "User-Agent"]
|
IncludeRequestHeaders = ["Authorization", "User-Agent"]
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = '(linux|darwin|windows)'
|
||||||
|
New = '[OS]'
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = " upstream/[A-Za-z0-9.-]+"
|
||||||
|
New = ""
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = " upstream-version/[A-Za-z0-9.-]+"
|
||||||
|
New = ""
|
||||||
|
|
||||||
|
[[Repls]]
|
||||||
|
Old = " cicd/[A-Za-z0-9.-]+"
|
||||||
|
New = ""
|
||||||
|
|
|
@ -61,11 +61,21 @@ func (s *Server) Handle(pattern string, handler HandlerFunc) {
|
||||||
headers[k] = v[0]
|
headers[k] = v[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var reqBody any
|
||||||
|
if json.Valid(body) {
|
||||||
|
// If the request body is a valid JSON, typecast it to json.RawMessage.
|
||||||
|
// This way json.Marshal will ignore the body and serialize it
|
||||||
|
// as is, which is what we want because the body is already a JSON.
|
||||||
|
reqBody = json.RawMessage(body)
|
||||||
|
} else {
|
||||||
|
reqBody = body
|
||||||
|
}
|
||||||
|
|
||||||
s.Requests = append(s.Requests, Request{
|
s.Requests = append(s.Requests, Request{
|
||||||
Headers: headers,
|
Headers: headers,
|
||||||
Method: r.Method,
|
Method: r.Method,
|
||||||
Path: r.URL.Path,
|
Path: r.URL.Path,
|
||||||
Body: json.RawMessage(body),
|
Body: reqBody,
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue