nakadi
nakadi copied to clipboard
Replace AuthMode.OFF by AuthMode.NONE
When using application.yml to configure nakadi.oauth2.mode
YAML parser translates OFF
to false
if you don't put quotes and the Spring property binding fails with
Caused by: java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'org.zalando.nakadi.config.SecuritySettings$AuthMode': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:307)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:109)
at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:64)
... 98 more
The workaround is to add quotes like nakadi.oauth2.mode: "OFF"
but it is a bit awkward and you can miss it when running your service.
Adding a NONE value in the enum that has the same effect as OFF would prevent that and you could keep OFF for backward compatibility.
Thank you @cbornet for your suggestion. This looks like a nice improvement, and could be a good first issue for someone looking into contributing to Nakadi.
The workaround is to add quotes like nakadi.oauth2.mode: "OFF" but it is a bit awkward and you can miss it when running your service.
@lmontrieux @cbornet could you please elaborate on that? for me it is not clear what the issue is to have quotes.