Skip to content

Commit 7cba744

Browse files
committed
fix: added the suppression annotations to suppress fb warnings
1 parent 13dd29c commit 7cba744

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/main/java/com/zitadel/Zitadel.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.zitadel.auth.ClientCredentialsAuthenticator;
66
import com.zitadel.auth.PersonalAccessTokenAuthenticator;
77
import com.zitadel.auth.WebTokenAuthenticator;
8+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
89

910
import java.io.IOException;
1011
import java.util.function.Consumer;
@@ -267,6 +268,7 @@ public static Zitadel withClientCredentials(String host, String clientId, String
267268
* @see <a href="https://zitadel.com/docs/guides/integrate/service-users/private-key-jwt">Private
268269
* Key JWT Guide</a>
269270
*/
271+
@SuppressFBWarnings({"PATH_TRAVERSAL_IN", "THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"})
270272
public static Zitadel withPrivateKey(String host, String keyFile) {
271273
try (java.io.FileInputStream fis = new java.io.FileInputStream(keyFile)) {
272274
return withPrivateKey(host, fis);
@@ -285,6 +287,7 @@ public static Zitadel withPrivateKey(String host, String keyFile) {
285287
* @see <a href="https://zitadel.com/docs/guides/integrate/service-users/private-key-jwt">Private
286288
* Key JWT Guide</a>
287289
*/
290+
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
288291
public static Zitadel withPrivateKey(String host, java.io.InputStream inputStream) {
289292
return new Zitadel(WebTokenAuthenticator.fromJson(host, inputStream));
290293
}

‎src/main/java/com/zitadel/auth/WebTokenAuthenticator.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public class WebTokenAuthenticator extends OAuthAuthenticator {
8484
* @throws RuntimeException if the file cannot be read, the JSON is invalid, or required keys are
8585
* missing or invalid.
8686
*/
87+
@SuppressWarnings("unused")
8788
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
8889
public static WebTokenAuthenticator fromJson(String host, String jsonPath) {
8990
try (FileInputStream fis = new FileInputStream(jsonPath)) {

0 commit comments

Comments
 (0)