Cloud authentication model

This commit is contained in:
serge-rider
2020-05-19 01:31:34 +03:00
parent 9c3bf3fe84
commit d6edd7fa6f
4 changed files with 8 additions and 5 deletions
@@ -171,7 +171,7 @@ public class WebSession {
private void initNavigatorModel() {
CBPlatform platform = CBPlatform.getInstance();
this.navigatorModel = new DBNModel(platform, false);
this.navigatorModel = new DBNModel(platform, this);
this.navigatorModel.initialize();
DBPProject project = platform.getWorkspace().getActiveProject();
@@ -29,6 +29,8 @@ import java.util.Map;
*/
public interface DBWServiceAuth extends DBWService {
String ATTR_USER_AUTH = "user-auth-info";
@WebAction(requirePermissions = {} )
WebAuthInfo authLogin(WebSession webSession, String providerId, Map<String, Object> credentials) throws DBWebException;
@@ -16,11 +16,10 @@
*/
package io.cloudbeaver.service.auth;
import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.model.user.WebUser;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Date;
/**
* WebAuthInfo
@@ -76,4 +75,8 @@ public class WebAuthInfo {
public void setMessage(String message) {
this.message = message;
}
public static WebAuthInfo getFromSession(WebSession webSession) {
return webSession.getAttribute(DBWServiceAuth.ATTR_USER_AUTH);
}
}
@@ -42,8 +42,6 @@ import java.util.Map;
*/
public class WebServiceAuthImpl implements DBWServiceAuth {
private static final String ATTR_USER_AUTH = "user-auth-info";
@Override
public WebAuthInfo authLogin(WebSession webSession, String providerId, Map<String, Object> authParameters) throws DBWebException {
if (!CBApplication.getInstance().getAppConfiguration().isAuthenticationEnabled()) {