Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Replace AuthMode.OFF by AuthMode.NONE #951

Open
cbornet opened this issue Sep 12, 2018 · 2 comments
Open

Replace AuthMode.OFF by AuthMode.NONE #951

cbornet opened this issue Sep 12, 2018 · 2 comments

Comments

@cbornet
Copy link
Contributor

cbornet commented Sep 12, 2018

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.

@lmontrieux
Copy link
Contributor

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.

fbrns added a commit to fbrns/nakadi that referenced this issue Nov 9, 2018
fbrns added a commit to fbrns/nakadi that referenced this issue Mar 22, 2019
@adyach
Copy link
Member

adyach commented Apr 24, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants