Repair AuthenticationManager 12/93112/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Oct 2020 10:39:59 +0000 (12:39 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 21 Oct 2020 22:05:03 +0000 (22:05 +0000)
commit22e2e9cbc2504a3e3573c193aa89a68e13b4e125
tree21343f7513a2b8399dda1a880313ca0d448c1909
parentf53a86f7422ccad5f49dc38492c6cea33028dd14
Repair AuthenticationManager

AuthenticationManager was utterly wrecked in commit
193729d84ebb567d94e75311cd3bb871e7731b0b, which removed its
binding to CM, effectively meaning it was always disabled.

This is best evidenced by the unused bits in OSGI-INF/metatype,
the unpackaged authn.cfg file and the fact AuthenticationManager
is referencing them without having the BluePrint wiring to do so.

The primary problem is addressed by switching to OSGi DS, which
eliminates all run-time dependencies on OSGi, as it is purely
compile-time.

This flushes out the rest of the problems, as in order to drive
the OSGi CM integration we really need a configurationPID --
which investigation has shown to be long-lost
'org.opendaylight.aaa.authn'.

Furthermore OSGi CM integration really discourages use of properties,
preferring those be bound to a configuration object -- which points
to src/main/resources/OSGI-INF/metatype/ -- hence we ditch those XMLs
and replace them with Metatype Annotations.

Doing all this shifts property interpretation solely down to
ConfigAdmin -- hence we do not need to deal with at all, cleaning up
AuthenticationManagerTest.

Finally, to take advantage of all this work, we re-ingrate the new
component into blueprint as a simple service. We throw in proper
@Singleton annotation as a bonus.

JIRA: AAA-201
Change-Id: I51e23dc02836208774e8cdb8fb1a999537a691a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d2451de3fdb03702b02a18f6b26c275ea576a489)
(cherry picked from commit 4b941f4ee405396feebf763b63ffcc55e73018a8)
aaa-shiro/impl/pom.xml
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationManager.java
aaa-shiro/impl/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
aaa-shiro/impl/src/main/resources/OSGI-INF/metatype/metatype.properties [deleted file]
aaa-shiro/impl/src/main/resources/OSGI-INF/metatype/metatype.xml [deleted file]
aaa-shiro/impl/src/main/resources/authn.cfg
aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationManagerTest.java