Commit Graph

77 Commits

Author SHA1 Message Date
Tim van der Lippe d35fbd7eee all: Update to Mockito 2
This is the public port of cl/238445847

Fixes #5319
2019-03-19 14:17:52 -07:00
Jiangtao Li b4af5ad986
ALTS: add ComputeEngineChannelBuilder (#5473) 2019-03-13 12:42:21 -07:00
Eric Anderson b48b0ac1d4 all: Stop committing generated protobuf messages
This commit swaps to using a Sync task to place generated code in the
src/generated folder instead of the gradle-protobuf-plugin's
generatedFilesBaseDir. This provides much nicer results on failed
builds, and you will no longer see all the generated files deleted.

But at the same time the Sync task makes it easy to only copy the
grpc-generated code. This was not previously done because we were lazy
and using generatedFilesBaseDir, which made it difficult to treat the
services differently from the messages.
2019-03-05 16:28:55 -07:00
Carl Mastrangelo 8e6fa122a6
netty,alts: hide ProtocolNegotiator behind an accessor, and...
...and move the `close()` method to ProtocolNegotiator rather than Handler.

Since this is a breaking change (for people who ignored our `@Internal` annotations), I wanted to make both changes in the same PR so as to fix them both at the same time.
2019-02-15 13:59:58 -08:00
Eric Anderson b7b7322760
Update google-auth-library-java to 0.13.0
0.13.0 is the latest version.

This honestly doesn't do much since any user of our auth API will be
depending on the library themselves (we only depend on the interface; no
implementation). But getting past 0.9.1 may encourage our users to use a
newer version with better JWT handling and 0.9.1 was released 10 months
ago, so we're overdue for an update.

Fixes #4700
2019-02-15 09:38:16 -08:00
Carl Mastrangelo bb394132bd
netty: limit access to ProtocolNegotiators 2019-02-12 19:59:15 -08:00
Eric Anderson 9312291d30 alts: Use absolute domain name for metadata server
This avoids using the search domains when not on GCE, which prevents
useless DNS requests.

This is the Java equivalent of grpc/grpc#17598
2019-02-08 08:28:28 -08:00
Eric Anderson eaca73473c
Upgrade to protobuf 3.6.1
For Bazel, we upgrade to protobuf 3.6.1.2 and javalite HEAD to fix
incompatibilities in newer Bazel releases.

compiler/Dockerfile is unused, so it was removed instead of being updated.

protoc no longer includes codegen for nano, so we remain on the older protoc
any time nano is used.

Protobuf now requires C++11 when compiling, so windows was swapped to
VC 14.
2019-02-07 13:40:53 -08:00
Carl Mastrangelo 3a39b81cf5
all: remove java6 type args 2019-02-04 10:03:50 -08:00
Jihun Cho 83db004837
alts: fix missing dependencies (#5307)
fix missing dependencies for grpc-alts by using java plugin
2019-02-01 11:02:16 -08:00
Eric Anderson ddb16c5b4b Upgrade Guava to 26.0-android
This reverts commit 4adcf24363. The downgrade of
Guava has gone out in a release, so we can upgrade it again in the next
release.
2019-02-01 10:16:38 -08:00
Jihun Cho 1c3432c3fb
all: migrate gradle publish from maven to use maven-publish plugin (#5289) 2019-01-31 17:38:43 -08:00
Eric Anderson e06b941eb7 alts,services: Sync proto sources from grpc-proto
This syncs to grpc/grpc-proto@f9af5e19f7
2019-01-15 16:15:22 -08:00
Jiangtao Li 4d90b37a0a
ALTS: release handshaker channel if no longer needed (#5210)
* ALTS: release handshaker channel if no longer needed
2019-01-11 14:57:08 -08:00
Kun Zhang 1ed196c585
core: promote the new API in CallCredentials2 (#5216)
This is the 3rd step of #4901

- The deprecated `CC.applyRequestMetadata(... Attributes ...)` is now **replaced** by the new API `CC.applyRequestMetadata(... CC.MetadataApplier ...)` transformed from `CC2.applyRequestMetadata(... CC2.MetadataApplier ...)`.
- The Attributes keys in `CallCredentials` were deprecated, and now deleted.
- The deprecated interface `CC.MetadataApplier` is **replaced** by an equivalent abstract class.
- `CallCredentials2` is now marked as deprecated, while keeping its interface intact so that it won't break current implementations that are still on `CallCredentials2`.
- From this point on, implementations should do a one-line change from `extends CallCredentials2` to `extends CallCredentials`
- `GoogleAuthLibraryCallCredentials` is kept as `CallCredentials2` for now, as there is an internal consumer that expects it to be `CallCredentials2`.
2019-01-10 15:16:18 -08:00
Eric Anderson 4adcf24363
Downgrade to Guava 25.1
This is temporary for the 1.18 release to give users a bit more time to
get past the breaking changes to Beta APIs in Guava 26.

Fixes #5166
2019-01-08 16:22:48 -08:00
Eric Anderson e74576b85b Remove old BetaApi failure suppressions
We've been on newer versions of Guava for a while now; these no longer
do anything.

Reworded the comment for Stopwatch.createUnstarted(), because it is not
safe (it doesn't matter if the method isn't marked Beta; you have to use
Ticker), except for the fact it is only used in our tests.
2019-01-08 16:07:40 -08:00
ZHANG Dapeng df21e40285
all: fix lint 2019-01-02 15:28:44 -08:00
ZHANG Dapeng 49475c6759
alts: Fix ambiguous assertThat() in TsiFrameHandlerTest 2019-01-02 11:41:00 -08:00
Jihun Cho 9eeceab597
alts: TsiFrameHandler doesn't throw exception when flush after closed (#5180)
also, error / log messages will contain state of FrameHandler
2018-12-20 10:12:37 -08:00
Eric Anderson f1f3dbcbd6 alts: Fix SHARED_HANDSHAKER_CHANNEL after first close
Since the Resource shared the executor service between invocations, but
didn't null it out on shutdown, it could bring up a new channel with a
terminated event loop. The channel would then proceed to panic on usage.

I noticed this problem while looking into what was necessary for #4755.
2018-12-19 09:59:01 -07:00
Thomas Broyer 2ffc46d6fa Update net.ltgt.errorprone to 0.6 and enable Error Prone on JDK 10+ 2018-12-13 10:17:06 -08:00
Carl Mastrangelo 23dadaa85d
alts: add debugging statements for ALTS 2018-12-11 16:44:51 -08:00
Eric Anderson 03300cb2de alts: Eagerly add interceptor in GoogleDefaultChannelBuilder
This allows calling build() multiple times as well as prevents other
interceptors from being able to detect that we've implemented
CallCredential attachment via an interceptor. (Previously they could
have set their own CallCredentials which would have overridden the
default creds.)
2018-12-07 16:13:18 -08:00
Carl Mastrangelo 81121fd8e4
alts: make sure to always free frame protector 2018-11-28 11:52:27 -08:00
Kun Zhang 02f0dca8d4
Fix buildifier warnings (#5058) 2018-11-14 07:12:11 -08:00
Rodrigo Queiro 8481943866 Add missing j2objc dependency to Bazel build
This avoids a warning when building artifacts that depend on Guava.

Fixes #5046.
2018-11-13 13:39:35 -08:00
ZHANG Dapeng 41c8d8020f
all: fix lint 2018-10-23 14:03:46 -07:00
Jiangtao Li c8712877a1
alts: remove empty line in the proto (#4979) 2018-10-23 10:49:15 -07:00
Kun Zhang ade5c497f4
Revert "core: promote CallCredentials API v2. (#4952)" (#4983)
This reverts commit ef8a84421d.

Firebase is not yet ready to migrate to the new API. Will try again once we made the release and migrated them to CallCredentials2.
2018-10-22 16:43:37 -07:00
Carl Mastrangelo e757c7dea0
alts: update alts protos to match grpc-proto 2018-10-19 14:32:40 -07:00
Thomas Broyer 183e1f6735 all: update Error Prone to 2.3.2
This will allow enabling Error Prone on JDK 10+ (after
updating the net.ltgt.errorprone plugin), and is also a
prerequisite to that plugin update.

Also remove net.ltgt.apt plugin, as Gradle has native
support for annotationProcessor.
2018-10-19 13:08:36 -07:00
Jiangtao Li e6e3eb8420
alts: update handshaker proto (#4966) 2018-10-17 16:41:01 -07:00
Eric Anderson 959323be97
Add build support for Java 11
It appears everything was already working on Java 11, except
build-specific and testing issues. Updating to Netty 4.1.30 (#4940)
probably fixed the last true Java 11 incompatibility.

Fixes #4933
2018-10-17 11:49:30 -07:00
Kun Zhang ef8a84421d
core: promote CallCredentials API v2. (#4952)
This is Step 3 of #4901.  The old interface has been deprecated in the
latest release.  Now it's time to replace it with the new API.
2018-10-15 15:37:20 -07:00
Kun Zhang fbfc3a40d0
core: add Grpc.TRANSPORT_ATTR_LOCAL_ADDR (#4906)
Resolves #4135
2018-10-03 16:43:37 -07:00
Eric Anderson 99a2cac07a netty: Add ProtocolNegotiator.close
This notifies the negotiator when it will no longer be used, allowing it
to clean up any resources.
2018-10-03 08:48:35 -07:00
Kun Zhang ebbf8005be
doc: organize Attributes with annotations. (#4892)
* doc: organize Attributes Keys with annotations.

Keys are annotated with the following annotations:

1. Grpc.TransportAttr: transport attributes returned by
{Client,Server}Call.getAttributes().

2. NameResolver.ResolutionResultAttr: attributes passed as the
argument of NameResolver.Listener.onAddresses() and
LoadBalancer.handleResolvedAddressGroups()

3. EquivalentAddressGroup.Attr: attributes from
EquivalentAddressGroups.

* Expand the usage of annotations to Attributes variables.
2018-10-01 10:11:01 -07:00
Jesse Wilson 8b16899bc1 Upgrade to Guava 26.0-android and jsr305 3.0.2 2018-09-28 13:23:55 -07:00
Jiangtao Li 8e72351a65
alts: plumb authority to ALTS protocol negotiator (#4880)
alts: plumb authority to ALTS protocol negotiator
2018-09-27 19:27:45 -07:00
Eric Anderson 693779dba7
alts: Remove usage of TransportCreationParamsFilterFactory
Provide a ProtocolNegotiatorFactory instead.
TransportCreationParamsFilterFactory is being removed.
2018-09-24 17:32:04 -07:00
Eric Anderson 6f71472cf4 alts: Initialize ProtocolNegotiators eagerly
This simplifies the construction process, as we have fewer "interesting"
phases to weed through.
2018-09-17 16:49:56 -07:00
Carl Mastrangelo b0f423295b
all: use Java7 brackets 2018-09-14 13:52:29 -07:00
Eric Anderson 7efbc36c72 netty: Initialize ProtocolNegotiators eagerly
This simplifies the construction paradigm and leads to the eventual
removal of TransportCreationParamsFilterFactory. The eventual end goal
is to be able to shut down ProtocolNegotiators as is necessary for ALTS.

The only reason the initialization was delayed was for 'authority', so
we now plumb the authority through GrpcHttp2ConnectionHandler.
2018-09-12 08:16:54 -07:00
ZHANG Dapeng c8975e987b
all: fix lint warnings in import 2018-09-11 16:24:44 -07:00
zpencer 4d366ce978
all: move Channelz to io.grpc as InternalChannelz (#4797)
This is an API used to coordinate across packages and must live in
`io.grpc`.

Prepending `Internal` makes it easier to detect and hide this class
from public visibility when using certain build tools.

fixes #4796
2018-09-04 16:52:01 -07:00
Jiangtao Li 433ac00de4
alts: convert handshaker service channel to SharedResourceHolder (#4802)
alts: convert handshaker service channel to SharedResourceHolder
2018-08-29 10:09:09 -07:00
Jiangtao Li 87513d8e83
alts: if ALTS is not running on GCP, fails call (#4807)
alts: if ALTS is not running on GCP, fails call rather than RuntimeException
2018-08-29 08:59:16 -07:00
Jiangtao Li 8d6ba2335a
alts: add Google Default Channel implementation (#4742)
alts: add Google Default Channel implementation
2018-08-27 15:27:35 -07:00
Eric Anderson 3792242ae1
alts: Use grpc-netty-shaded instead of grpc-netty
There's no good way to provide users of ALTS a choice between grpc-netty
and grpc-netty-shaded. Since Netty is not exposed through the ALTS API
surface, we opt for the shaded version as it has fewer deployment
issues. However, this also means that we _can't_ expose any Netty API,
like EventLoopGroup.
2018-08-15 17:39:20 -07:00