package de.zalando.aruha.nakadi.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

@Component
@Profile("!test")
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;

    @Autowired
    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;
    }
}

@@ -556,24 +556,30 @@
     private 
+final 
 String token
@@ -595,24 +595,30 @@
     private 
+final 
 String clien
@@ -634,16 +634,22 @@
 private 
+final 
 AuthMode
@@ -671,16 +671,22 @@
 private 
+final 
 String a

make fields final