This is an automated email from the ASF dual-hosted git repository. ndipiazza pushed a commit to branch tika-grpc-3x-features in repository https://gitbox.apache.org/repos/asf/tika.git
commit d2e5590781adb4d7eb8c726daedcebc12b4d7046 Author: Nicholas DiPiazza <[email protected]> AuthorDate: Wed Apr 10 17:21:03 2024 -0500 jwt config --- tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml | 2 +- .../tika/pipes/fetcher/http/HttpFetcher.java | 6 +++ .../fetcher/http/config/HttpFetcherConfig.java | 51 ++++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml b/tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml index 5f664108c..c204370d1 100644 --- a/tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml +++ b/tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml @@ -48,7 +48,7 @@ <dependency> <groupId>com.nimbusds</groupId> <artifactId>nimbus-jose-jwt</artifactId> - <version>9.5</version> + <version>9.37.3</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> diff --git a/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/HttpFetcher.java b/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/HttpFetcher.java index eb4d9215c..fa035e76f 100644 --- a/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/HttpFetcher.java +++ b/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/HttpFetcher.java @@ -106,6 +106,12 @@ public class HttpFetcher extends AbstractFetcher implements Initializable, Range setProxyHost(httpFetcherConfig.getProxyHost()); setProxyPort(httpFetcherConfig.getProxyPort()); + + setJwtIssuer(httpFetcherConfig.getJwtIssuer()); + setJwtExpiresInSeconds(httpFetcherConfig.getJwtExpiresInSeconds()); + setJwtSecret(httpFetcherConfig.getJwtIssuer()); + setJwtPrivateKeyBase64(httpFetcherConfig.getJwtPrivateKeyBase64()); + setJwtSubject(httpFetcherConfig.getJwtSubject()); } public static String HTTP_HEADER_PREFIX = "http-header:"; diff --git a/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/config/HttpFetcherConfig.java b/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/config/HttpFetcherConfig.java index 2683e7f55..a5bed636b 100644 --- a/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/config/HttpFetcherConfig.java +++ b/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/config/HttpFetcherConfig.java @@ -38,6 +38,12 @@ public class HttpFetcherConfig extends AbstractConfig { private long overallTimeout; private int maxErrMsgSize; private String userAgent; + private String jwtIssuer; + private String jwtSubject; + private int jwtExpiresInSeconds; + private String jwtSecret; + private String jwtPrivateKeyBase64; + public String getUserName() { return userName; @@ -191,4 +197,49 @@ public class HttpFetcherConfig extends AbstractConfig { this.userAgent = userAgent; return this; } + + public String getJwtIssuer() { + return jwtIssuer; + } + + public HttpFetcherConfig setJwtIssuer(String jwtIssuer) { + this.jwtIssuer = jwtIssuer; + return this; + } + + public String getJwtSubject() { + return jwtSubject; + } + + public HttpFetcherConfig setJwtSubject(String jwtSubject) { + this.jwtSubject = jwtSubject; + return this; + } + + public int getJwtExpiresInSeconds() { + return jwtExpiresInSeconds; + } + + public HttpFetcherConfig setJwtExpiresInSeconds(int jwtExpiresInSeconds) { + this.jwtExpiresInSeconds = jwtExpiresInSeconds; + return this; + } + + public String getJwtSecret() { + return jwtSecret; + } + + public HttpFetcherConfig setJwtSecret(String jwtSecret) { + this.jwtSecret = jwtSecret; + return this; + } + + public String getJwtPrivateKeyBase64() { + return jwtPrivateKeyBase64; + } + + public HttpFetcherConfig setJwtPrivateKeyBase64(String jwtPrivateKeyBase64) { + this.jwtPrivateKeyBase64 = jwtPrivateKeyBase64; + return this; + } }
