fi.evolver.basics.spring.auth.NoOpAuthorizationService Maven / Gradle / Ivy
package fi.evolver.basics.spring.auth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Service;
@Service
@ConditionalOnExpression("!environment.containsProperty(T(fi.evolver.basics.spring.auth.JwtAuthorization).ENV_AUTHORIZATION_SECRET) or environment.containsProperty(\"DISABLE_INTERCEPTOR_AUTH\")")
public class NoOpAuthorizationService implements AuthorizationService {
private static final Logger LOG = LoggerFactory.getLogger(NoOpAuthorizationService.class);
public NoOpAuthorizationService() {
LOG.info("HttpInterceptor authentication disabled");
}
@Override
public void authenticate(String authenticationHeader) {
// no-op
}
@Override
public boolean hasPermission(String permission) {
LOG.debug("Implicitly granting permission {}", permission);
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy