feat: add mtls support by arithmetic1728 · Pull Request #1 · arithmetic1728/java-pubsub · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions google-cloud-pubsub/.factorypath
21 changes: 20 additions & 1 deletion google-cloud-pubsub/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,35 @@
<site.installationModule>google-cloud-pubsub</site.installationModule>
</properties>
<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>1.37.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
<version>1.37.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-auth</artifactId>
<version>1.37.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-grpclb</artifactId>
<version>1.37.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.37.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.37.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
Expand Down Expand Up @@ -77,6 +95,7 @@
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
<version>1.37.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
Expand Down Expand Up @@ -192,4 +211,4 @@
</dependencies>
</profile>
</profiles>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ public static String getDefaultEndpoint() {
return "pubsub.googleapis.com:443";
}

public static String getDefaultMtlsEndpoint() {
return "pubsub.mtls.googleapis.com:443";
}

/** Returns the default service scopes. */
public static List<String> getDefaultServiceScopes() {
return DEFAULT_SERVICE_SCOPES;
Expand Down Expand Up @@ -695,6 +699,8 @@ private static Builder createDefault() {
builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build());
builder.setEndpoint(getDefaultEndpoint());
builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
builder.setSwitchToMtlsEndpointAllowed(true);
return initDefaults(builder);
}

Expand Down