![JAR search and dependency download from the Maven repository](/logo.png)
org.integratedmodelling.kserver.controller.components.UserManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of klab-server Show documentation
Show all versions of klab-server Show documentation
Spring controllers and common components for all k.LAB REST servers
package org.integratedmodelling.kserver.controller.components;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.integratedmodelling.api.auth.IUser;
import org.springframework.stereotype.Component;
/**
* Just matches headers in requests to previously authenticated users.
* TODO switch to proper Spring security configuration when fully understood. Matching
* engine/server security with collaboration is likely to take too much time right now,
* but it should be done when merging node architecture. This should work fine with modeling
* engines.
*
* @author ferdinando.villa
*
*/
@Component
public class UserManager {
Map users = new HashMap<>();
public void register(IUser user) {
users.put(user.getSecurityKey(), user);
}
public IUser getUser(List list) {
if (list == null) {
return null;
}
for (String h : list) {
IUser user = users.get(h);
if (user != null) {
return user;
}
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy