Repair AuthenticationManager 28/93228/6
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Oct 2020 10:39:59 +0000 (12:39 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Oct 2020 11:40:46 +0000 (13:40 +0200)
commitd2451de3fdb03702b02a18f6b26c275ea576a489
treea33b9498eb3f66381dcf36904220b23f9b2ffae8
parent8c98ce5b8bf6c48af643450bce013515c03ff07f
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>
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