mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
Cloud authentication model
This commit is contained in:
+1
-1
@@ -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();
|
||||
|
||||
+2
@@ -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;
|
||||
|
||||
|
||||
+5
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user