From ed00346e71c0f40c0794c23a6bea319da02f76e2 Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Mon, 29 May 2023 10:15:38 -0400 Subject: [PATCH 01/10] v2.0.2 pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 199e53a..d0c3056 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.inteligr8 common-rest-client - 2.0.1 + 2.0.2 jar ReST API Client for Java From ec6e7cc15d435329a6ebdf0707e492ef25126dd5 Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Tue, 30 May 2023 12:44:41 -0400 Subject: [PATCH 02/10] v2.0.3 pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d0c3056..ed2a071 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.inteligr8 common-rest-client - 2.0.2 + 2.0.3 jar ReST API Client for Java From cd278bcc811b69bc38b01f55047909ac2ec0d0bb Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Tue, 30 May 2023 18:00:33 -0400 Subject: [PATCH 03/10] v2.0.4 pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ed2a071..311d171 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.inteligr8 common-rest-client - 2.0.3 + 2.0.4 jar ReST API Client for Java From f10fd39e97f2e7ad435f5f09946bb7c12e4264b2 Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Mon, 12 Jun 2023 16:10:25 -0400 Subject: [PATCH 04/10] v2.0.6 pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d24956e..0eeca80 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.inteligr8 common-rest-client - 2.0.4 + 2.0.6 jar ReST API Client for Java From 512f1183545a129da83c9b8816e10aa90665a444 Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Mon, 12 Jun 2023 17:23:23 -0400 Subject: [PATCH 05/10] v2.0.7 pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0eeca80..ca75bcd 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.inteligr8 common-rest-client - 2.0.6 + 2.0.7 jar ReST API Client for Java From 0258cfcb9a6cf6bd41f50e2cb34de6d3c106fbbd Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Thu, 29 Jun 2023 10:46:39 -0400 Subject: [PATCH 06/10] v2.0.8 pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ca75bcd..331eb7d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.inteligr8 common-rest-client - 2.0.7 + 2.0.8 jar ReST API Client for Java From d4cd2f248c198c93bd9dc63a2a4a392696abb2fc Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Tue, 23 Jan 2024 10:42:51 -0500 Subject: [PATCH 07/10] v2.0.9 pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 665ae56..0702c33 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.inteligr8 common-rest-client - 2.0.8 + 2.0.9 jar ReST API Client for Java From 271016dcf936a8cb1ab93daed6a0c31285ced374 Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Tue, 5 Mar 2024 18:49:07 -0500 Subject: [PATCH 08/10] v2.0.10 pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0702c33..2bed835 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.inteligr8 common-rest-client - 2.0.9 + 2.0.10 jar ReST API Client for Java From 795c9fef4483a937a128faafc3205e02cbed69b3 Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Fri, 28 Feb 2025 10:21:57 -0500 Subject: [PATCH 09/10] added header-based auth filter --- .../rs/HeaderAuthorizationFilter.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/main/java/com/inteligr8/rs/HeaderAuthorizationFilter.java diff --git a/src/main/java/com/inteligr8/rs/HeaderAuthorizationFilter.java b/src/main/java/com/inteligr8/rs/HeaderAuthorizationFilter.java new file mode 100644 index 0000000..8347950 --- /dev/null +++ b/src/main/java/com/inteligr8/rs/HeaderAuthorizationFilter.java @@ -0,0 +1,58 @@ +/* + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ +package com.inteligr8.rs; + +import java.io.UnsupportedEncodingException; +import java.util.List; +import java.util.Map.Entry; + +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; + +import jakarta.ws.rs.client.ClientRequestContext; + +/** + * This class implements a header-based authorization filter. + * + * @author brian@inteligr8.com + */ +public class HeaderAuthorizationFilter implements AuthorizationFilter { + + private final MultiValueMap headers = new LinkedMultiValueMap<>(); + + /** + * @param headers An array of header name/value pairs. + */ + public HeaderAuthorizationFilter(String headerName, String headerValue) { + this.headers.add(headerName, headerValue); + } + + public HeaderAuthorizationFilter add(String headerName, String headerValue) { + this.headers.add(headerName, headerValue); + return this; + } + + /** + * This method applies the 'Authorization' header to the {@link ClientRequestContext}. + * + * @param requestContext A request context. + */ + @Override + public void filter(ClientRequestContext requestContext) throws UnsupportedEncodingException { + for (Entry> header : this.headers.entrySet()) + requestContext.getHeaders().addAll(header.getKey(), header.getValue()); + } + +} From 6c58263903bb78f997486b7ea3bd00ee6d6817c4 Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Fri, 28 Feb 2025 10:24:22 -0500 Subject: [PATCH 10/10] v3.0.2 pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 069409f..49ad0ae 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.inteligr8 common-rest-client - 3.0.0 + 3.0.2 jar ReST API Client for Java