All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fi.evolver.basics.spring.auth.NoOpAuthorizationService Maven / Gradle / Ivy

There is a newer version: 6.5.1
Show newest version
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