aboutsummaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorEric Anderson <ejona@google.com>2017-07-27 18:07:18 -0700
committerGitHub <noreply@github.com>2017-07-27 18:07:18 -0700
commit9be41ba0e84d85b9c9a96992d8158c2e95cb3050 (patch)
treeee8a24889a5cbcfc23e5178ae637160f862ee6c9 /auth
parent3efaccd81ff47a46400badcd51a8abf39c9262f8 (diff)
downloadgrpc-grpc-java-9be41ba0e84d85b9c9a96992d8158c2e95cb3050.tar.gz
core,auth: Stabilize auth flow using CallCredentials
As discussed in #1914, we need CallCredentials and MoreCallCredentials to be stable, but there's less of a strong need for the contents of CallCredentials to be stable. We're willing to commit to the name, without needing to commit to the plumbing.
Diffstat (limited to 'auth')
-rw-r--r--auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java3
-rw-r--r--auth/src/main/java/io/grpc/auth/MoreCallCredentials.java7
2 files changed, 8 insertions, 2 deletions
diff --git a/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java b/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java
index 335b8abb0..9cb3ba846 100644
--- a/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java
+++ b/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java
@@ -69,6 +69,9 @@ final class GoogleAuthLibraryCallCredentials implements CallCredentials {
}
@Override
+ public void thisUsesUnstableApi() {}
+
+ @Override
public void applyRequestMetadata(MethodDescriptor<?, ?> method, Attributes attrs,
Executor appExecutor, final MetadataApplier applier) {
String authority = checkNotNull(attrs.get(ATTR_AUTHORITY), "authority");
diff --git a/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java b/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java
index 1c67f172e..42e540ba3 100644
--- a/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java
+++ b/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java
@@ -18,15 +18,18 @@ package io.grpc.auth;
import com.google.auth.Credentials;
import io.grpc.CallCredentials;
-import io.grpc.ExperimentalApi;
/**
* A utility class that converts other types of credentials to {@link CallCredentials}.
*/
-@ExperimentalApi("https//github.com/grpc/grpc-java/issues/1914")
public final class MoreCallCredentials {
/**
* Converts a Google Auth Library {@link Credentials} to {@link CallCredentials}.
+ *
+ * <p>Although this is a stable API, note that the returned instance's API is not stable. You are
+ * free to use the class name {@code CallCredentials} and pass the instance to other code, but the
+ * instance can't be called directly from code expecting stable behavior. See {@link
+ * CallCredentials}.
*/
public static CallCredentials from(Credentials creds) {
return new GoogleAuthLibraryCallCredentials(creds);