nakadi icon indicating copy to clipboard operation
nakadi copied to clipboard

Replace AuthMode.OFF by AuthMode.NONE

Open cbornet opened this issue 6 years ago • 2 comments

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.

cbornet avatar Sep 12 '18 13:09 cbornet

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.

lmontrieux avatar Oct 04 '18 13:10 lmontrieux

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.

adyach avatar Apr 24 '19 07:04 adyach