teleport/integration
Andrew Lytvynov cd2f4fceb7
Remove JSON schema validation (#6685)
* Remove JSON schema validation

Removing JSON schema validation from all resource unmarshalers.

--- what JSON schema gets us

Looking at the JSON schema spec and our usage, here are the supposed benefits:
- type validation - make sure incoming data uses the right types for the right fields
- required fields - make sure that mandatory fields are set
- defaulting - set defaults for fields
- documentation - schema definition for our API objects

Note that it does _not_ do:
- fail on unknown fields in data
- fail on a required field with an empty value

--- what replaces it

Based on the above, it may seem like JSON schema provides value.
But it's not the case, let's break it down one by one:
- type validation - unmarshaling JSON into a typed Go struct does this
- required fields - only checks that the field was provided, doesn't actually check that a value is set (e.g. `"name": ""` will pass the `required` check)
  - so it's pretty useless for any real validation
  - and we already have a separate place for proper validation - `CheckAndSetDefaults` methods
- defaulting - done in `CheckAndSetDefaults` methods
  - `Version` is the only annoying field, had to add it in a bunch of objects
- documentation - protobuf definitions are the source of truth for our API schema

--- the benefits

- performance - schema validation does a few rounds of `json.Marshal/Unmarshal` in addition to actual validation; now we simply skip all that
- maintenance - no need to keep protobuf and JSON schema definitions in sync anymore
- creating new API objects - one error-prone step removed
- (future) fewer dependencies - we can _almost_ remove the Go libraries for schema validation (one transient dependency keeping them around)

* Remove services.SkipValidation

No more JSON schema validation so this option is a noop.
2021-06-01 15:27:20 -07:00
..
app_integration_test.go Introduce SessionRecordingConfig extracting fields from ClusterConfig (#6708) 2021-05-19 12:01:37 -07:00
db_integration_test.go Support disconnect_expired_cert for database access (#6857) 2021-05-31 10:26:50 +02:00
helpers.go Implements RFD-0022 - OpenSSH-compatible Agent Forwarding (#6525) 2021-05-06 17:17:50 -07:00
integration.go Added new integration test (not turned on yet) 2016-04-07 18:20:38 -07:00
integration_test.go Remove JSON schema validation (#6685) 2021-06-01 15:27:20 -07:00
kube_integration_test.go Ports some integration tests to Testify/Subtests (#6884) 2021-05-26 19:05:46 -07:00
terminal_test.go Ports some integration tests to Testify/Subtests (#6884) 2021-05-26 19:05:46 -07:00
utmp_integration_test.go AuditLog/grpc server data race (#6170) 2021-05-18 17:57:57 -07:00