dave
02/27/2021, 7:06 PMRazvan
02/27/2021, 7:40 PMsecurity = BearerAuthSecurity(key = credentials, ::mapVerification)
dave
02/27/2021, 7:43 PMRazvan
02/28/2021, 5:29 PMJettyHttp2Test
that fails with- No Server ALPNProcessors!
, but I don’t think is related, looks like arm jdk linked error) as I tried to look for tests concerning BearerAuthSecurity and couldn’t find guess there are some not unit ones somewhere.
There’s still a drawback, as the generic is set at the class level that requires to pass a class when you use others constructors. So there are some places like ContractRendererContract
where it was: security = BearerAuthSecurity("foo")
but now has to be security = BearerAuthSecurity<Any>("foo")
can’t think of how this could be avoided, but if you do, I’d be happy to learn. But if there’s none I’m not sure is clean to require to pass a class when you don’t use it.
There’s also the possibility to make a separate class for just the constructor with the ContextLens:
class BearerAuthSecurityContext<T> private constructor(override val filter: Filter, val name: String = "bearerAuth") : Security {
constructor(key: RequestContextLens<T>, lookup: (String) -> T?, name: String = "bearerAuth") : this(ServerFilters.BearerAuth(key, lookup), name)
companion object
}
but I’m not the lib designer not sure what option is better.