* Revert "Revert "XdsClient: add unit test and fix watcher notification bugs (#30823)" (#30942)"
This reverts commit 6d2c4a8314.
* use GRPC_CUSTOM_JSONUTIL macro for JsonPrintOptions
This adds a unit test for XdsClient and fixes several watcher-notification bugs found in the process. Specifically:
- When an ADS stream fails or an xDS channel reports a connectivity failure, report an error only to the watchers for resources being subscribed to on that particular channel, not to watchers on other channels.
- Cache the error status for the channel, so that if a new watcher is started after the channel reports the error, we can immediately report that error to the new watcher.
- If a resource is NACKed and has not been previously cached, or does not exist, report that fact to any new watcher that may be started later.
- If a resource in an ADS response is unparseable but is wrapped in a `Resource` wrapper, we do know its name, so record the validation failure in the cache and report it to the watchers.
Co-authored-by: markdroth <markdroth@users.noreply.github.com>
* Revert "Revert "XdsClient: convert xDS bootstrap code to use new JSON parsing API (#30431)" (#30924)"
This reverts commit 3332e7e48d.
* fix build for C++20
* iwyu and clang-format
* implement UniqueTypeName API
* convert security code to use UniqueTypeName
* change subchannel data producer API to use UniqueTypeName
* sanitize
* add missing build dep
* fix credentials_test
* fix certificate_provider_store_test
* fix tls_security_connector_test
* attempt to fix windows build
* avoid unnecessary allocation
* work around MSVC 2017 bug
* sanity
* change factory to not be templated
* fix sanity
* fix bug in chttp2 connector that used server creds instead of channel creds
* add missing build dep
* simplify API
* Eliminate post-init in channel stack builder
We've had a post init function on channel stack builder for a very long
time, an it serves to run some code after initialization completes.
We need the functionality for a few things, but the function passed in
is intimately tied to the filter in use - we never vary it between
multiple functions for the same filter... which means it makes more
sense to locate this functionality as part of the filter interface.
* fix
* Automated change: Fix sanity tests
* fix
Co-authored-by: ctiller <ctiller@users.noreply.github.com>
* Refactor end2end tests to exercise each EventEngine
* fix incorrect bazel_only exclusions
* Automated change: Fix sanity tests
* microbenchmark fix
* sanitize, fix iOS flub
* Automated change: Fix sanity tests
* iOS fix
* reviewer feedback
* first pass at excluding EventEngine test expansion
Also caught a few cases where we should not test pollers, but should
test all engines. And two cases where we likely shouldn't be testing
either product.
* end2end fuzzers to be fuzzed differently via EventEngine.
* sanitize
* reviewer feedback
* remove misleading comment
* reviewer feedback: comments
* EE test_init needs to play with our build system
* fix golden file test runner
Co-authored-by: drfloob <drfloob@users.noreply.github.com>
* Initial structure for RLS
* Adding and building the proto to parse the Any proto for the plugins
* re-org
* Parsing the plugin
* Parsing more into json
* Parsed proto to json
* small cleanup
* Adding prefix
* Added new rls_experimental policy
* build files
* Fixing according to code review comments
* code review comments
* Adding sym changes
* adding action name check
* fixing code review comments.
* fixing unused var error
* clean up
* fixing code review comments
* fixing code review comments
* fixing according to code review comments.
* Remove unnecessary include
* small fix
* generate more, hard-code less
* Moving to using absl::variant
* absl::string_view and absl::variant of vector of std::string are not
playing nice together.
* fixed variant
* Using absl::variant now
* Checkint used plugins
* Refactor Parsing code and separating out Parsing of the plugin
* Fixing code review comments
* code review comments
* fixing code review comments.
* Addressing code review comments
* First end-to-end test
* generated build files
* commit generated files via tools/codegen/core/gen_upb_api.sh
* Fixing rls policy parsing tests
* Restore checks for the test server
* Refactor rls_server
* added keys to rls request
* fixing small logic error
* Complete the test using all the keys
* Separating out RLS test and rls_server thread
* sanity errors
* generated build files
* Complete the rest of the tests and sanity cleanup
* fixing code review comments: using upb_JsonEncode now!
* fixing code review comments
* fixing code review comments
* Fixing code review comments
* misisng fix
* simplifying tests
* simplify tests 2
* Linking in the correct proto for rls_config
* restore metadata check
* Add disable test
* Fixing RLS test and removing environment var that is no longer necessary
* Fixing "Wrong type" type of tests after json parsing change to accept
STRING for number
* adding json_encode.h/c to src/upb/gen_build_yaml.py and generate
necessary files.
* Fixing un-used var error
* fixing sanity errors
* Fixing the upb encoding buffer
* Fixing code review comments.
* Adding nack test for unkonwn plugin proto
* Last bit of code review comments
* fixing unused variable
* Move XdsChannelCreds to CoreConfiguration
* move xDS channel creds files to src/core/lib/security/credentials/xds
* Change back to returning a RefCountedPtr.
* make remove "xds_" from xds_channel_* files.
* Renamed to address comments.
* clang fix
* Fix another clang error
* Passing xds server object instead of just a string name
* Adding xds server to policy
* Refactor ToJson
* Using XdsServer for load reporting
* code review comments
* fixing code review comments
* Taking care of lifetime of the XdsServer key
* code review comments
* Fixing channel_state storage and re-run tests (1 assert hit)
* Checking for server in the bootstrap file
* Adding LRS test
* adding a bootstrap file ToJson and parse test
* fixing code review comments
* fixing code review comments.
* fixing test
* break out the federation lrs test
* Fixed last bit of code review comments
* fixing error message to be more precise
This patch introduces a factory to allow supporting custom xDS channel
creds. Three types currently supported (fake, insecure, google_default)
are registered by default for backward-compatibility.
* xDS Federation: bootstrap and xds_resolver changes
* code review fixes
* fixing code review comments
* fixing code review comments
* fixing code review comments
* code review comments
* fixing code review comments
* First very basic test to make sure parsing and reconstruction work as
expected.
* clean up
* fixing logic error about authority
* fixing resource type parsing
* fixing code review comments
* simplify parsing!
* Parsing method signature update
* fixing code review comments
* clean up
* working progress for the test with generated bootstrap
* reorg the bootstrap file
* fixing tests
* Adding more to test authorities
* Added a test and it passes
* addressing code review comments
* code review comments to make parser cleaner and more efficient
* Merge in authority prefixes
* fixing sanity error and xds boostrap test error
* small fix
* Release all tests that pass; reduce scope for DeadUpdate
* Updated test strcuture and how to pass in the index for balancers to be
used as xds server uri and authority xds server uri
* code review comments
* code review fixes
* code review comment
* Making test structure changes
* fixing code review comments
* fixing code review comments
* Fixing test regression
* fixing bootstrap tests
* cleanup files
* enabling localhost:xxx for xds server; updated server tests and will fix
one more NameExpected test with testsetup.
* Finally removing fake reolsver for xds server
* Fixing bootstrap tests
* Rewrite builder
* Fixing code review comments
* fixing code review comments
* Fixing all tests to use Setup again
* fixing small sanity error
* Found the source of xds server nack test faiure and fix added
* small code review fixes
* Remove fake resolver! YAY!
* Fixing according to code review comments
* Setup plugin in bootfile
* Added more tests.
* Adding server test
* fixing a regression
* regression
* sanity fix
* fixing code review
* fixing code review comments
* Re-combine SecurityNaming tests.
* Add Rds new resource type and new tests
* Added PercentEncode test
* fixing code review comments
* refactor test a bit more
* fixing code review comments
* fixing according to code review comments
* fixing code review comments
* fixing code review comments
* ChannelStackModifier class
* Regenerate projects
* clang-tidy
* Use CoreConfiguration for inserting xDS HTTP filters
* New lines
* Move test to test/core/xds
* Add comment for placement of filter stack
* Fix sanity
* Fix memory leak - destroy builder
* Don't build xds_channel_stack_modifier_test on non-bazel build systems due to census dependency