Skip to content

Commit c6110e9

Browse files
SK-3015-gitleaks-detection-fix
1 parent 24ad863 commit c6110e9

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

common/src/main/java/com/skyflow/utils/BaseConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class BaseConstants {
1414
public static final String STAGE_DOMAIN = "skyflowapis.tech";
1515
public static final String SANDBOX_DOMAIN = "skyflowapis-preview.com";
1616
public static final String PROD_DOMAIN = "skyflowapis.com";
17-
public static final String PKCS8_PRIVATE_HEADER = "-----BEGIN PRIVATE KEY-----";
17+
public static final String PKCS8_PRIVATE_HEADER = "-----BEGIN PRIVATE KEY-----"; // gitleaks:allow
1818
public static final String PKCS8_PRIVATE_FOOTER = "-----END PRIVATE KEY-----";
1919
public static final String GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer";
2020
public static final String SIGNED_DATA_TOKEN_PREFIX = "signed_token_";

common/src/test/java/com/skyflow/BaseVaultClientTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public void testWrapApiException_carriesStatusCodeAndJsonResponseBody() {
280280

281281
/**
282282
* Covers setBearerToken's "token present but expired -> regenerate" branch. A hand-crafted
283-
* always-expired JWT ("x.eyJleHAiOjF9.y", exp=1 => 1970) is seeded directly into the token
283+
* always-expired JWT ("<TOKEN_1>", exp=1 => 1970) is seeded directly into the token
284284
* field, bypassing setBearerToken. The very same credentials instance used to seed
285285
* finalCredentials is then reused when calling setBearerToken, so prioritiseCredentials does
286286
* NOT treat this as a credential change (that branch is covered by
@@ -294,11 +294,11 @@ public void testSetBearerToken_expiredToken_regeneratesToken() throws SkyflowExc
294294
BaseVaultClient<BaseVaultConfig> client = newClient(null);
295295

296296
client.prioritiseCredentials(creds);
297-
client.token = "x.eyJleHAiOjF9.y"; // exp=1 (1970) -> always expired, seeded directly
297+
client.token = "<TOKEN_1>"; // exp=1 (1970) -> always expired, seeded directly
298298

299299
client.setBearerToken(creds);
300300

301301
Assert.assertEquals("x.eyJleHAiOjk5OTk5OTk5OTl9.y", client.token);
302-
Assert.assertNotEquals("x.eyJleHAiOjF9.y", client.token);
302+
Assert.assertNotEquals("<TOKEN_1>", client.token);
303303
}
304304
}

flowvault/src/test/java/com/skyflow/AuthInterceptorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
public class AuthInterceptorTests {
2626

27-
private static final String API_KEY = "sky-ab123-abcd1234cdef1234abcd4321cdef4321";
27+
private static final String API_KEY = "<API_KEY>";
2828

2929
private static VaultConfig config() {
3030
VaultConfig config = new VaultConfig();

skyvault/src/test/java/com/skyflow/ConnectionClientTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void testSetBearerToken() {
5959
try {
6060
// Self-contained fake JWT (exp=9999999999, far future) instead of relying on a
6161
// local .env fixture, which may not exist (e.g. in CI/sandbox environments).
62-
String bearerToken = "x.eyJleHAiOjk5OTk5OTk5OTl9.y";
62+
String bearerToken = "<BEARER_TOKEN>";
6363
Credentials credentials = new Credentials();
6464
credentials.setToken(bearerToken);
6565
connectionConfig.setCredentials(credentials);
@@ -144,7 +144,7 @@ public void testSetBearerToken_withValidNonExpiredToken_reusesBearerToken() {
144144
try {
145145
// far-future JWT: base64({"exp":9999999999}) = eyJleHAiOjk5OTk5OTk5OTl9 — never expires
146146
Credentials creds = new Credentials();
147-
creds.setToken("x.eyJleHAiOjk5OTk5OTk5OTl9.y");
147+
creds.setToken("<BEARER_TOKEN>");
148148
ConnectionConfig config = new ConnectionConfig();
149149
config.setConnectionId("isolated-token-1");
150150
config.setConnectionUrl("https://test.isolated.url");
@@ -153,11 +153,11 @@ public void testSetBearerToken_withValidNonExpiredToken_reusesBearerToken() {
153153

154154
// First call: this.token == null → Token.isExpired(null)=true → generates token from creds.getToken()
155155
client.setBearerToken();
156-
Assert.assertEquals("x.eyJleHAiOjk5OTk5OTk5OTl9.y", client.token);
156+
Assert.assertEquals("<BEARER_TOKEN>", client.token);
157157

158158
// Second call: token not null, not empty, not expired → REUSE_BEARER_TOKEN else branch (line 52)
159159
client.setBearerToken();
160-
Assert.assertEquals("x.eyJleHAiOjk5OTk5OTk5OTl9.y", client.token);
160+
Assert.assertEquals("<BEARER_TOKEN>", client.token);
161161
} catch (Exception e) {
162162
Assert.fail(INVALID_EXCEPTION_THROWN);
163163
}
@@ -167,7 +167,7 @@ public void testSetBearerToken_withValidNonExpiredToken_reusesBearerToken() {
167167
public void testPrioritiseCredentials_credentialChange_resetsToken() {
168168
try {
169169
Credentials credentialsA = new Credentials();
170-
credentialsA.setToken("x.eyJleHAiOjk5OTk5OTk5OTl9.y");
170+
credentialsA.setToken("<BEARER_TOKEN>");
171171
ConnectionConfig config = new ConnectionConfig();
172172
config.setConnectionId("isolated-change-1");
173173
config.setConnectionUrl("https://test.isolated.url");

0 commit comments

Comments
 (0)