Skip to content

Commit 1b7dcb8

Browse files
wwongbulldozer-bot[bot]
authored andcommitted
Redact password and token-related fields (#368)
Password and token-related fields are now annotated as redacted, which should prevent the field values from appearing in toString output.
1 parent ded3585 commit 1b7dcb8

File tree

6 files changed

+13
-0
lines changed

6 files changed

+13
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type: fix
2+
fix:
3+
description: Password and token-related fields are now annotated as redacted, which
4+
should prevent the field values from appearing in toString output.
5+
links:
6+
- https://github.com/palantir/conjure-java-runtime-api/pull/368

service-config/src/main/java/com/palantir/conjure/java/api/config/service/BasicCredentials.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public abstract class BasicCredentials {
3030
@Value.Parameter
3131
public abstract String username();
3232

33+
@Value.Redacted
3334
@Value.Parameter
3435
public abstract String password();
3536

service-config/src/main/java/com/palantir/conjure/java/api/config/service/PartialServiceConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.palantir.tokens.auth.BearerToken;
2424
import java.util.List;
2525
import java.util.Optional;
26+
import org.immutables.value.Value;
2627
import org.immutables.value.Value.Immutable;
2728

2829
@Immutable
@@ -33,6 +34,7 @@ public interface PartialServiceConfiguration {
3334

3435
/** The API token to be used to interact with the service. */
3536
@JsonAlias("api-token")
37+
@Value.Redacted
3638
Optional<BearerToken> apiToken();
3739

3840
/** The SSL configuration needed to interact with the service. */

service-config/src/main/java/com/palantir/conjure/java/api/config/service/ServiceConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
@ImmutablesStyle
3131
public interface ServiceConfiguration {
3232

33+
@Value.Redacted
3334
Optional<BearerToken> apiToken();
3435

3536
SslConfiguration security();

service-config/src/main/java/com/palantir/conjure/java/api/config/service/ServicesConfigBlock.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.palantir.tokens.auth.BearerToken;
2525
import java.util.Map;
2626
import java.util.Optional;
27+
import org.immutables.value.Value;
2728
import org.immutables.value.Value.Immutable;
2829

2930
/**
@@ -44,6 +45,7 @@ public abstract class ServicesConfigBlock {
4445
*/
4546
@JsonProperty("apiToken")
4647
@JsonAlias("api-token")
48+
@Value.Redacted
4749
public abstract Optional<BearerToken> defaultApiToken();
4850

4951
/**

ssl-config/src/main/java/com/palantir/conjure/java/api/config/ssl/SslConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public StoreType trustStoreType() {
5151
public abstract Optional<Path> keyStorePath();
5252

5353
@JsonAlias("key-store-password")
54+
@Value.Redacted
5455
public abstract Optional<String> keyStorePassword();
5556

5657
@SuppressWarnings("checkstyle:designforextension")

0 commit comments

Comments
 (0)