MCPcopy Index your code
hub / github.com/cloudquery/cloudquery / sessionWithPluginVersion

Function sessionWithPluginVersion

cli/internal/platform/inject_test.go:546–557  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

544}
545
546func sessionWithPluginVersion(version string) func(http.ResponseWriter, *http.Request) {
547 return func(w http.ResponseWriter, _ *http.Request) {
548 w.Header().Set("Content-Type", "application/json")
549 w.WriteHeader(http.StatusCreated)
550 _ = json.NewEncoder(w).Encode(map[string]any{
551 "token": "cqpd_payload.sig",
552 "api_url": "https://x.us.platform.cloudquery.io",
553 "expires_in_seconds": 604800,
554 "plugin_version": version,
555 })
556 }
557}
558
559func TestInject_PlatformPinnedVersion(t *testing.T) {
560 srv := fakeCloud(t, nil, sessionWithPluginVersion("v2.5.0"))

Calls 2

SetMethod · 0.45
HeaderMethod · 0.45

Tested by

no test coverage detected