Refactor Shiro/HTTP integration 63/101763/7
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 6 Jul 2022 17:08:03 +0000 (19:08 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 6 Jul 2022 21:17:42 +0000 (23:17 +0200)
commit58bfb23476aa02f7f44e6c8d92816ca83f572282
tree512eba1898eb9447b135236cd5b2527b6f12d4fb
parenta5723d7c1d01af762804f2a2bb7102f7b65e18de
Refactor Shiro/HTTP integration

ShiroFilter is designed to work with EnvironmentLoaderListener, both of
which are designed to work with web.xml.

We are in programmatic-land, hence the indirection through
ServletContext lifecycle is completely unnecessary and actually is
hurtful, as we cannot smuggle WebEnvironment through OSGi HTTP
Whiteboard -- it requires String properties when coupled with
ServletContextHelper.

Here we create a much more direct connection, where AAAWebEnvironment
is eagerly-initialized and it is passed directly to AAAShiroFilter. This
allows us to use AbstractShiroFilter only without having to dance around
init() methods -- and eliminate binding to to static SecurityManager
wiring as well.

JIRA: AAA-225
Change-Id: Id3990dd533b5e60f3781f9e4cdc3114163ecb931
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/filters/AAAShiroFilter.java
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/AAAIniWebEnvironment.java [deleted file]
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/AAAWebEnvironment.java [new file with mode: 0644]
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ShiroWebContextSecurer.java
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ShiroWebEnvironmentLoaderListener.java [deleted file]
aaa-shiro/impl/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml