Commit Graph

5399 Commits

Author SHA1 Message Date
markb74 997592192b
binder: SecurityPolicy updates. (#8632)
Add additional comments to the security policy class, to mention that implementing new policies requires significant care.

Also add security policies which check the Sha256 of a peer apps's signature, so people can do trusted cross-app communication without having to implement their own policy.

Finally, add the UntrustedSecurityPolicies class, since that's inevitably a policy you sometimes need as well.
2021-10-28 11:30:43 +02:00
ZHANG Dapeng f30d07dc2d
xds: add RlsClusterSpecifierPlugin for RLS-in-xDS (#8612)
Add RlsClusterSpecifierPlugin as per the [design doc](http://go/grpc-rls-in-xds#heading=h.dmyrvi6ohebx)

The structure of `ClusterSpecifierPlugin` is very similar to `io.grpc.xds.Filter`.

The following changes to the existing code are made:

- move `ConfigOrError` class out of `Filter` class to be shared with `ClusterSpecifierPlugin`
- make `io.grpc.rls.RlsProtoData` public to be accessible by `io.grpc.xds`
- treat empty defaultTarget in `io.grpc.rls.RlsProtoData.RouteLookupConfig` as null to support both json and proto config without defaultTarget field specified.
2021-10-27 09:07:15 -07:00
Sergii Tkachenko e0ecd5cfde
RELEASING.md: remove Travis; check milestones before the cut
* Update RELEASING.md

1) Remove Travis Job
2) Add a note to check milestones before cutting the branch
2021-10-25 15:34:28 -04:00
markb74 607362a7d2
Add support for anonymous in-process servers. (#8589)
Support anonymous in-process servers, and InProcessChannelBuilder.forTarget.

Anonymous servers aren't registered statically, meaning they can't be looked up by name.
Only the AnonymousInProcessSocketAddress passed to InProcessServerBuilder.forAddress(),
(or subsequently fetched from Server.getListenSockets()) can be used to connect to the server.

Supporting InProcessChannelBuilder.forTarget is particularly useful for production
Android usage of in-process servers, where process startup latency is crucial.
A custom name resolver can be used to create the server instance on demand
without directly impacting the startup latency of in-process gRPC clients.

Together, these features support a more-standard approach to "OnDeviceServer" referenced in gRFC L73.
https://github.com/grpc/proposal/blob/master/L73-java-binderchannel.md#ondeviceserver
2021-10-25 20:59:48 +02:00
ZHANG Dapeng 203515dd3d
rls: fix connectivity state aggregation (#8625)
Fix connectivity state aggregation as per http://go/grpc-rls-lb-policy-design#heading=h.6e8tt7xcwcdn

> Note that, for the purposes of aggregation, when a child policy reports TRANSIENT_FAILURE, we consider it to continue to be in that state until it reports READY (i.e., we ignore CONNECTING in between the two, no matter how many times it bounces back and forth between TRANSIENT_FAILURE and CONNECTING).
2021-10-21 21:24:51 -07:00
ZHANG Dapeng 00bb283090
xds: add protection flag for federation (#8619)
See https://github.com/grpc/proposal/pull/268/files#diff-e68147af61f13db5bd497e86ffd970fef6af29b88f4f23fb486deefdb35dfea3R659 for detail.
2021-10-20 17:59:21 -07:00
ZHANG Dapeng 2e87cd6ae3
Update README for Android API level (#8620)
We dropped support for Android API levels <19 in #8583
2021-10-20 17:56:53 -07:00
Benjamin Peterson 1fe62dd417
Fix sentences with a missing "be". (#8613) 2021-10-20 15:14:10 -07:00
yifeizhuang b86f4eba55
xds: fix non permanent link to envoy rbac doc #8615 2021-10-20 11:13:57 -07:00
Sergii Tkachenko 6d41b4283a Start 1.43.0 development cycle 2021-10-20 13:47:03 -04:00
ZhenLian d2b9151e7b
core: remove DSA check in CertificateUtils 2021-10-19 19:50:33 -04:00
ZHANG Dapeng 1f90e0e28d
xds: add and parse new bootstrap fields for federation (#8608)
Made changes as per "Bootstrap File Changes" section in go/grpc-xds-federation and implemented bootstrap file parsing logic for the change.
2021-10-18 16:19:34 -07:00
ZhenLian e9b0c2e851
Make CertificateUtils to use other key algorithms (#8609) 2021-10-15 14:42:14 -07:00
Sergii Tkachenko 0376de15b8
Fix AbstractManagedChannelImplBuilder#maxInboundMessageSize(int) ABI (#8607)
In refactoring described in #7211, the implementation of #maxInboundMessageSize(int)
(and its corresponding field) were pulled down from internal AbstractManagedChannelImplBuilder
to concrete classes that actually enforce this setting. For the same reason, it wasn't ported
to ManagedChannelImplBuilder (the #delegate()).

Then AbstractManagedChannelImplBuilder was brought back to fix ABI backward compatibility,
and temporarily turned into a ForwardingChannelBuilder, ref PR #7564. Eventually it will
be deleted, after a period with "bridge" ABI solution introduced in #7834.

However, restoring AbstractManagedChannelImplBuilder unintentionally made ABI of
pre-refactoring builds expect it to be a method of AbstractManagedChannelImplBuilder,
and not concrete classes, ref #8313.

The end goal is to keep #maxInboundMessageSize(int) only in concrete classes that enforce it.
To fix method's ABI, we temporary reintroduce it to the original layer it was removed from:
AbstractManagedChannelImplBuilder. This class' only intention is to provide short-term
ABI compatibility. Once we move forward with dropping the ABI, both fixes are no longer
necessary, and both will perish with removing AbstractManagedChannelImplBuilder.
2021-10-14 17:25:06 -07:00
ZHANG Dapeng 9f644a0861
xds: migrate Bootstrapper data classes to use AutoValue (#8594)
As many new fields will be added to `BootstrapInfo` for xds federation support, refactor `Bootstrapper.java` to use `AutoValue`. All the other files are just mechanical changes due to the refactoring.
2021-10-14 11:55:29 -07:00
yifeizhuang 8e5c18819c
enable rbac by default (#8604) 2021-10-14 11:14:48 -07:00
ZHANG Dapeng 48e3bafb11
rls: limit cache_size in rls config to 5M (#8603)
In the latest grpc-rls-lb-policy-design, if the value of cache_size_bytes is greater than 5M, we cap it at 5M.
2021-10-14 10:01:56 -07:00
Eric Anderson 7cf0578176 .github/workflows: Bump codecov-action to v2
The codecov bash uploader is being replaced (supposedly partially for
security reasons, but it seems maintenance reasons are the real goal).
https://about.codecov.io/blog/codecov-uploader-deprecation-plan/

v1 uses the bash uploader. v2 uses the new uploader. The bash uploader
will begin seeing brownouts soon.
2021-10-13 10:37:31 -07:00
markb74 9266174812
Fix code & javadoc warnings in the binder package. (#8588)
Note: I didn't fix all javadoc warnings mentioned in #8585, since
they're not generated with a modern java version, and the fix feels
worse than the warning.

Specifically, {@link X.Y} generates a warning if only X is imported,
and {@link Z} generates a warning if Z is declared later in the class.

In particular, attempting to fix the first issue by importing X.Y results
in a code-readability warning suggesting I shouldn't do that.
2021-10-09 12:27:01 +02:00
Ivo List bb51bb6dfa
java_grpc_library.bzl: Fix parameters of java_common.compile (#7598)
Parameter host_javabase is removed.

This is preparation for flipping incompatible_java_common_parameters in
Bazel 5. See https://github.com/bazelbuild/bazel/issues/12373

Bazel versions prior to 4 require host_javabase, so are no longer supported.
2021-10-08 13:48:22 -07:00
markb74 0d25d8f7d6
Publish binder in releases. (#8585) 2021-10-08 12:03:44 +02:00
yifeizhuang a2e2f56565
xds: override bootstrap for xds server (#8575)
added xdsServerBuilder method `overrideBootstrapForTest()`. Fix issue https://github.com/grpc/grpc-java/issues/7819
2021-10-07 16:17:08 -07:00
Terry Wilson 83d36104e1
Source k8s test driver install script from core repo (#8573)
The test driver install script is read directly from the core repo master branch and the copy in the Java repo is deleted.
2021-10-07 13:05:03 -07:00
Lidi Zheng 8ac9a4e7bd [xDS interop] add Docker tagging logic to the xds_url_map job 2021-10-07 09:08:23 -07:00
yifeizhuang e939bf6fb8
rbac: fix status code PERMISSION_DENIED (#8578)
RBAC should fail with PERMISSION_DENIED, fix https://github.com/grpc/grpc-java/issues/8576
2021-10-06 11:02:42 -07:00
ZHANG Dapeng 2e84b0f20a
android: bump min Android SDK version to 19 (#8583)
As Google Play Service [discontinued updates for Jelly Bean (API levels 16, 17 & 18)](https://android-developers.googleblog.com/2021/07/google-play-services-discontinuing-jelly-bean.html).
2021-10-06 10:02:32 -07:00
Terry Wilson fc57cad4ec
Revert "Revert "core/auth: Remove CallCredentials2 (#8464)"" (#8572)
This reverts commit a91cc85dfd.
2021-10-05 10:34:44 -07:00
Eric Anderson 979508ea44 context: Remove misleading example that leaks CancellableContext
The example should unconditionally cancel the context, but fails to. And
it is really unclear what situation the example is demonstrating as the
Runnable looping on isCancelled() is guaranteed to have returned when
the Throwable catch is run.

It is non-trivial to fix up this example such that it is concise,
useful, and correct as it essentially needs a rewrite. We have other
examples demonstrating CancellableContext usage. We can just rely on
them instead.
2021-10-04 13:36:20 -07:00
Eric Anderson 0e85737636 .github/workflows: Swap from adoptopenjdk to temurin
Adopt OpenJDK is longer seeing new releases, and instead has moved under
the Eclipse umbrella with Temurin releases.
https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/
https://github.com/actions/setup-java#supported-distributions

The adopt binaries still work, but won't see new versions.
2021-09-29 14:55:12 -07:00
Sumit Bhagwani 2b4a474759
Fix javadoc (#8570) 2021-09-29 13:41:32 -07:00
Eric Anderson dc4a41498e xds: Register RBAC with pretty-printer
Ideally we should plumb this through Filter, but FilterRegistry will
need to be plumbed to XdsClient and it started becoming non-trivial
compared to the "just add two lines." Expediency is helpful as the XDS
logs are pretty hard to read without the pretty-printing.
2021-09-29 11:28:25 -07:00
markb74 fcc7b9694e
Add LifecycleOnDestroyHelper to support shutdown of channel/server on Android lifecycle changes (#8568) 2021-09-29 20:04:47 +02:00
ZHANG Dapeng 28f2647aaf
core: move closed check from Stream.isReady() to Call.isReady() (#8566)
This fixes data race described in #8565.

We are doubtful whether checking closed in isReady() is necessary (#3201 might be a requirement), but it was easier to just maintain the existing behavior than think heavily about it.
2021-09-29 09:42:59 -07:00
markb74 f57de6bd03
Make binder instrumentation tests run on kokoro. (#8563)
The tests run as part of the existing android-interop-testing job.

We needed to modify the manifest of the apk built under android-interop-testing to declare Android Services used by the binder tests.
2021-09-29 11:28:14 +02:00
Liam Miller-Cushon 9209c1eaf5
Migrate off deprecated mockito method (#8562)
See: https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/ArgumentMatchers.html#anyListOf-java.lang.Class-
2021-09-28 14:18:53 -07:00
yifeizhuang fbded2a05f
default throw ServerCallStreamObserver.setOnCloseHandler (#8564) 2021-09-28 13:31:40 -07:00
Lidi Zheng 0287d83182 Add testing_version flag 2021-09-27 15:19:41 -07:00
Eric Anderson 816a54a83b api: Add doc snippet to convert types for defaultServiceConfig()
Tested with Jackson's `new ObjectMapper().readValue(json, Map.class)`.

Fixes #8300
2021-09-27 14:14:35 -07:00
Eric Anderson 192688f1f2 netty: Requests with Connection header are malformed
Although this is part of HTTP/2 and should have already been handled
already, it was noticed as part of RBAC work to avoid matching
hop-by-hop headers. See gRFC A41.

Also add a warning if creating Metadata.Key for "Connection". Use this
to try to help diagnose a client if it happens to blindly copy headers
from HTTP/1, as PROTOCOL_ERROR is hard to debug.

This rolls-forward 6e89919 after it was reverted in 7669656, now that
the test proxy has been fixed.
2021-09-27 12:59:15 -07:00
Eric Anderson 60475de204 xds: Log about fallback credentials, not supplier
The sslContextProviderSupplier is used by the xds creds themselves when
the control plane has security configured. But the fallback credentials
don't use such a supplier and may not even be using TLS.

Language tweak following #8554.
2021-09-24 14:11:33 -07:00
yifeizhuang 0245a72926
xds: error descriptions improvements(#8554) 2021-09-24 10:36:00 -07:00
yifeizhuang ce311bdfd8
tsan: fix SdsProtocolNegotiatorsTest tsan failure due to thread unsafeness (#8374) 2021-09-23 16:25:38 -07:00
Zhouyihai Ding cf41181c48
alts: add channel logs in handshake
The logs are to help with debugging issues for an internal customer.
2021-09-22 21:40:41 -07:00
Eric Anderson e76efbb5da Update README etc to reference 1.41.0 2021-09-22 16:50:35 -07:00
Eric Anderson 499c51fa3f RELEASING.md: Bump protobuf version to match build.gradle
For 1.40.0 the protobuf version was bumped to the latest version, which
we hadn't tested at all. We want to bump to the version used in the
release.
2021-09-22 13:36:42 -07:00
John Cormie 3ff23d3684
Synchronize access to acknowledgedOutgoingBytes/transmitWindowFull. (#8547)
Fixes #8536
2021-09-22 12:19:48 -07:00
John Cormie 46dbac3eb6
Make manifest usable with android_instrumentation_test()s in google3 (#8545) 2021-09-22 11:53:16 -07:00
Jan Tattermusch 3049c2c147 reenable previously disabled aarch64 tests 2021-09-22 10:53:10 -07:00
markb74 e244065b0c
Fix flakey security policy tests. (#8550)
Using ShadowProcess to set the processes uID doesn't help since SecurityPolicies class fetches the ID in a static initializer, and it may have already been loaded.

Instead, just rely on whatever the uID is already, and ensure the other UIDs we test with are offset from that first value.
2021-09-22 19:19:10 +02:00
Zhouyihai Ding 5396a1de3d
grpclb: remove redundant logs and add a system property to hide server lists in logs
The server list updates are very verbose and currently logged every second, causing a huge log spam if `ChannelLogger` is completely enabled. For debugging an internal issue, we need to turn on `ChannelLogger` but hide the server list updates from the logs to keep the log size reasonable.
2021-09-22 10:13:42 -07:00