MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestAccountAuthContractOmitsSensitiveFields

Function TestAccountAuthContractOmitsSensitiveFields

cmd/json_contract_test.go:177–190  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

175}
176
177func TestAccountAuthContractOmitsSensitiveFields(t *testing.T) {
178 example := jsonGoldenSuccessOutputExamples()["account"]
179 encoded, err := json.Marshal(example)
180 if err != nil {
181 t.Fatal(err)
182 }
183
184 payload := string(encoded)
185 for _, forbidden := range []string{"access_token", "refresh_token", "app_key", "auth.json", ".config"} {
186 if strings.Contains(payload, forbidden) {
187 t.Fatalf("account JSON contains %q: %s", forbidden, payload)
188 }
189 }
190}
191
192func TestPublicJSONSchemaFiles(t *testing.T) {
193 tests := []struct {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected