package de.zalando.aruha.nakadi.config;

import org.springframework.beans.factory.annotation.Value;


public class SecuritySettings {

    public enum AuthMode {
        OFF,   // no authentication at all
        BASIC, // only checks that the token is valid (has "uid" scope)
        FULL   // full authentication and authorization using oauth2 scopes
    }

    private String tokenInfoUrl;
    private String clientId;
    private AuthMode authMode;
    private String adminClientId;

    public SecuritySettings(@Value("${nakadi.oauth2.tokenInfoUrl}") final String tokenInfoUrl,
                            @Value("${nakadi.oauth2.clientId}") final String clientId,
                            @Value("${nakadi.oauth2.mode:BASIC}") final AuthMode authMode,
                            @Value("${nakadi.oauth2.adminClientId}") final String adminClientId)
    {
        this.tokenInfoUrl = tokenInfoUrl;
        this.clientId = clientId;
        this.authMode = authMode;
        this.adminClientId = adminClientId;
    }

    public String getTokenInfoUrl() {
        return tokenInfoUrl;
    }

    public String getClientId() {
        return clientId;
    }

    public AuthMode getAuthMode() {
        return authMode;
    }

    public String getAdminClientId() {
        return adminClientId;
    }
}

@@ -34,16 +34,79 @@
 onfig;%0A%0A
+import org.springframework.beans.factory.annotation.Autowired;%0A
 import o
@@ -544,16 +544,31 @@
 entId;%0A%0A
+    @Autowired%0A
     publ

add settings autowired annotation