From c07616abfad217ec71ec5ebfaa3f411e369f386b Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sat, 20 Aug 2022 16:28:42 +0200 Subject: [PATCH] Partially revert "Convert ODLAuthenticator into a component" This reverts commit f76949418fb149c1c29b08eb0283ca0351098308, and re-establishes instantiation of ODLAuthenticator from blueprint, as it is using static wiring provided by Blueprint. JIRA: AAA-215 Change-Id: Ie35f556a0d5292f2dd9ee243c68abaa0ac6cc10d Signed-off-by: Robert Varga --- .../aaa/authenticator/ODLAuthenticator.java | 10 ---------- .../resources/OSGI-INF/blueprint/impl-blueprint.xml | 3 +++ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/authenticator/ODLAuthenticator.java b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/authenticator/ODLAuthenticator.java index a9466e6e5..144530a4e 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/authenticator/ODLAuthenticator.java +++ b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/authenticator/ODLAuthenticator.java @@ -9,8 +9,6 @@ package org.opendaylight.aaa.authenticator; import java.nio.charset.StandardCharsets; import java.util.Base64; -import javax.inject.Inject; -import javax.inject.Singleton; import javax.servlet.http.HttpServletRequest; import org.apache.shiro.SecurityUtils; import org.apache.shiro.ShiroException; @@ -20,23 +18,15 @@ import org.apache.shiro.session.Session; import org.apache.shiro.session.UnknownSessionException; import org.apache.shiro.subject.Subject; import org.jolokia.osgi.security.Authenticator; -import org.osgi.service.component.annotations.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * AAA hook for odl-jolokia configured w/ org.jolokia.authMode=service-all. */ -@Singleton -@Component(immediate = true) public class ODLAuthenticator implements Authenticator { private static final Logger LOG = LoggerFactory.getLogger(ODLAuthenticator.class); - @Inject - public ODLAuthenticator() { - // Exposed for DI - } - @Override public boolean authenticate(final HttpServletRequest httpServletRequest) { final String authorization = httpServletRequest.getHeader("Authorization"); diff --git a/aaa-shiro/impl/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml b/aaa-shiro/impl/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml index 2742eb73d..6d8a78935 100644 --- a/aaa-shiro/impl/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml +++ b/aaa-shiro/impl/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml @@ -53,6 +53,9 @@ and is available at http://www.eclipse.org/legal/epl-v10.html + + + -- 2.36.6