refactor: 💡 Loggers via Lombok
parent
570fdfda2d
commit
26b5a99817
|
@ -185,6 +185,10 @@
|
|||
<groupId>org.springframework.security.extensions</groupId>
|
||||
<artifactId>spring-security-saml2-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.Collection;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -29,10 +30,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @param <T> the type parameter
|
||||
* @author Colm Smyth.
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class AbstractPageOperationTemplate<T> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AbstractPageOperationTemplate.class);
|
||||
|
||||
private static final int DEFAULT_MAX_PAGES = 1000;
|
||||
private static final long DEFAULT_MAX_TIME_MILLIS = 600000L; //10 Minutes
|
||||
|
||||
|
@ -91,7 +91,7 @@ public abstract class AbstractPageOperationTemplate<T> {
|
|||
* swallowException (default true) field is set true.
|
||||
*/
|
||||
public void execute(){
|
||||
logger.debug("[{}] Starting execution of paged operation. max time: {}, max pages: {}", getOperationName(), maxTime, maxPages);
|
||||
log.debug("[{}] Starting execution of paged operation. max time: {}, max pages: {}", getOperationName(), maxTime, maxPages);
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
long executionTime = 0;
|
||||
|
@ -115,9 +115,9 @@ public abstract class AbstractPageOperationTemplate<T> {
|
|||
if(swallowExceptions){
|
||||
exceptionsSwallowedCount++;
|
||||
exceptionsSwallowedClasses.add(e.getClass().getName());
|
||||
logger.debug("Swallowing exception " + e.getMessage(), e);
|
||||
log.debug("Swallowing exception " + e.getMessage(), e);
|
||||
} else {
|
||||
logger.debug("Rethrowing exception " + e.getMessage());
|
||||
log.debug("Rethrowing exception " + e.getMessage());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
@ -149,11 +149,11 @@ public abstract class AbstractPageOperationTemplate<T> {
|
|||
*/
|
||||
protected void finalReport(int operationsCompleted, int exceptionsSwallowedCount, Set<String> exceptionsSwallowedClasses) {
|
||||
if (operationsCompleted > 0 || exceptionsSwallowedCount > 0) {
|
||||
logger.info("[{}] Paged operation run: completed {}; swallowed {} exceptions",
|
||||
log.info("[{}] Paged operation run: completed {}; swallowed {} exceptions",
|
||||
getOperationName(), operationsCompleted, exceptionsSwallowedCount);
|
||||
}
|
||||
for(String className: exceptionsSwallowedClasses) {
|
||||
logger.warn("[{}] Paged operation swallowed at least one exception of type {}", getOperationName(), className);
|
||||
log.warn("[{}] Paged operation swallowed at least one exception of type {}", getOperationName(), className);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ package cz.muni.ics.discovery.util;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -33,10 +34,9 @@ import com.google.common.base.Strings;
|
|||
*
|
||||
* @author wkim
|
||||
*/
|
||||
@Slf4j
|
||||
public class WebfingerURLNormalizer {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(WebfingerURLNormalizer.class);
|
||||
|
||||
// pattern used to parse user input; we can't use the built-in java URI parser
|
||||
private static final Pattern pattern = Pattern.compile("^" +
|
||||
"((https|acct|http|mailto|tel|device):(//)?)?" + // scheme
|
||||
|
@ -63,7 +63,7 @@ public class WebfingerURLNormalizer {
|
|||
// NOTE: we can't use the Java built-in URI class because it doesn't split the parts appropriately
|
||||
|
||||
if (StringUtils.isEmpty(identifier)) {
|
||||
logger.warn("Can't normalize null or empty URI: " + identifier);
|
||||
log.warn("Can't normalize null or empty URI: " + identifier);
|
||||
return null;
|
||||
} else {
|
||||
UriComponentsBuilder builder = UriComponentsBuilder.newInstance();
|
||||
|
@ -81,7 +81,7 @@ public class WebfingerURLNormalizer {
|
|||
builder.query(m.group(13));
|
||||
builder.fragment(m.group(15)); // we throw away the hash, but this is the group it would be if we kept it
|
||||
} else {
|
||||
logger.warn("Parser couldn't match input: {}", identifier);
|
||||
log.warn("Parser couldn't match input: {}", identifier);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.util.Map;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
@ -47,8 +48,8 @@ import com.google.gson.JsonObject;
|
|||
*
|
||||
*/
|
||||
@Component("webfingerView")
|
||||
@Slf4j
|
||||
public class WebfingerView extends AbstractView {
|
||||
private static final Logger logger = LoggerFactory.getLogger(WebfingerView.class);
|
||||
|
||||
private final Gson gson = new GsonBuilder()
|
||||
.setExclusionStrategies(new ExclusionStrategy() {
|
||||
|
@ -95,7 +96,7 @@ public class WebfingerView extends AbstractView {
|
|||
Writer out = response.getWriter();
|
||||
gson.toJson(obj, out);
|
||||
} catch (IOException e) {
|
||||
logger.error("IOException in WebfingerView.java: ", e);
|
||||
log.error("IOException in WebfingerView.java: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ import cz.muni.ics.oauth2.web.RevocationEndpoint;
|
|||
import cz.muni.ics.openid.connect.config.ConfigurationPropertiesBean;
|
||||
import cz.muni.ics.openid.connect.model.UserInfo;
|
||||
import cz.muni.ics.openid.connect.service.UserInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -66,10 +67,9 @@ import com.nimbusds.jose.JWSAlgorithm;
|
|||
*
|
||||
*/
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class DiscoveryEndpoint {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DiscoveryEndpoint.class);
|
||||
|
||||
public static final String WELL_KNOWN_URL = ".well-known";
|
||||
public static final String OPENID_CONFIGURATION_URL = WELL_KNOWN_URL + "/openid-configuration";
|
||||
public static final String WEBFINGER_URL = WELL_KNOWN_URL + "/webfinger";
|
||||
|
@ -100,7 +100,7 @@ public class DiscoveryEndpoint {
|
|||
@RequestParam(value = "rel", required = false) String rel,
|
||||
Model model) {
|
||||
if (!Strings.isNullOrEmpty(rel) && !rel.equals(ISSUER_STRING)) {
|
||||
logger.warn("Responding to webfinger request for non-OIDC relation: {}", rel);
|
||||
log.warn("Responding to webfinger request for non-OIDC relation: {}", rel);
|
||||
}
|
||||
|
||||
if (!resource.equals(config.getIssuer())) {
|
||||
|
@ -111,7 +111,7 @@ public class DiscoveryEndpoint {
|
|||
&& resourceUri.getScheme().equals("acct")) {
|
||||
UserInfo user = extractUser(resourceUri);
|
||||
if (user == null) {
|
||||
logger.info("User not found: {}", resource);
|
||||
log.info("User not found: {}", resource);
|
||||
model.addAttribute(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
|
@ -119,12 +119,12 @@ public class DiscoveryEndpoint {
|
|||
UriComponents issuerComponents = UriComponentsBuilder.fromHttpUrl(config.getIssuer()).build();
|
||||
if (!Strings.nullToEmpty(issuerComponents.getHost())
|
||||
.equals(Strings.nullToEmpty(resourceUri.getHost()))) {
|
||||
logger.info("Host mismatch, expected " + issuerComponents.getHost() + " got " + resourceUri.getHost());
|
||||
log.info("Host mismatch, expected " + issuerComponents.getHost() + " got " + resourceUri.getHost());
|
||||
model.addAttribute(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
} else {
|
||||
logger.info("Unknown URI format: " + resource);
|
||||
log.info("Unknown URI format: " + resource);
|
||||
model.addAttribute(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ public class DiscoveryEndpoint {
|
|||
String baseUrl = config.getIssuer();
|
||||
|
||||
if (!baseUrl.endsWith("/")) {
|
||||
logger.debug("Configured issuer doesn't end in /, adding for discovery: {}", baseUrl);
|
||||
log.debug("Configured issuer doesn't end in /, adding for discovery: {}", baseUrl);
|
||||
baseUrl = baseUrl.concat("/");
|
||||
}
|
||||
|
||||
|
|
|
@ -3,15 +3,15 @@ package cz.muni.ics.jwt.assertion;
|
|||
import com.nimbusds.jwt.JWT;
|
||||
import com.nimbusds.jwt.JWTClaimsSet;
|
||||
import com.nimbusds.jwt.SignedJWT;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
@Slf4j
|
||||
public abstract class AbstractAssertionValidator implements AssertionValidator {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AbstractAssertionValidator.class);
|
||||
|
||||
/**
|
||||
* Extract issuer from claims present in JWT assertion.
|
||||
* @param assertion JWT assertion object.
|
||||
|
@ -26,7 +26,7 @@ public abstract class AbstractAssertionValidator implements AssertionValidator {
|
|||
try {
|
||||
claims = assertion.getJWTClaimsSet();
|
||||
} catch (ParseException e) {
|
||||
logger.debug("Invalid assertion claims");
|
||||
log.debug("Invalid assertion claims");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import cz.muni.ics.jwt.signer.service.JWTSigningAndValidationService;
|
|||
import cz.muni.ics.jwt.assertion.AbstractAssertionValidator;
|
||||
import cz.muni.ics.jwt.assertion.AssertionValidator;
|
||||
import cz.muni.ics.openid.connect.config.ConfigurationPropertiesBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -35,10 +36,9 @@ import org.springframework.util.StringUtils;
|
|||
* @author jricher
|
||||
*/
|
||||
@Component("selfAssertionValidator")
|
||||
@Slf4j
|
||||
public class SelfAssertionValidator extends AbstractAssertionValidator implements AssertionValidator {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SelfAssertionValidator.class);
|
||||
|
||||
private final ConfigurationPropertiesBean config;
|
||||
private final JWTSigningAndValidationService jwtService;
|
||||
|
||||
|
@ -52,10 +52,10 @@ public class SelfAssertionValidator extends AbstractAssertionValidator implement
|
|||
public boolean isValid(JWT assertion) {
|
||||
String issuer = extractIssuer(assertion);
|
||||
if (StringUtils.isEmpty(issuer)) {
|
||||
logger.debug("No issuer for assertion, rejecting");
|
||||
log.debug("No issuer for assertion, rejecting");
|
||||
return false;
|
||||
} else if (!issuer.equals(config.getIssuer())) {
|
||||
logger.debug("Issuer is not the same as this server, rejecting");
|
||||
log.debug("Issuer is not the same as this server, rejecting");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import cz.muni.ics.jwt.signer.service.JWTSigningAndValidationService;
|
|||
import cz.muni.ics.jwt.assertion.AbstractAssertionValidator;
|
||||
import cz.muni.ics.jwt.assertion.AssertionValidator;
|
||||
import cz.muni.ics.jwt.signer.service.impl.JWKSetCacheService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -33,10 +34,9 @@ import java.util.Map;
|
|||
* Checks to see if the assertion has been signed by a particular authority available from a whitelist
|
||||
* @author jricher
|
||||
*/
|
||||
@Slf4j
|
||||
public class WhitelistedIssuerAssertionValidator extends AbstractAssertionValidator implements AssertionValidator {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(WhitelistedIssuerAssertionValidator.class);
|
||||
|
||||
private Map<String, String> whitelist = new HashMap<>(); //Map of issuer -> JWKSetUri
|
||||
private JWKSetCacheService jwkCache;
|
||||
|
||||
|
@ -60,10 +60,10 @@ public class WhitelistedIssuerAssertionValidator extends AbstractAssertionValida
|
|||
public boolean isValid(JWT assertion) {
|
||||
String issuer = extractIssuer(assertion);
|
||||
if (StringUtils.isEmpty(issuer)) {
|
||||
logger.debug("No issuer for assertion, rejecting");
|
||||
log.debug("No issuer for assertion, rejecting");
|
||||
return false;
|
||||
} else if (!whitelist.containsKey(issuer)) {
|
||||
logger.debug("Issuer is not in whitelist, rejecting");
|
||||
log.debug("Issuer is not in whitelist, rejecting");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.util.Set;
|
|||
import javax.annotation.PostConstruct;
|
||||
|
||||
import com.nimbusds.jose.KeyLengthException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -53,10 +54,9 @@ import org.springframework.util.StringUtils;
|
|||
/**
|
||||
* @author wkim
|
||||
*/
|
||||
@Slf4j
|
||||
public class DefaultJWTEncryptionAndDecryptionService implements JWTEncryptionAndDecryptionService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultJWTEncryptionAndDecryptionService.class);
|
||||
|
||||
private final Map<String, JWEEncrypter> encrypters = new HashMap<>();
|
||||
private final Map<String, JWEDecrypter> decrypters = new HashMap<>();
|
||||
private String defaultEncryptionKeyId;
|
||||
|
@ -157,7 +157,7 @@ public class DefaultJWTEncryptionAndDecryptionService implements JWTEncryptionAn
|
|||
try {
|
||||
jwt.encrypt(encrypter);
|
||||
} catch (JOSEException e) {
|
||||
logger.error("Failed to encrypt JWT, error was: ", e);
|
||||
log.error("Failed to encrypt JWT, error was: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ public class DefaultJWTEncryptionAndDecryptionService implements JWTEncryptionAn
|
|||
try {
|
||||
jwt.decrypt(decrypter);
|
||||
} catch (JOSEException e) {
|
||||
logger.error("Failed to decrypt JWT, error was: ", e);
|
||||
log.error("Failed to decrypt JWT, error was: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class DefaultJWTEncryptionAndDecryptionService implements JWTEncryptionAn
|
|||
} else if (jwk instanceof OctetSequenceKey) {
|
||||
handleOctetSeqKey(id, jwk);
|
||||
} else {
|
||||
logger.warn("Unknown key type: {}", jwk);
|
||||
log.warn("Unknown key type: {}", jwk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ public class DefaultJWTEncryptionAndDecryptionService implements JWTEncryptionAn
|
|||
decrypter.getJCAContext().setProvider(BouncyCastleProviderSingleton.getInstance());
|
||||
decrypters.put(id, decrypter);
|
||||
} else {
|
||||
logger.warn("No private key for key #{}", jwk.getKeyID());
|
||||
log.warn("No private key for key #{}", jwk.getKeyID());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ public class DefaultJWTEncryptionAndDecryptionService implements JWTEncryptionAn
|
|||
decrypter.getJCAContext().setProvider(BouncyCastleProviderSingleton.getInstance());
|
||||
decrypters.put(id, decrypter);
|
||||
} else {
|
||||
logger.warn("No private key for key #{}", jwk.getKeyID());
|
||||
log.warn("No private key for key #{}", jwk.getKeyID());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import cz.muni.ics.jwt.encryption.service.impl.DefaultJWTEncryptionAndDecryptionService;
|
||||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -48,10 +49,9 @@ import org.springframework.util.StringUtils;
|
|||
* @author jricher
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ClientKeyCacheService {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(ClientKeyCacheService.class);
|
||||
|
||||
private JWKSetCacheService jwksUriCache;
|
||||
private SymmetricKeyJWTValidatorCacheService symmetricCache;
|
||||
private LoadingCache<JWKSet, JWTSigningAndValidationService> jwksValidators;
|
||||
|
@ -103,7 +103,7 @@ public class ClientKeyCacheService {
|
|||
return null;
|
||||
}
|
||||
} catch (UncheckedExecutionException | ExecutionException e) {
|
||||
logger.error("Problem loading client validator", e);
|
||||
log.error("Problem loading client validator", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class ClientKeyCacheService {
|
|||
return null;
|
||||
}
|
||||
} catch (UncheckedExecutionException | ExecutionException e) {
|
||||
logger.error("Problem loading client encrypter", e);
|
||||
log.error("Problem loading client encrypter", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.nimbusds.jose.jwk.RSAKey;
|
|||
import com.nimbusds.jwt.SignedJWT;
|
||||
import cz.muni.ics.jose.keystore.JWKSetKeyStore;
|
||||
import cz.muni.ics.jwt.signer.service.JWTSigningAndValidationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -47,10 +48,9 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
@Slf4j
|
||||
public class DefaultJWTSigningAndValidationService implements JWTSigningAndValidationService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultJWTSigningAndValidationService.class);
|
||||
|
||||
private final Map<String, JWSSigner> signers = new HashMap<>();
|
||||
private final Map<String, JWSVerifier> verifiers = new HashMap<>();
|
||||
|
||||
|
@ -126,7 +126,7 @@ public class DefaultJWTSigningAndValidationService implements JWTSigningAndValid
|
|||
try {
|
||||
jwt.sign(signer);
|
||||
} catch (JOSEException e) {
|
||||
logger.error("Failed to sign JWT, error was: ", e);
|
||||
log.error("Failed to sign JWT, error was: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,12 +142,12 @@ public class DefaultJWTSigningAndValidationService implements JWTSigningAndValid
|
|||
}
|
||||
|
||||
if (signer == null) {
|
||||
logger.error("No matching algorithm found for alg={}", alg);
|
||||
log.error("No matching algorithm found for alg={}", alg);
|
||||
} else {
|
||||
try {
|
||||
jwt.sign(signer);
|
||||
} catch (JOSEException e) {
|
||||
logger.error("Failed to sign JWT, error was: ", e);
|
||||
log.error("Failed to sign JWT, error was: ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ public class DefaultJWTSigningAndValidationService implements JWTSigningAndValid
|
|||
try {
|
||||
return jwt.verify(verifier);
|
||||
} catch (JOSEException e) {
|
||||
logger.error("Failed to validate signature with {} error message: {}", verifier, e.getMessage());
|
||||
log.error("Failed to validate signature with {} error message: {}", verifier, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,10 +201,10 @@ public class DefaultJWTSigningAndValidationService implements JWTSigningAndValid
|
|||
} else if (jwk instanceof OctetSequenceKey) {
|
||||
processOctetKey(signers, verifiers, jwk, id);
|
||||
} else {
|
||||
logger.warn("Unknown key type: {}", jwk);
|
||||
log.warn("Unknown key type: {}", jwk);
|
||||
}
|
||||
} catch (JOSEException e) {
|
||||
logger.warn("Exception loading signer/verifier", e);
|
||||
log.warn("Exception loading signer/verifier", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import cz.muni.ics.jwt.signer.service.JWTSigningAndValidationService;
|
|||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import cz.muni.ics.jwt.encryption.service.impl.DefaultJWTEncryptionAndDecryptionService;
|
||||
|
@ -50,10 +51,9 @@ import com.nimbusds.jose.jwk.JWKSet;
|
|||
* @author jricher
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class JWKSetCacheService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(JWKSetCacheService.class);
|
||||
|
||||
private final LoadingCache<String, JWTSigningAndValidationService> validators;
|
||||
private final LoadingCache<String, JWTEncryptionAndDecryptionService> encrypters;
|
||||
|
||||
|
@ -72,7 +72,7 @@ public class JWKSetCacheService {
|
|||
try {
|
||||
return validators.get(jwksUri);
|
||||
} catch (UncheckedExecutionException | ExecutionException e) {
|
||||
logger.warn("Couldn't load JWK Set from {}: {}", jwksUri, e.getMessage());
|
||||
log.warn("Couldn't load JWK Set from {}: {}", jwksUri, e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class JWKSetCacheService {
|
|||
try {
|
||||
return encrypters.get(jwksUri);
|
||||
} catch (UncheckedExecutionException | ExecutionException e) {
|
||||
logger.warn("Couldn't load JWK Set from {}: {}", jwksUri, e.getMessage());
|
||||
log.warn("Couldn't load JWK Set from {}: {}", jwksUri, e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.nimbusds.jose.jwk.OctetSequenceKey;
|
|||
import com.nimbusds.jose.util.Base64URL;
|
||||
import cz.muni.ics.jwt.signer.service.JWTSigningAndValidationService;
|
||||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -41,10 +42,9 @@ import java.util.concurrent.TimeUnit;
|
|||
* @author jricher
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SymmetricKeyJWTValidatorCacheService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SymmetricKeyJWTValidatorCacheService.class);
|
||||
|
||||
private final LoadingCache<String, JWTSigningAndValidationService> validators;
|
||||
|
||||
public SymmetricKeyJWTValidatorCacheService() {
|
||||
|
@ -56,17 +56,17 @@ public class SymmetricKeyJWTValidatorCacheService {
|
|||
|
||||
public JWTSigningAndValidationService getSymmetricValidator(ClientDetailsEntity client) {
|
||||
if (client == null) {
|
||||
logger.error("Couldn't create symmetric validator for null client");
|
||||
log.error("Couldn't create symmetric validator for null client");
|
||||
return null;
|
||||
} else if (StringUtils.isEmpty(client.getClientSecret())) {
|
||||
logger.error("Couldn't create symmetric validator for client {} without a client secret", client.getClientId());
|
||||
log.error("Couldn't create symmetric validator for client {} without a client secret", client.getClientId());
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return validators.get(client.getClientSecret());
|
||||
} catch (UncheckedExecutionException | ExecutionException ue) {
|
||||
logger.error("Problem loading client validator", ue);
|
||||
log.error("Problem loading client validator", ue);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cz.muni.ics.mdc;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MDC;
|
||||
|
@ -11,10 +12,9 @@ import javax.servlet.ServletRequest;
|
|||
import javax.servlet.ServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
@Slf4j
|
||||
public class MultiMDCFilter extends GenericFilterBean {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MultiMDCFilter.class);
|
||||
|
||||
private final RemoteAddressMDCFilter remoteAddressMDCFilter;
|
||||
private final SessionIdMDCFilter sessionIdMDCFilter;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.text.ParseException;
|
|||
import javax.persistence.AttributeConverter;
|
||||
import javax.persistence.Converter;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -30,10 +31,9 @@ import com.nimbusds.jose.jwk.JWKSet;
|
|||
* @author jricher
|
||||
*/
|
||||
@Converter
|
||||
@Slf4j
|
||||
public class JWKSetStringConverter implements AttributeConverter<JWKSet, String> {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(JWKSetStringConverter.class);
|
||||
|
||||
@Override
|
||||
public String convertToDatabaseColumn(JWKSet attribute) {
|
||||
return attribute != null ? attribute.toString() : null;
|
||||
|
@ -45,7 +45,7 @@ public class JWKSetStringConverter implements AttributeConverter<JWKSet, String>
|
|||
try {
|
||||
return JWKSet.parse(dbData);
|
||||
} catch (ParseException e) {
|
||||
logger.error("Unable to parse JWK Set", e);
|
||||
log.error("Unable to parse JWK Set", e);
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.text.ParseException;
|
|||
import javax.persistence.AttributeConverter;
|
||||
import javax.persistence.Converter;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -31,10 +32,9 @@ import com.nimbusds.jwt.JWTParser;
|
|||
* @author jricher
|
||||
*/
|
||||
@Converter
|
||||
@Slf4j
|
||||
public class JWTStringConverter implements AttributeConverter<JWT, String> {
|
||||
|
||||
public static Logger logger = LoggerFactory.getLogger(JWTStringConverter.class);
|
||||
|
||||
@Override
|
||||
public String convertToDatabaseColumn(JWT attribute) {
|
||||
return attribute != null ? attribute.serialize() : null;
|
||||
|
@ -46,7 +46,7 @@ public class JWTStringConverter implements AttributeConverter<JWT, String> {
|
|||
try {
|
||||
return JWTParser.parse(dbData);
|
||||
} catch (ParseException e) {
|
||||
logger.error("Unable to parse JWT", e);
|
||||
log.error("Unable to parse JWT", e);
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.Date;
|
|||
import javax.persistence.AttributeConverter;
|
||||
import javax.persistence.Converter;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -35,10 +36,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @author jricher
|
||||
*/
|
||||
@Converter
|
||||
@Slf4j
|
||||
public class SerializableStringConverter implements AttributeConverter<Serializable, String> {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(SerializableStringConverter.class);
|
||||
|
||||
@Override
|
||||
public String convertToDatabaseColumn(Serializable attribute) {
|
||||
if (attribute == null) {
|
||||
|
@ -50,7 +50,7 @@ public class SerializableStringConverter implements AttributeConverter<Serializa
|
|||
} else if (attribute instanceof Date) {
|
||||
return Long.toString(((Date)attribute).getTime());
|
||||
} else {
|
||||
logger.warn("Dropping data from request: {} :: {}", attribute, attribute.getClass());
|
||||
log.warn("Dropping data from request: {} :: {}", attribute, attribute.getClass());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
|||
import cz.muni.ics.openid.connect.model.ApprovedSite;
|
||||
import cz.muni.ics.uma.model.ResourceSet;
|
||||
import cz.muni.ics.util.jpa.JpaUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
@ -51,12 +52,11 @@ import com.nimbusds.jwt.JWT;
|
|||
import com.nimbusds.jwt.JWTParser;
|
||||
|
||||
@Repository
|
||||
@Slf4j
|
||||
public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
||||
|
||||
private static final int MAXEXPIREDRESULTS = 1000;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(JpaOAuth2TokenRepository.class);
|
||||
|
||||
@PersistenceContext(unitName="defaultPersistenceUnit")
|
||||
private EntityManager manager;
|
||||
|
||||
|
@ -242,7 +242,7 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
|||
List<Object[]> resultList = query.getResultList();
|
||||
List<JWT> values = new ArrayList<>();
|
||||
for (Object[] r : resultList) {
|
||||
logger.warn("Found duplicate access tokens: {}, {}", ((JWT)r[0]).serialize(), r[1]);
|
||||
log.warn("Found duplicate access tokens: {}, {}", ((JWT)r[0]).serialize(), r[1]);
|
||||
values.add((JWT) r[0]);
|
||||
}
|
||||
if (values.size() > 0) {
|
||||
|
@ -251,7 +251,7 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
|||
Root<OAuth2AccessTokenEntity> root = criteriaDelete.from(OAuth2AccessTokenEntity.class);
|
||||
criteriaDelete.where(root.get("jwt").in(values));
|
||||
int result = manager.createQuery(criteriaDelete).executeUpdate();
|
||||
logger.warn("Deleted {} duplicate access tokens", result);
|
||||
log.warn("Deleted {} duplicate access tokens", result);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
|||
List<Object[]> resultList = query.getResultList();
|
||||
List<JWT> values = new ArrayList<>();
|
||||
for (Object[] r : resultList) {
|
||||
logger.warn("Found duplicate refresh tokens: {}, {}", ((JWT)r[0]).serialize(), r[1]);
|
||||
log.warn("Found duplicate refresh tokens: {}, {}", ((JWT)r[0]).serialize(), r[1]);
|
||||
values.add((JWT) r[0]);
|
||||
}
|
||||
if (values.size() > 0) {
|
||||
|
@ -272,7 +272,7 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
|||
Root<OAuth2RefreshTokenEntity> root = criteriaDelete.from(OAuth2RefreshTokenEntity.class);
|
||||
criteriaDelete.where(root.get("jwt").in(values));
|
||||
int result = manager.createQuery(criteriaDelete).executeUpdate();
|
||||
logger.warn("Deleted {} duplicate refresh tokens", result);
|
||||
log.warn("Deleted {} duplicate refresh tokens", result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ package cz.muni.ics.oauth2.service.impl;
|
|||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import cz.muni.ics.openid.connect.config.ConfigurationPropertiesBean;
|
||||
import cz.muni.ics.openid.connect.service.BlacklistedSiteService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -53,10 +54,9 @@ import java.util.Set;
|
|||
*
|
||||
*/
|
||||
@Component("blacklistAwareRedirectResolver")
|
||||
@Slf4j
|
||||
public class BlacklistAwareRedirectResolver implements RedirectResolver {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BlacklistAwareRedirectResolver.class);
|
||||
|
||||
@Autowired
|
||||
private BlacklistedSiteService blacklistService;
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import cz.muni.ics.oauth2.service.IntrospectionResultAssembler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
|
@ -38,13 +39,9 @@ import com.google.common.collect.Sets;
|
|||
* Default implementation of the {@link IntrospectionResultAssembler} interface.
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DefaultIntrospectionResultAssembler implements IntrospectionResultAssembler {
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class);
|
||||
|
||||
@Override
|
||||
public Map<String, Object> assembleFrom(OAuth2AccessTokenEntity accessToken, UserInfo userInfo, Set<String> authScopes) {
|
||||
|
||||
|
@ -79,7 +76,7 @@ public class DefaultIntrospectionResultAssembler implements IntrospectionResultA
|
|||
result.put(EXPIRES_AT, dateFormat.valueToString(accessToken.getExpiration()));
|
||||
result.put(EXP, accessToken.getExpiration().getTime() / 1000L);
|
||||
} catch (ParseException e) {
|
||||
logger.error("Parse exception in token introspection", e);
|
||||
log.error("Parse exception in token introspection", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +116,7 @@ public class DefaultIntrospectionResultAssembler implements IntrospectionResultA
|
|||
result.put(EXPIRES_AT, dateFormat.valueToString(refreshToken.getExpiration()));
|
||||
result.put(EXP, refreshToken.getExpiration().getTime() / 1000L);
|
||||
} catch (ParseException e) {
|
||||
logger.error("Parse exception in token introspection", e);
|
||||
log.error("Parse exception in token introspection", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import cz.muni.ics.oauth2.repository.AuthorizationCodeRepository;
|
|||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -45,9 +46,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
*
|
||||
*/
|
||||
@Service("defaultOAuth2AuthorizationCodeService")
|
||||
@Slf4j
|
||||
public class DefaultOAuth2AuthorizationCodeService implements AuthorizationCodeServices {
|
||||
// Logger for this class
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultOAuth2AuthorizationCodeService.class);
|
||||
|
||||
@Autowired
|
||||
private AuthorizationCodeRepository repository;
|
||||
|
|
|
@ -25,6 +25,7 @@ import com.google.common.util.concurrent.UncheckedExecutionException;
|
|||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
import cz.muni.ics.oauth2.repository.OAuth2TokenRepository;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
|
@ -64,13 +65,9 @@ import java.util.concurrent.ExecutionException;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEntityService {
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class);
|
||||
|
||||
@Autowired
|
||||
private OAuth2ClientRepository clientRepository;
|
||||
|
||||
|
@ -437,7 +434,7 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
|
|||
@Override
|
||||
public ClientDetailsEntity generateClientSecret(ClientDetailsEntity client) {
|
||||
if (config.isHeartMode()) {
|
||||
logger.error("[HEART mode] Can't generate a client secret, skipping step; client won't be saved due to invalid configuration");
|
||||
log.error("[HEART mode] Can't generate a client secret, skipping step; client won't be saved due to invalid configuration");
|
||||
client.setClientSecret(null);
|
||||
} else {
|
||||
client.setClientSecret(Base64.encodeBase64URLSafeString(new BigInteger(512, new SecureRandom()).toByteArray()).replace("=", ""));
|
||||
|
@ -468,7 +465,7 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
|
|||
if (config.isForceHttps()) {
|
||||
throw new IllegalArgumentException("Sector identifier must start with https: " + key);
|
||||
}
|
||||
logger.error("Sector identifier doesn't start with https, loading anyway...");
|
||||
log.error("Sector identifier doesn't start with https, loading anyway...");
|
||||
}
|
||||
|
||||
// key is the sector URI
|
||||
|
@ -481,7 +478,7 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
|
|||
redirectUris.add(el.getAsString());
|
||||
}
|
||||
|
||||
logger.info("Found " + redirectUris + " for sector " + key);
|
||||
log.info("Found " + redirectUris + " for sector " + key);
|
||||
|
||||
return redirectUris;
|
||||
} else {
|
||||
|
|
|
@ -59,6 +59,7 @@ import cz.muni.ics.oauth2.service.OAuth2TokenEntityService;
|
|||
import cz.muni.ics.oauth2.service.SystemScopeService;
|
||||
import cz.muni.ics.openid.connect.model.ApprovedSite;
|
||||
import cz.muni.ics.openid.connect.service.ApprovedSiteService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -86,13 +87,9 @@ import com.nimbusds.jwt.PlainJWT;
|
|||
*
|
||||
*/
|
||||
@Service("defaultOAuth2ProviderTokenService")
|
||||
@Slf4j
|
||||
public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityService {
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);
|
||||
|
||||
@Autowired
|
||||
private OAuth2TokenRepository tokenRepository;
|
||||
|
||||
|
@ -147,7 +144,7 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
|
|||
return null;
|
||||
} else if (token.isExpired()) {
|
||||
// immediately revoke expired token
|
||||
logger.debug("Clearing expired access token: " + token.getValue());
|
||||
log.debug("Clearing expired access token: " + token.getValue());
|
||||
revokeAccessToken(token);
|
||||
return null;
|
||||
} else {
|
||||
|
@ -165,7 +162,7 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
|
|||
return null;
|
||||
} else if (token.isExpired()) {
|
||||
// immediately revoke expired token
|
||||
logger.debug("Clearing expired refresh token: " + token.getValue());
|
||||
log.debug("Clearing expired refresh token: " + token.getValue());
|
||||
revokeRefreshToken(token);
|
||||
return null;
|
||||
} else {
|
||||
|
@ -207,7 +204,7 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
|
|||
throw new InvalidRequestException("Code challenge and verifier do not match");
|
||||
}
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
logger.error("Unknown algorithm for PKCE digest", e);
|
||||
log.error("Unknown algorithm for PKCE digest", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -375,7 +372,7 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
|
|||
token.setScope(scopeService.toStrings(scope));
|
||||
} else {
|
||||
String errorMsg = "Up-scoping is not allowed.";
|
||||
logger.error(errorMsg);
|
||||
log.error(errorMsg);
|
||||
throw new InvalidScopeException(errorMsg);
|
||||
}
|
||||
} else {
|
||||
|
@ -493,7 +490,7 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
|
|||
*/
|
||||
@Override
|
||||
public void clearExpiredTokens() {
|
||||
logger.debug("Cleaning out all expired tokens");
|
||||
log.debug("Cleaning out all expired tokens");
|
||||
|
||||
new AbstractPageOperationTemplate<OAuth2AccessTokenEntity>("clearExpiredAccessTokens") {
|
||||
@Override
|
||||
|
|
|
@ -27,6 +27,7 @@ import cz.muni.ics.jwt.assertion.AssertionValidator;
|
|||
import cz.muni.ics.oauth2.assertion.AssertionOAuth2RequestFactory;
|
||||
import cz.muni.ics.oauth2.service.OAuth2TokenEntityService;
|
||||
import cz.muni.ics.openid.connect.assertion.JWTBearerAssertionAuthenticationToken;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
@ -46,6 +47,7 @@ import com.nimbusds.jwt.JWTParser;
|
|||
*
|
||||
*/
|
||||
@Component("jwtAssertionTokenGranter")
|
||||
@Slf4j
|
||||
public class JWTAssertionTokenGranter extends AbstractTokenGranter {
|
||||
|
||||
private static final String grantType = "urn:ietf:params:oauth:grant-type:jwt-bearer";
|
||||
|
@ -80,12 +82,12 @@ public class JWTAssertionTokenGranter extends AbstractTokenGranter {
|
|||
new JWTBearerAssertionAuthenticationToken(assertion, client.getAuthorities()));
|
||||
|
||||
} else {
|
||||
logger.warn("Incoming assertion did not pass validator, rejecting");
|
||||
log.warn("Incoming assertion did not pass validator, rejecting");
|
||||
return null;
|
||||
}
|
||||
|
||||
} catch (ParseException e) {
|
||||
logger.warn("Unable to parse incoming assertion");
|
||||
log.warn("Unable to parse incoming assertion");
|
||||
}
|
||||
|
||||
// if we had made a token, we'd have returned it by now, so return null here to close out with no created token
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.util.Map;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
@ -45,15 +46,11 @@ import com.google.gson.JsonSerializationContext;
|
|||
import com.google.gson.JsonSerializer;
|
||||
|
||||
@Component(TokenApiView.VIEWNAME)
|
||||
@Slf4j
|
||||
public class TokenApiView extends AbstractView {
|
||||
|
||||
public static final String VIEWNAME = "tokenApiView";
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(TokenApiView.class);
|
||||
|
||||
private Gson gson = new GsonBuilder()
|
||||
.setExclusionStrategies(new ExclusionStrategy() {
|
||||
|
||||
|
@ -142,7 +139,7 @@ public class TokenApiView extends AbstractView {
|
|||
|
||||
} catch (IOException e) {
|
||||
|
||||
logger.error("IOException in JsonEntityView.java: ", e);
|
||||
log.error("IOException in JsonEntityView.java: ", e);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ import java.util.Set;
|
|||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import cz.muni.ics.oauth2.service.DeviceCodeService;
|
||||
import cz.muni.ics.oauth2.service.SystemScopeService;
|
||||
|
@ -70,13 +71,12 @@ import com.google.common.collect.Sets;
|
|||
*
|
||||
*/
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class DeviceEndpoint {
|
||||
|
||||
public static final String URL = "devicecode";
|
||||
public static final String USER_URL = "device";
|
||||
|
||||
public static final Logger logger = LoggerFactory.getLogger(DeviceEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
private ClientDetailsEntityService clientService;
|
||||
|
||||
|
@ -108,13 +108,13 @@ public class DeviceEndpoint {
|
|||
}
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.error("IllegalArgumentException was thrown when attempting to load client", e);
|
||||
log.error("IllegalArgumentException was thrown when attempting to load client", e);
|
||||
model.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
|
||||
if (client == null) {
|
||||
logger.error("could not find client " + clientId);
|
||||
log.error("could not find client " + clientId);
|
||||
model.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class DeviceEndpoint {
|
|||
|
||||
if (!scopeService.scopesMatch(allowedScopes, requestedScopes)) {
|
||||
// client asked for scopes it can't have
|
||||
logger.error("Client asked for " + requestedScopes + " but is allowed " + allowedScopes);
|
||||
log.error("Client asked for " + requestedScopes + " but is allowed " + allowedScopes);
|
||||
model.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
|
||||
model.put(JsonErrorView.ERROR, "invalid_scope");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
|
@ -164,7 +164,7 @@ public class DeviceEndpoint {
|
|||
|
||||
return JsonErrorView.VIEWNAME;
|
||||
} catch (URISyntaxException use) {
|
||||
logger.error("unable to build verification_uri_complete due to wrong syntax of uri components");
|
||||
log.error("unable to build verification_uri_complete due to wrong syntax of uri components");
|
||||
model.put(HttpCodeView.CODE, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
|
||||
return HttpCodeView.VIEWNAME;
|
||||
|
|
|
@ -35,6 +35,7 @@ import java.util.Set;
|
|||
import cz.muni.ics.oauth2.service.IntrospectionResultAssembler;
|
||||
import cz.muni.ics.oauth2.service.OAuth2TokenEntityService;
|
||||
import cz.muni.ics.oauth2.service.SystemScopeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -51,6 +52,7 @@ import com.google.common.base.Strings;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class IntrospectionEndpoint {
|
||||
|
||||
/**
|
||||
|
@ -73,11 +75,6 @@ public class IntrospectionEndpoint {
|
|||
@Autowired
|
||||
private ResourceSetService resourceSetService;
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(IntrospectionEndpoint.class);
|
||||
|
||||
public IntrospectionEndpoint() {
|
||||
|
||||
}
|
||||
|
@ -131,7 +128,7 @@ public class IntrospectionEndpoint {
|
|||
|
||||
// this client isn't allowed to do direct introspection
|
||||
|
||||
logger.error("Client " + authClient.getClientId() + " is not allowed to call introspection endpoint");
|
||||
log.error("Client " + authClient.getClientId() + " is not allowed to call introspection endpoint");
|
||||
model.addAttribute("code", HttpStatus.FORBIDDEN);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
|
||||
|
@ -143,7 +140,7 @@ public class IntrospectionEndpoint {
|
|||
|
||||
// first make sure the token is there
|
||||
if (Strings.isNullOrEmpty(tokenValue)) {
|
||||
logger.error("Verify failed; token value is null");
|
||||
log.error("Verify failed; token value is null");
|
||||
Map<String,Boolean> entity = ImmutableMap.of("active", Boolean.FALSE);
|
||||
model.addAttribute(JsonEntityView.ENTITY, entity);
|
||||
return JsonEntityView.VIEWNAME;
|
||||
|
@ -166,7 +163,7 @@ public class IntrospectionEndpoint {
|
|||
user = userInfoService.getByUsernameAndClientId(userName, tokenClient.getClientId());
|
||||
|
||||
} catch (InvalidTokenException e) {
|
||||
logger.info("Invalid access token. Checking refresh token.");
|
||||
log.info("Invalid access token. Checking refresh token.");
|
||||
try {
|
||||
|
||||
// check refresh tokens next
|
||||
|
@ -179,7 +176,7 @@ public class IntrospectionEndpoint {
|
|||
user = userInfoService.getByUsernameAndClientId(userName, tokenClient.getClientId());
|
||||
|
||||
} catch (InvalidTokenException e2) {
|
||||
logger.error("Invalid refresh token");
|
||||
log.error("Invalid refresh token");
|
||||
Map<String,Boolean> entity = ImmutableMap.of(IntrospectionResultAssembler.ACTIVE, Boolean.FALSE);
|
||||
model.addAttribute(JsonEntityView.ENTITY, entity);
|
||||
return JsonEntityView.VIEWNAME;
|
||||
|
@ -196,7 +193,7 @@ public class IntrospectionEndpoint {
|
|||
model.addAttribute(JsonEntityView.ENTITY, entity);
|
||||
} else {
|
||||
// no tokens were found (we shouldn't get here)
|
||||
logger.error("Verify failed; Invalid access/refresh token");
|
||||
log.error("Verify failed; Invalid access/refresh token");
|
||||
Map<String,Boolean> entity = ImmutableMap.of(IntrospectionResultAssembler.ACTIVE, Boolean.FALSE);
|
||||
model.addAttribute(JsonEntityView.ENTITY, entity);
|
||||
return JsonEntityView.VIEWNAME;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package cz.muni.ics.oauth2.web;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -32,15 +33,15 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
|||
*
|
||||
*/
|
||||
@ControllerAdvice
|
||||
@Slf4j
|
||||
public class OAuth2ExceptionHandler {
|
||||
private static final Logger logger = LoggerFactory.getLogger(OAuth2ExceptionHandler.class);
|
||||
|
||||
@Autowired
|
||||
private WebResponseExceptionTranslator providerExceptionHandler;
|
||||
|
||||
@ExceptionHandler(OAuth2Exception.class)
|
||||
public ResponseEntity<OAuth2Exception> handleException(Exception e) throws Exception {
|
||||
logger.info("Handling error: " + e.getClass().getSimpleName() + ", " + e.getMessage());
|
||||
log.info("Handling error: " + e.getClass().getSimpleName() + ", " + e.getMessage());
|
||||
return providerExceptionHandler.translate(e);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import cz.muni.ics.openid.connect.request.ConnectRequestParameters;
|
|||
import cz.muni.ics.openid.connect.service.ScopeClaimTranslationService;
|
||||
import cz.muni.ics.openid.connect.service.UserInfoService;
|
||||
import cz.muni.ics.openid.connect.view.HttpCodeView;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -61,9 +62,9 @@ import java.util.Set;
|
|||
*/
|
||||
@Controller
|
||||
@SessionAttributes("authorizationRequest")
|
||||
@Slf4j
|
||||
public class OAuthConfirmationController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ClientDetailsEntityService clientService;
|
||||
|
||||
|
@ -79,11 +80,6 @@ public class OAuthConfirmationController {
|
|||
@Autowired
|
||||
private RedirectResolver redirectResolver;
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(OAuthConfirmationController.class);
|
||||
|
||||
public OAuthConfirmationController() {
|
||||
|
||||
}
|
||||
|
@ -106,17 +102,17 @@ public class OAuthConfirmationController {
|
|||
try {
|
||||
client = clientService.loadClientByClientId(authRequest.getClientId());
|
||||
} catch (OAuth2Exception e) {
|
||||
logger.error("confirmAccess: OAuth2Exception was thrown when attempting to load client", e);
|
||||
log.error("confirmAccess: OAuth2Exception was thrown when attempting to load client", e);
|
||||
model.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.error("confirmAccess: IllegalArgumentException was thrown when attempting to load client", e);
|
||||
log.error("confirmAccess: IllegalArgumentException was thrown when attempting to load client", e);
|
||||
model.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
|
||||
if (client == null) {
|
||||
logger.error("confirmAccess: could not find client " + authRequest.getClientId());
|
||||
log.error("confirmAccess: could not find client " + authRequest.getClientId());
|
||||
model.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
|
@ -137,7 +133,7 @@ public class OAuthConfirmationController {
|
|||
return "redirect:" + uriBuilder.toString();
|
||||
|
||||
} catch (URISyntaxException e) {
|
||||
logger.error("Can't build redirect URI for prompt=none, sending error instead", e);
|
||||
log.error("Can't build redirect URI for prompt=none, sending error instead", e);
|
||||
model.put("code", HttpStatus.FORBIDDEN);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import cz.muni.ics.oauth2.service.ClientDetailsEntityService;
|
|||
import cz.muni.ics.openid.connect.view.HttpCodeView;
|
||||
import cz.muni.ics.oauth2.service.OAuth2TokenEntityService;
|
||||
import cz.muni.ics.oauth2.service.SystemScopeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -40,6 +41,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class RevocationEndpoint {
|
||||
@Autowired
|
||||
private ClientDetailsEntityService clientService;
|
||||
|
@ -47,11 +49,6 @@ public class RevocationEndpoint {
|
|||
@Autowired
|
||||
private OAuth2TokenEntityService tokenServices;
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(RevocationEndpoint.class);
|
||||
|
||||
public static final String URL = "revoke";
|
||||
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_CLIENT')")
|
||||
|
@ -92,7 +89,7 @@ public class RevocationEndpoint {
|
|||
if (!accessToken.getClient().getClientId().equals(authClient.getClientId())) {
|
||||
// trying to revoke a token we don't own, throw a 403
|
||||
|
||||
logger.info("Client " + authClient.getClientId() + " tried to revoke a token owned by " + accessToken.getClient().getClientId());
|
||||
log.info("Client " + authClient.getClientId() + " tried to revoke a token owned by " + accessToken.getClient().getClientId());
|
||||
|
||||
model.addAttribute(HttpCodeView.CODE, HttpStatus.FORBIDDEN);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
|
@ -101,7 +98,7 @@ public class RevocationEndpoint {
|
|||
// if we got this far, we're allowed to do this
|
||||
tokenServices.revokeAccessToken(accessToken);
|
||||
|
||||
logger.debug("Client " + authClient.getClientId() + " revoked access token " + tokenValue);
|
||||
log.debug("Client " + authClient.getClientId() + " revoked access token " + tokenValue);
|
||||
|
||||
model.addAttribute(HttpCodeView.CODE, HttpStatus.OK);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
|
@ -116,7 +113,7 @@ public class RevocationEndpoint {
|
|||
if (!refreshToken.getClient().getClientId().equals(authClient.getClientId())) {
|
||||
// trying to revoke a token we don't own, throw a 403
|
||||
|
||||
logger.info("Client " + authClient.getClientId() + " tried to revoke a token owned by " + refreshToken.getClient().getClientId());
|
||||
log.info("Client " + authClient.getClientId() + " tried to revoke a token owned by " + refreshToken.getClient().getClientId());
|
||||
|
||||
model.addAttribute(HttpCodeView.CODE, HttpStatus.FORBIDDEN);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
|
@ -125,7 +122,7 @@ public class RevocationEndpoint {
|
|||
// if we got this far, we're allowed to do this
|
||||
tokenServices.revokeRefreshToken(refreshToken);
|
||||
|
||||
logger.debug("Client " + authClient.getClientId() + " revoked access token " + tokenValue);
|
||||
log.debug("Client " + authClient.getClientId() + " revoked access token " + tokenValue);
|
||||
|
||||
model.addAttribute(HttpCodeView.CODE, HttpStatus.OK);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
|
@ -134,7 +131,7 @@ public class RevocationEndpoint {
|
|||
|
||||
// neither token type was found, simply say "OK" and be on our way.
|
||||
|
||||
logger.debug("Failed to revoke token " + tokenValue);
|
||||
log.debug("Failed to revoke token " + tokenValue);
|
||||
|
||||
model.addAttribute(HttpCodeView.CODE, HttpStatus.OK);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
|
|
|
@ -28,6 +28,7 @@ import cz.muni.ics.openid.connect.web.RootController;
|
|||
import java.util.Set;
|
||||
|
||||
import cz.muni.ics.oauth2.service.SystemScopeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -50,6 +51,7 @@ import com.google.gson.Gson;
|
|||
@Controller
|
||||
@RequestMapping("/" + ScopeAPI.URL)
|
||||
@PreAuthorize("hasRole('ROLE_USER')")
|
||||
@Slf4j
|
||||
public class ScopeAPI {
|
||||
|
||||
public static final String URL = RootController.API_URL + "/scopes";
|
||||
|
@ -57,11 +59,6 @@ public class ScopeAPI {
|
|||
@Autowired
|
||||
private SystemScopeService scopeService;
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(ScopeAPI.class);
|
||||
|
||||
private Gson gson = new Gson();
|
||||
|
||||
@RequestMapping(value = "", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
|
@ -86,7 +83,7 @@ public class ScopeAPI {
|
|||
return JsonEntityView.VIEWNAME;
|
||||
} else {
|
||||
|
||||
logger.error("getScope failed; scope not found: " + id);
|
||||
log.error("getScope failed; scope not found: " + id);
|
||||
|
||||
m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "The requested scope with id " + id + " could not be found.");
|
||||
|
@ -114,7 +111,7 @@ public class ScopeAPI {
|
|||
return JsonEntityView.VIEWNAME;
|
||||
} else {
|
||||
|
||||
logger.error("updateScope failed; scope ids to not match: got "
|
||||
log.error("updateScope failed; scope ids to not match: got "
|
||||
+ existing.getId() + " and " + scope.getId());
|
||||
|
||||
m.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
|
||||
|
@ -125,7 +122,7 @@ public class ScopeAPI {
|
|||
|
||||
} else {
|
||||
|
||||
logger.error("updateScope failed; scope with id " + id + " not found.");
|
||||
log.error("updateScope failed; scope with id " + id + " not found.");
|
||||
m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "Could not update scope. The scope with id " + id + " could not be found.");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
|
@ -140,7 +137,7 @@ public class ScopeAPI {
|
|||
SystemScope alreadyExists = scopeService.getByValue(scope.getValue());
|
||||
if (alreadyExists != null) {
|
||||
//Error, cannot save a scope with the same value as an existing one
|
||||
logger.error("Error: attempting to save a scope with a value that already exists: " + scope.getValue());
|
||||
log.error("Error: attempting to save a scope with a value that already exists: " + scope.getValue());
|
||||
m.put(HttpCodeView.CODE, HttpStatus.CONFLICT);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "A scope with value " + scope.getValue() + " already exists, please choose a different value.");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
|
@ -155,7 +152,7 @@ public class ScopeAPI {
|
|||
return JsonEntityView.VIEWNAME;
|
||||
} else {
|
||||
|
||||
logger.error("createScope failed; JSON was invalid: " + json);
|
||||
log.error("createScope failed; JSON was invalid: " + json);
|
||||
m.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "Could not save new scope " + scope + ". The scope service failed to return a saved entity.");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
|
@ -175,7 +172,7 @@ public class ScopeAPI {
|
|||
return HttpCodeView.VIEWNAME;
|
||||
} else {
|
||||
|
||||
logger.error("deleteScope failed; scope with id " + id + " not found.");
|
||||
log.error("deleteScope failed; scope with id " + id + " not found.");
|
||||
m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "Could not delete scope. The requested scope with id " + id + " could not be found.");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
|
|
|
@ -32,6 +32,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import cz.muni.ics.oauth2.service.OAuth2TokenEntityService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -52,6 +53,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|||
@Controller
|
||||
@RequestMapping("/" + TokenAPI.URL)
|
||||
@PreAuthorize("hasRole('ROLE_USER')")
|
||||
@Slf4j
|
||||
public class TokenAPI {
|
||||
|
||||
public static final String URL = RootController.API_URL + "/tokens";
|
||||
|
@ -65,11 +67,6 @@ public class TokenAPI {
|
|||
@Autowired
|
||||
private OIDCTokenService oidcTokenService;
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(TokenAPI.class);
|
||||
|
||||
@RequestMapping(value = "/access", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public String getAllAccessTokens(ModelMap m, Principal p) {
|
||||
|
||||
|
@ -84,12 +81,12 @@ public class TokenAPI {
|
|||
OAuth2AccessTokenEntity token = tokenService.getAccessTokenById(id);
|
||||
|
||||
if (token == null) {
|
||||
logger.error("getToken failed; token not found: " + id);
|
||||
log.error("getToken failed; token not found: " + id);
|
||||
m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "The requested token with id " + id + " could not be found.");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
} else if (!token.getAuthenticationHolder().getAuthentication().getName().equals(p.getName())) {
|
||||
logger.error("getToken failed; token does not belong to principal " + p.getName());
|
||||
log.error("getToken failed; token does not belong to principal " + p.getName());
|
||||
m.put(HttpCodeView.CODE, HttpStatus.FORBIDDEN);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "You do not have permission to view this token");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
|
@ -105,12 +102,12 @@ public class TokenAPI {
|
|||
OAuth2AccessTokenEntity token = tokenService.getAccessTokenById(id);
|
||||
|
||||
if (token == null) {
|
||||
logger.error("getToken failed; token not found: " + id);
|
||||
log.error("getToken failed; token not found: " + id);
|
||||
m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "The requested token with id " + id + " could not be found.");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
} else if (!token.getAuthenticationHolder().getAuthentication().getName().equals(p.getName())) {
|
||||
logger.error("getToken failed; token does not belong to principal " + p.getName());
|
||||
log.error("getToken failed; token does not belong to principal " + p.getName());
|
||||
m.put(HttpCodeView.CODE, HttpStatus.FORBIDDEN);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "You do not have permission to view this token");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
|
@ -207,12 +204,12 @@ public class TokenAPI {
|
|||
OAuth2RefreshTokenEntity token = tokenService.getRefreshTokenById(id);
|
||||
|
||||
if (token == null) {
|
||||
logger.error("refresh token not found: " + id);
|
||||
log.error("refresh token not found: " + id);
|
||||
m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "The requested token with id " + id + " could not be found.");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
} else if (!token.getAuthenticationHolder().getAuthentication().getName().equals(p.getName())) {
|
||||
logger.error("refresh token " + id + " does not belong to principal " + p.getName());
|
||||
log.error("refresh token " + id + " does not belong to principal " + p.getName());
|
||||
m.put(HttpCodeView.CODE, HttpStatus.FORBIDDEN);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "You do not have permission to view this token");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
|
@ -228,12 +225,12 @@ public class TokenAPI {
|
|||
OAuth2RefreshTokenEntity token = tokenService.getRefreshTokenById(id);
|
||||
|
||||
if (token == null) {
|
||||
logger.error("refresh token not found: " + id);
|
||||
log.error("refresh token not found: " + id);
|
||||
m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "The requested token with id " + id + " could not be found.");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
} else if (!token.getAuthenticationHolder().getAuthentication().getName().equals(p.getName())) {
|
||||
logger.error("refresh token " + id + " does not belong to principal " + p.getName());
|
||||
log.error("refresh token " + id + " does not belong to principal " + p.getName());
|
||||
m.put(HttpCodeView.CODE, HttpStatus.FORBIDDEN);
|
||||
m.put(JsonErrorView.ERROR_MESSAGE, "You do not have permission to view this token");
|
||||
return JsonErrorView.VIEWNAME;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cz.muni.ics.oidc.aop;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
|
@ -9,10 +10,9 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
@Aspect
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ExecutionTimeLoggingAspect {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(ExecutionTimeLoggingAspect.class);
|
||||
|
||||
@Around("@annotation(LogTimes) && execution(* cz.muni.ics.oidc.server.connectors..* (..))")
|
||||
public Object logExecutionTimeForConnectorsWithParams(ProceedingJoinPoint pjp) throws Throwable {
|
||||
return LoggingUtils.logExecutionTimes(log, pjp);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cz.muni.ics.oidc.aop;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.AfterThrowing;
|
||||
|
@ -10,10 +11,9 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
@Aspect
|
||||
@Component
|
||||
@Slf4j
|
||||
public class MapperLoggingAspect {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(MapperLoggingAspect.class);
|
||||
|
||||
@AfterReturning(value = "execution(* cz.muni.ics.oidc.models.mappers..* (..))", returning = "result")
|
||||
public Object logAroundMethodWithParams(JoinPoint jp, Object result) {
|
||||
return LoggingUtils.logExecutionEnd(log, jp, result);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cz.muni.ics.oidc.aop;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.AfterThrowing;
|
||||
|
@ -10,10 +11,9 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
@Aspect
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ServerLoggingAspect {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(ServerLoggingAspect.class);
|
||||
|
||||
@AfterReturning(value = "execution(* cz.muni.ics.oidc.server..* (..))", returning = "result")
|
||||
public Object logAroundMethodWithParams(JoinPoint jp, Object result) {
|
||||
return LoggingUtils.logExecutionEnd(log, jp, result);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cz.muni.ics.oidc.aop;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.AfterThrowing;
|
||||
|
@ -10,10 +11,9 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
@Aspect
|
||||
@Component
|
||||
@Slf4j
|
||||
public class WebLoggingAspect {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(WebLoggingAspect.class);
|
||||
|
||||
@AfterReturning(value = "execution(* cz.muni.ics.oidc.web..* (..))", returning = "result")
|
||||
public Object logAroundMethodWithParams(JoinPoint jp, Object result) {
|
||||
return LoggingUtils.logExecutionEnd(log, jp, result);
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.net.URLDecoder;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler;
|
||||
|
@ -15,10 +16,9 @@ import org.springframework.util.MultiValueMap;
|
|||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
@Slf4j
|
||||
public class PerunOidcLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunOidcLogoutSuccessHandler.class);
|
||||
|
||||
@Override
|
||||
protected String determineTargetUrl(HttpServletRequest request, HttpServletResponse response) {
|
||||
String targetUrl = super.determineTargetUrl(request, response);
|
||||
|
|
|
@ -4,6 +4,7 @@ import cz.muni.ics.oidc.models.PerunUser;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
|
@ -12,10 +13,9 @@ import org.springframework.security.core.userdetails.User;
|
|||
import org.springframework.security.saml.SAMLAuthenticationProvider;
|
||||
import org.springframework.security.saml.SAMLCredential;
|
||||
|
||||
@Slf4j
|
||||
public class PerunSamlAuthenticationProvider extends SAMLAuthenticationProvider {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunSamlAuthenticationProvider.class);
|
||||
|
||||
private static final GrantedAuthority ROLE_USER = new SimpleGrantedAuthority("ROLE_USER");
|
||||
private static final GrantedAuthority ROLE_ADMIN = new SimpleGrantedAuthority("ROLE_ADMIN");
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.util.stream.Collectors;
|
|||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.opensaml.saml2.core.AuthnContext;
|
||||
import org.opensaml.saml2.core.AuthnContextClassRef;
|
||||
import org.opensaml.saml2.core.AuthnStatement;
|
||||
|
@ -20,10 +21,9 @@ import org.springframework.security.saml.SAMLCredential;
|
|||
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
|
||||
import org.springframework.security.web.authentication.WebAuthenticationDetails;
|
||||
|
||||
@Slf4j
|
||||
public class PerunSamlAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunSamlAuthenticationSuccessHandler.class);
|
||||
|
||||
@Override
|
||||
public void onAuthenticationSuccess(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Set;
|
|||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.opensaml.common.SAMLException;
|
||||
import org.opensaml.saml2.metadata.AssertionConsumerService;
|
||||
import org.opensaml.saml2.metadata.SPSSODescriptor;
|
||||
|
@ -42,10 +43,9 @@ import org.springframework.security.saml.util.SAMLUtil;
|
|||
import org.springframework.security.saml.websso.WebSSOProfileOptions;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@Slf4j
|
||||
public class PerunSamlEntryPoint extends SAMLEntryPoint {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunSamlEntryPoint.class);
|
||||
|
||||
private final PerunAdapter perunAdapter;
|
||||
private final PerunOidcConfig config;
|
||||
private final FacilityAttrsConfig facilityAttrsConfig;
|
||||
|
|
|
@ -7,16 +7,16 @@ import javax.servlet.ServletRequest;
|
|||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.saml.SAMLProcessingFilter;
|
||||
|
||||
@Slf4j
|
||||
public class PerunSamlProcessingFilter extends SAMLProcessingFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunSamlProcessingFilter.class);
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
|
|
|
@ -3,6 +3,7 @@ package cz.muni.ics.oidc.saml;
|
|||
import cz.muni.ics.oidc.server.PerunPrincipal;
|
||||
import cz.muni.ics.oidc.server.adapters.PerunAdapter;
|
||||
import cz.muni.ics.oidc.server.filters.FiltersUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -10,10 +11,9 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
|||
import org.springframework.security.saml.SAMLCredential;
|
||||
import org.springframework.security.saml.userdetails.SAMLUserDetailsService;
|
||||
|
||||
@Slf4j
|
||||
public class PerunSamlUserDetailsService implements SAMLUserDetailsService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunSamlUserDetailsService.class);
|
||||
|
||||
private final PerunAdapter perunAdapter;
|
||||
private final SamlProperties samlProperties;
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@ import static cz.muni.ics.oidc.server.filters.PerunFilterConstants.PROMPT_SELECT
|
|||
|
||||
import cz.muni.ics.oidc.server.filters.PerunFilterConstants;
|
||||
import javax.servlet.ServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@Slf4j
|
||||
public class PerunSamlUtils {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunSamlUtils.class);
|
||||
|
||||
public static boolean needsReAuthByPrompt(ServletRequest request) {
|
||||
String prompt = request.getParameter(PARAM_PROMPT);
|
||||
boolean res = (StringUtils.hasText(prompt) && (PROMPT_LOGIN.equalsIgnoreCase(prompt)
|
||||
|
|
|
@ -13,6 +13,7 @@ import javax.servlet.ServletRequest;
|
|||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
|
||||
|
@ -20,9 +21,9 @@ import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
|||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.filter.GenericFilterBean;
|
||||
|
||||
@Slf4j
|
||||
public class SamlInvalidateSessionFilter extends GenericFilterBean {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SamlInvalidateSessionFilter.class);
|
||||
private final AntPathRequestMatcher matcher;
|
||||
|
||||
private final SecurityContextLogoutHandler contextLogoutHandler;
|
||||
|
|
|
@ -5,15 +5,15 @@ import java.net.MalformedURLException;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@Slf4j
|
||||
public class SamlProperties implements InitializingBean {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SamlProperties.class);
|
||||
|
||||
private String entityID;
|
||||
private String keystoreLocation;
|
||||
private String keystorePassword;
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.util.Objects;
|
|||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -25,10 +26,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class AttributeMappingsService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AttributeMappingsService.class);
|
||||
|
||||
private static final String LDAP_NAME = ".mapping.ldap";
|
||||
private static final String RPC_NAME = ".mapping.rpc";
|
||||
private static final String TYPE = ".type";
|
||||
|
|
|
@ -2,6 +2,7 @@ package cz.muni.ics.oidc.server;
|
|||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.sql.DataSource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.javacrumbs.shedlock.core.LockAssert;
|
||||
import net.javacrumbs.shedlock.core.LockProvider;
|
||||
import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider;
|
||||
|
@ -25,12 +26,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@Configuration
|
||||
@EnableScheduling
|
||||
@EnableSchedulerLock(defaultLockAtMostFor = "30s")
|
||||
@Slf4j
|
||||
public class CustomTaskScheduler {
|
||||
|
||||
private static final long ONE_MINUTE = 60000L;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(CustomTaskScheduler.class);
|
||||
|
||||
private final CustomClearTasks customClearTasks;
|
||||
private final DataSource dataSource;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import cz.muni.ics.openid.connect.config.ConfigurationPropertiesBean;
|
|||
import cz.muni.ics.openid.connect.model.UserInfo;
|
||||
import cz.muni.ics.openid.connect.service.OIDCTokenService;
|
||||
import cz.muni.ics.openid.connect.service.UserInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -37,10 +38,9 @@ import org.springframework.security.oauth2.provider.token.TokenEnhancer;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunAccessTokenEnhancer implements TokenEnhancer {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunAccessTokenEnhancer.class);
|
||||
|
||||
private final ConfigurationPropertiesBean configBean;
|
||||
private final JWTSigningAndValidationService jwtService;
|
||||
private final ClientDetailsEntityService clientService;
|
||||
|
|
|
@ -9,6 +9,7 @@ import cz.muni.ics.oauth2.service.impl.DefaultIntrospectionResultAssembler;
|
|||
import cz.muni.ics.openid.connect.config.ConfigurationPropertiesBean;
|
||||
import cz.muni.ics.openid.connect.model.UserInfo;
|
||||
import cz.muni.ics.openid.connect.service.ScopeClaimTranslationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -18,10 +19,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunIntrospectionResultAssembler extends DefaultIntrospectionResultAssembler {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunIntrospectionResultAssembler.class);
|
||||
|
||||
private final ConfigurationPropertiesBean configBean;
|
||||
private final ScopeClaimTranslationService translator;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
|||
import java.text.ParseException;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.minidev.json.JSONArray;
|
||||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import cz.muni.ics.oauth2.model.OAuth2AccessTokenEntity;
|
||||
|
@ -28,10 +29,9 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunOIDCTokenService extends DefaultOIDCTokenService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunOIDCTokenService.class);
|
||||
|
||||
public static final String SESSION_PARAM_ACR = "acr";
|
||||
|
||||
private final UserInfoService userInfoService;
|
||||
|
|
|
@ -7,6 +7,7 @@ import cz.muni.ics.oidc.server.userInfo.PerunUserInfoService;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import cz.muni.ics.openid.connect.service.ScopeClaimTranslationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -18,10 +19,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunScopeClaimTranslationService implements ScopeClaimTranslationService {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunScopeClaimTranslationService.class);
|
||||
|
||||
public static final String OPENID = "openid";
|
||||
public static final String PROFILE = "profile";
|
||||
public static final String EMAIL = "email";
|
||||
|
|
|
@ -61,6 +61,7 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.directory.api.ldap.model.entry.Attribute;
|
||||
import org.apache.directory.api.ldap.model.entry.Entry;
|
||||
import org.apache.directory.api.ldap.model.entry.Value;
|
||||
|
@ -77,10 +78,9 @@ import org.springframework.util.StringUtils;
|
|||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
* @author Martin Kuba makub@ics.muni.cz
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunAdapterLdap extends PerunAdapterWithMappingServices implements PerunAdapterMethods, PerunAdapterMethodsLdap {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunAdapterLdap.class);
|
||||
|
||||
private PerunConnectorLdap connectorLdap;
|
||||
private String oidcClientIdAttr;
|
||||
private String oidcCheckMembershipAttr;
|
||||
|
|
|
@ -44,6 +44,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -55,10 +56,9 @@ import org.springframework.util.StringUtils;
|
|||
* @author Dominik František Bučík bucik@ics.muni.cz
|
||||
* @author Peter Jancus jancus@ics.muni.cz
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunAdapterRpc extends PerunAdapterWithMappingServices implements PerunAdapterMethods, PerunAdapterMethodsRpc {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunAdapterRpc.class);
|
||||
|
||||
private PerunConnectorRpc connectorRpc;
|
||||
|
||||
private String oidcClientIdAttr;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cz.muni.ics.oidc.server.claims;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -10,10 +11,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class ClaimModifier {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ClaimModifier.class);
|
||||
|
||||
private final String claimName;
|
||||
private final String modifierName;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package cz.muni.ics.oidc.server.claims;
|
||||
|
||||
import java.util.Properties;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -9,10 +10,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class ClaimModifierInitContext {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ClaimModifierInitContext.class);
|
||||
|
||||
private final String propertyPrefix;
|
||||
private final Properties properties;
|
||||
private final String claimName;
|
||||
|
|
|
@ -2,6 +2,7 @@ package cz.muni.ics.oidc.server.claims;
|
|||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -12,10 +13,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class ClaimSource {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ClaimSource.class);
|
||||
|
||||
private final String claimName;
|
||||
|
||||
public ClaimSource(ClaimSourceInitContext ctx) {
|
||||
|
|
|
@ -3,6 +3,7 @@ package cz.muni.ics.oidc.server.claims;
|
|||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import java.util.Properties;
|
||||
import cz.muni.ics.jwt.signer.service.JWTSigningAndValidationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -11,10 +12,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class ClaimSourceInitContext {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ClaimSourceInitContext.class);
|
||||
|
||||
private final PerunOidcConfig perunOidcConfig;
|
||||
private final JWTSigningAndValidationService jwtService;
|
||||
private final String propertyPrefix;
|
||||
|
|
|
@ -3,6 +3,7 @@ package cz.muni.ics.oidc.server.claims;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -27,10 +28,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @see ClaimModifier
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunCustomClaimDefinition {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunCustomClaimDefinition.class);
|
||||
|
||||
private final String scope;
|
||||
private final String claim;
|
||||
private final ClaimSource claimSource;
|
||||
|
|
|
@ -2,6 +2,7 @@ package cz.muni.ics.oidc.server.claims.modifiers;
|
|||
|
||||
import cz.muni.ics.oidc.server.claims.ClaimModifier;
|
||||
import cz.muni.ics.oidc.server.claims.ClaimModifierInitContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -16,10 +17,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Slf4j
|
||||
public class AppendModifier extends ClaimModifier {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AppendModifier.class);
|
||||
|
||||
private static final String APPEND = "append";
|
||||
|
||||
private final String appendText;
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.google.common.net.UrlEscapers;
|
|||
import cz.muni.ics.oidc.server.claims.ClaimModifier;
|
||||
import cz.muni.ics.oidc.server.claims.ClaimModifierInitContext;
|
||||
import cz.muni.ics.oidc.server.claims.ClaimUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -25,10 +26,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Slf4j
|
||||
public class GroupNamesAARCFormatModifier extends ClaimModifier {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GroupNamesAARCFormatModifier.class);
|
||||
|
||||
public static final String PREFIX = "prefix";
|
||||
public static final String AUTHORITY = "authority";
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package cz.muni.ics.oidc.server.claims.modifiers;
|
|||
import cz.muni.ics.oidc.server.claims.ClaimModifier;
|
||||
import cz.muni.ics.oidc.server.claims.ClaimModifierInitContext;
|
||||
import java.util.regex.Pattern;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -19,10 +20,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Slf4j
|
||||
public class RegexReplaceModifier extends ClaimModifier {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(RegexReplaceModifier.class);
|
||||
|
||||
private static final String FIND = "find";
|
||||
private static final String REPLACE = "replace";
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -32,10 +33,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @author Dominik Baránek <baranek@ics.muni.cz>
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class EdupersonScopedAffiliationsMUSource extends ClaimSource {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(EdupersonScopedAffiliationsMUSource.class);
|
||||
|
||||
private static final String CONFIG_FILE = "config_file";
|
||||
private static final String KEY_SCOPE = "scope";
|
||||
private static final String KEY_VO_ID = "voId";
|
||||
|
|
|
@ -9,15 +9,15 @@ import cz.muni.ics.oidc.server.claims.ClaimSourceProduceContext;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.yaml.snakeyaml.external.com.google.gdata.util.common.base.PercentEscaper;
|
||||
|
||||
@Slf4j
|
||||
public class EntitlementExtendedClaimSource extends EntitlementSource {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(EntitlementExtendedClaimSource.class);
|
||||
|
||||
private static final String GROUP = "group";
|
||||
private static final String GROUP_ATTRIBUTES = "groupAttributes";
|
||||
private static final String DISPLAY_NAME = "displayName";
|
||||
|
|
|
@ -14,6 +14,7 @@ import java.util.HashSet;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -39,10 +40,9 @@ import org.springframework.util.StringUtils;
|
|||
* @author Dominik Baránek <baranek@ics.muni.cz>
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class EntitlementSource extends GroupNamesSource {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(EntitlementSource.class);
|
||||
|
||||
private static final String GROUP = "group";
|
||||
|
||||
protected static final String FORWARDED_ENTITLEMENTS = "forwardedEntitlements";
|
||||
|
|
|
@ -11,6 +11,7 @@ import cz.muni.ics.oidc.server.claims.ClaimSourceProduceContext;
|
|||
import cz.muni.ics.oidc.server.claims.ClaimUtils;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -25,10 +26,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Dominik Baránek <baranek@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class ExtractValuesByDomainSource extends ClaimSource {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ExtractValuesByDomainSource.class);
|
||||
|
||||
private static final String EXTRACT_BY_DOMAIN = "extractByDomain";
|
||||
private static final String ATTRIBUTE_NAME = "attributeName";
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -25,10 +26,9 @@ import org.springframework.util.StringUtils;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class GroupNamesSource extends ClaimSource {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(GroupNamesSource.class);
|
||||
|
||||
protected static final String MEMBERS = "members";
|
||||
|
||||
public GroupNamesSource(ClaimSourceInitContext ctx) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import java.time.format.DateTimeFormatter;
|
|||
import java.time.format.DateTimeParseException;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -27,10 +28,9 @@ import org.springframework.util.StringUtils;
|
|||
*
|
||||
* @author Pavol Pluta <pavol.pluta1@gmail.com>
|
||||
*/
|
||||
@Slf4j
|
||||
public class IsCesnetEligibleClaimSource extends ClaimSource {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(IsCesnetEligibleClaimSource.class);
|
||||
|
||||
private static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
private static final int VALIDITY_PERIOD = 12; // 12 months
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import cz.muni.ics.oidc.server.claims.ClaimSourceProduceContext;
|
|||
import cz.muni.ics.oidc.server.claims.ClaimUtils;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -23,10 +24,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Slf4j
|
||||
public class PerunAttributeClaimSource extends ClaimSource {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(PerunAttributeClaimSource.class);
|
||||
|
||||
private static final String ATTRIBUTE = "attribute";
|
||||
|
||||
private final String attributeName;
|
||||
|
|
|
@ -10,6 +10,7 @@ import cz.muni.ics.oidc.server.claims.ClaimSourceProduceContext;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -29,10 +30,9 @@ import org.springframework.util.StringUtils;
|
|||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Slf4j
|
||||
public class StaticValueClaimSource extends ClaimSource {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(StaticValueClaimSource.class);
|
||||
|
||||
private static final String NO_SEPARATOR = "@NULL";
|
||||
private static final String VALUE_SEPARATOR = "valueSeparator";
|
||||
private static final String VALUE = "value";
|
||||
|
|
|
@ -10,6 +10,7 @@ import cz.muni.ics.oidc.server.claims.ClaimUtils;
|
|||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -26,10 +27,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Slf4j
|
||||
public class TwoArrayAttributesClaimSource extends ClaimSource {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TwoArrayAttributesClaimSource.class);
|
||||
|
||||
public static final String ATTRIBUTE_1 = "attribute1";
|
||||
public static final String ATTRIBUTE_2 = "attribute2";
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package cz.muni.ics.oidc.server.configurations;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import javax.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -11,10 +12,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class FacilityAttrsConfig {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(FacilityAttrsConfig.class);
|
||||
|
||||
private String checkGroupMembershipAttr;
|
||||
private String registrationURLAttr;
|
||||
private String allowRegistrationAttr;
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.Set;
|
|||
import javax.annotation.PostConstruct;
|
||||
import javax.servlet.ServletContext;
|
||||
import cz.muni.ics.openid.connect.config.ConfigurationPropertiesBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -20,8 +21,9 @@ import org.springframework.web.util.UriComponentsBuilder;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunOidcConfig {
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunOidcConfig.class);
|
||||
|
||||
private static final String OIDC_POM_FILE = "/META-INF/maven/cz.muni.ics/perun-oidc-server-webapp/pom.properties";
|
||||
|
||||
private ConfigurationPropertiesBean configBean;
|
||||
|
|
|
@ -3,6 +3,7 @@ package cz.muni.ics.oidc.server.connectors;
|
|||
import com.google.common.base.Strings;
|
||||
import cz.muni.ics.oidc.aop.LogTimes;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
|
||||
import org.apache.directory.api.ldap.model.message.SearchScope;
|
||||
import org.apache.directory.api.ldap.model.name.Dn;
|
||||
|
@ -23,10 +24,9 @@ import org.springframework.beans.factory.DisposableBean;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunConnectorLdap implements DisposableBean {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunConnectorLdap.class);
|
||||
|
||||
private final String baseDN;
|
||||
private final LdapConnectionPool pool;
|
||||
private final LdapConnectionTemplate ldap;
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.HeaderElement;
|
||||
import org.apache.http.HeaderElementIterator;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
|
@ -34,10 +35,9 @@ import org.springframework.web.client.RestTemplate;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunConnectorRpc {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunConnectorRpc.class);
|
||||
|
||||
public static final String ATTRIBUTES_MANAGER = "attributesManager";
|
||||
public static final String FACILITIES_MANAGER = "facilitiesManager";
|
||||
public static final String GROUPS_MANAGER = "groupsManager";
|
||||
|
|
|
@ -5,6 +5,7 @@ import cz.muni.ics.oidc.server.PerunAccessTokenEnhancer;
|
|||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import cz.muni.ics.openid.connect.model.UserInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
||||
|
@ -16,10 +17,9 @@ import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
|||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Slf4j
|
||||
public class ElixirAccessTokenModifier implements PerunAccessTokenEnhancer.AccessTokenClaimsModifier {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(ElixirAccessTokenModifier.class);
|
||||
|
||||
public ElixirAccessTokenModifier() {
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ import java.util.UUID;
|
|||
import java.util.stream.Collectors;
|
||||
import cz.muni.ics.jwt.signer.service.JWTSigningAndValidationService;
|
||||
import cz.muni.ics.openid.connect.web.JWKSetPublishingEndpoint;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.MediaType;
|
||||
|
@ -70,13 +71,12 @@ import org.springframework.web.client.RestTemplate;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class GA4GHClaimSource extends ClaimSource {
|
||||
|
||||
static final String GA4GH_SCOPE = "ga4gh_passport_v1";
|
||||
private static final String GA4GH_CLAIM = "ga4gh_passport_v1";
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GA4GHClaimSource.class);
|
||||
|
||||
private static final String BONA_FIDE_URL = "https://doi.org/10.1038/s41431-018-0219-y";
|
||||
private static final String ELIXIR_ORG_URL = "https://elixir-europe.org/";
|
||||
private static final String ELIXIR_ID = "elixir_id";
|
||||
|
|
|
@ -16,6 +16,7 @@ import javax.servlet.ServletResponse;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import cz.muni.ics.oauth2.service.ClientDetailsEntityService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -29,10 +30,9 @@ import org.springframework.web.filter.GenericFilterBean;
|
|||
* @author Dominik Baranek <baranek@ics.muni.cz>
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class CallPerunFiltersFilter extends GenericFilterBean {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(CallPerunFiltersFilter.class);
|
||||
|
||||
@Autowired
|
||||
private Properties coreProperties;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import cz.muni.ics.oauth2.service.ClientDetailsEntityService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
|
@ -37,10 +38,9 @@ import org.springframework.util.StringUtils;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class FiltersUtils {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(FiltersUtils.class);
|
||||
|
||||
private static final RequestMatcher requestMatcher = new AntPathRequestMatcher(PerunFilterConstants.AUTHORIZE_REQ_PATTERN);
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -21,10 +22,9 @@ import org.springframework.util.StringUtils;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunFiltersContext {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunFiltersContext.class);
|
||||
|
||||
private static final String FILTER_NAMES = "filter.names";
|
||||
private static final String FILTER_CLASS = ".class";
|
||||
private static final String PREFIX = "filter.";
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.util.Set;
|
|||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
|
@ -36,10 +37,9 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
|
|||
* @author Dominik Baranek <baranek@ics.muni.cz>
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class PerunRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunRequestFilter.class);
|
||||
|
||||
private static final String DELIMITER = ",";
|
||||
private static final String CLIENT_IDS = "clientIds";
|
||||
private static final String SUBS = "subs";
|
||||
|
|
|
@ -16,6 +16,8 @@ import javax.servlet.ServletRequest;
|
|||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.index.qual.SameLen;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -30,10 +32,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunAuthorizationFilter extends PerunRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunAuthorizationFilter.class);
|
||||
|
||||
private final PerunAdapter perunAdapter;
|
||||
private final FacilityAttrsConfig facilityAttrsConfig;
|
||||
private final String filterName;
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Set;
|
|||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.HttpHeaders;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -38,10 +39,9 @@ import org.springframework.util.StringUtils;
|
|||
* </ul>
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunEnsureVoMember extends PerunRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunEnsureVoMember.class);
|
||||
|
||||
private static final String TRIGGER_ATTR = "triggerAttr";
|
||||
private static final String VO_DEFS_ATTR = "voDefsAttr";
|
||||
private static final String LOGIN_URL_ATTR = "loginURL";
|
||||
|
|
|
@ -31,6 +31,7 @@ import javax.servlet.ServletRequest;
|
|||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -52,9 +53,9 @@ import org.springframework.util.StringUtils;
|
|||
* @author Dominik Baranek <baranek@ics.muni.cz>
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunForceAupFilter extends PerunRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunForceAupFilter.class);
|
||||
private static final String DATE_FORMAT = "yyyy-MM-dd";
|
||||
|
||||
/* CONFIGURATION PROPERTIES */
|
||||
|
|
|
@ -28,6 +28,7 @@ import javax.servlet.ServletRequest;
|
|||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.HttpHeaders;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -45,10 +46,9 @@ import org.slf4j.LoggerFactory;
|
|||
* </ul>
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunIsCesnetEligibleFilter extends PerunRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunIsCesnetEligibleFilter.class);
|
||||
|
||||
/* CONFIGURATION PROPERTIES */
|
||||
private static final String IS_CESNET_ELIGIBLE_ATTR_NAME = "isCesnetEligibleAttr";
|
||||
private static final String IS_CESNET_ELIGIBLE_SCOPE = "isCesnetEligibleScope";
|
||||
|
|
|
@ -21,6 +21,7 @@ import javax.servlet.ServletRequest;
|
|||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.HttpHeaders;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -36,10 +37,9 @@ import org.slf4j.LoggerFactory;
|
|||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
* @author Pavol Pluta <500348@mail.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunIsTestSpFilter extends PerunRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunIsTestSpFilter.class);
|
||||
|
||||
private static final String IS_TEST_SP_ATTR_NAME = "isTestSpAttr";
|
||||
|
||||
private final String isTestSpAttrName;
|
||||
|
|
|
@ -18,6 +18,7 @@ import javax.servlet.ServletResponse;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.sql.DataSource;
|
||||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.saml.SAMLCredential;
|
||||
|
@ -44,10 +45,9 @@ import org.springframework.util.StringUtils;
|
|||
* @author Dominik Baránek <baranek@ics.muni.cz>
|
||||
*/
|
||||
@SuppressWarnings("SqlResolve")
|
||||
@Slf4j
|
||||
public class ProxyStatisticsFilter extends PerunRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProxyStatisticsFilter.class);
|
||||
|
||||
/* CONFIGURATION OPTIONS */
|
||||
private static final String IDP_NAME_ATTRIBUTE_NAME = "idpNameAttributeName";
|
||||
private static final String IDP_ENTITY_ID_ATTRIBUTE_NAME = "idpEntityIdAttributeName";
|
||||
|
|
|
@ -18,6 +18,7 @@ import javax.servlet.ServletRequest;
|
|||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -45,10 +46,9 @@ import org.springframework.util.StringUtils;
|
|||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@SuppressWarnings("SqlResolve")
|
||||
@Slf4j
|
||||
public class ValidUserFilter extends PerunRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ValidUserFilter.class);
|
||||
|
||||
/* CONFIGURATION OPTIONS */
|
||||
private static final String ALL_ENV_GROUPS = "allEnvGroups";
|
||||
private static final String ALL_ENV_VOS = "allEnvVos";
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.google.gson.JsonSyntaxException;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import cz.muni.ics.openid.connect.model.DefaultUserInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -17,10 +18,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunUserInfo extends DefaultUserInfo {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunUserInfo.class);
|
||||
|
||||
private final Map<String, JsonNode> customClaims = new LinkedHashMap<>();
|
||||
private JsonObject obj;
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ import cz.muni.ics.openid.connect.model.Address;
|
|||
import cz.muni.ics.openid.connect.model.DefaultAddress;
|
||||
import cz.muni.ics.openid.connect.model.UserInfo;
|
||||
import cz.muni.ics.openid.connect.service.UserInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -52,10 +53,9 @@ import org.springframework.util.StringUtils;
|
|||
*
|
||||
* @author Martin Kuba <makub@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class PerunUserInfoService implements UserInfoService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunUserInfoService.class);
|
||||
|
||||
private static final String CUSTOM_CLAIM = "custom.claim.";
|
||||
private static final String SOURCE = ".source";
|
||||
private static final String CLASS = ".class";
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -14,10 +15,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Dominik Baránek <baranek@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class UserInfoModifierContext {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PerunUserInfoService.class);
|
||||
|
||||
private static final String MODIFIER_CLASS = ".class";
|
||||
|
||||
private final Properties properties;
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.io.InputStreamReader;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -16,10 +17,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class WebHtmlClasses {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(WebHtmlClasses.class);
|
||||
|
||||
private String classesFilePath;
|
||||
private Properties webHtmlClassesProperties;
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.Iterator;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -33,6 +34,7 @@ import org.springframework.web.bind.annotation.SessionAttribute;
|
|||
* @author Dominik Baranek <baranek@ics.muni.cz>
|
||||
*/
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class AupController {
|
||||
|
||||
public static final String URL = "aup";
|
||||
|
@ -42,7 +44,6 @@ public class AupController {
|
|||
public static final String USER_ATTR = "userAttr";
|
||||
|
||||
private static final SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd");
|
||||
private static final Logger log = LoggerFactory.getLogger(AupController.class);
|
||||
|
||||
private final JsonNodeFactory jsonNodeFactory = JsonNodeFactory.instance;
|
||||
private final ObjectMapper mapper = new ObjectMapper();
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.Properties;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import cz.muni.ics.oauth2.model.SystemScope;
|
||||
|
@ -37,10 +38,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik (bucik@ics.muni.cz)
|
||||
*/
|
||||
@Slf4j
|
||||
public class ControllerUtils {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ControllerUtils.class);
|
||||
|
||||
private static final String LANG_KEY = "lang";
|
||||
private static final String REQ_URL_KEY = "reqURL";
|
||||
private static final String LANGS_MAP_KEY = "langsMap";
|
||||
|
|
|
@ -9,6 +9,7 @@ import cz.muni.ics.oidc.web.langs.Localization;
|
|||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -22,8 +23,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
* @author Pavol Pluta <pavol.pluta1@gmail.com>
|
||||
*/
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class IsTestSpController {
|
||||
private static final Logger log = LoggerFactory.getLogger(IsTestSpController.class);
|
||||
|
||||
public static final String MAPPING = "/testRpWarning";
|
||||
public static final String IS_TEST_SP_APPROVED_SESS = "isTestSpApprovedSession";
|
||||
|
|
|
@ -5,6 +5,7 @@ import cz.muni.ics.oidc.web.WebHtmlClasses;
|
|||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -12,10 +13,9 @@ import org.springframework.stereotype.Controller;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class LoginController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LoginController.class);
|
||||
|
||||
public static final String MAPPING_SUCCESS = "/login_success";
|
||||
public static final String MAPPING_FAILURE = "/login_failure";
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import cz.muni.ics.oidc.web.WebHtmlClasses;
|
|||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -12,10 +13,9 @@ import org.springframework.stereotype.Controller;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class LogoutController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LogoutController.class);
|
||||
|
||||
public static final String MAPPING_SUCCESS = "/logout_success";
|
||||
|
||||
private final Localization localization;
|
||||
|
|
|
@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import cz.muni.ics.oauth2.service.ClientDetailsEntityService;
|
||||
import cz.muni.ics.openid.connect.view.HttpCodeView;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -32,10 +33,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class PerunUnapprovedController {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunUnapprovedController.class);
|
||||
|
||||
public static final String UNAPPROVED_MAPPING = "/unapproved";
|
||||
public static final String UNAPPROVED_SPECIFIC_MAPPING = "/unapproved_spec";
|
||||
public static final String UNAPPROVED_IS_CESNET_ELIGIBLE_MAPPING = "/unapprovedIce";
|
||||
|
|
|
@ -20,6 +20,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import cz.muni.ics.oauth2.service.ClientDetailsEntityService;
|
||||
import cz.muni.ics.openid.connect.view.HttpCodeView;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -35,10 +36,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class PerunUnapprovedRegistrationController {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(PerunUnapprovedRegistrationController.class);
|
||||
|
||||
public static final String REGISTRATION_FORM_MAPPING = "/regForm";
|
||||
public static final String REGISTRATION_FORM_SUBMIT_MAPPING = "/regForm/submit";
|
||||
public static final String REGISTRATION_CONTINUE_MAPPING = "/regForm/continue";
|
||||
|
|
|
@ -5,6 +5,8 @@ import cz.muni.ics.oidc.web.WebHtmlClasses;
|
|||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.index.qual.SameLen;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -18,10 +20,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class RegistrationController {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(RegistrationController.class);
|
||||
|
||||
public static final String PARAM_TARGET = "target";
|
||||
|
||||
public static final String CONTINUE_DIRECT_MAPPING = "/continueDirect";
|
||||
|
|
|
@ -11,6 +11,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.index.qual.SameLen;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -21,10 +23,9 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class Localization {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(Localization.class);
|
||||
|
||||
private Map<String, String> localizationEntries;
|
||||
private Map<String, Properties> localizationFiles;
|
||||
private final String localizationFilesPath;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue