https://kotlinlang.org logo
#http4k
Title
# http4k
r

Razvan

08/12/2021, 9:56 AM
About OpenApi, if i create my one BasicAuthSecurity like copy paste of the existent one
Copy code
class FakeBasicAuthSecurity(realm: String,  credentials: Credentials, val name: String = "basicAuth") : Security {
        override val filter: Filter = ServerFilters.BasicAuth(realm, credentials )
        companion object
    }
and I use it in
Copy code
security = FakeBasicAuthSecurity("Backbone", Credentials("tom", "jerry"))
No Security is added generated spec, any reason why ?
d

dave

08/12/2021, 10:05 AM
you need to override the security renderer in the OpenApi3 constructor.
r

Razvan

08/12/2021, 10:13 AM
Ok thanks thought that the security name was enough to make the link,.. couldn't have been easier if we could just extend BasicAuthSecurity (i just want to allow any user/password in the authorization)
thanks that works, not very obvous
2 Views