mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-262 Server config API stub
This commit is contained in:
@@ -42,6 +42,17 @@ type AdminPermissionInfo {
|
||||
category: String
|
||||
}
|
||||
|
||||
input ServerConfigInput {
|
||||
serverName: String
|
||||
|
||||
adminName: String
|
||||
adminPassword: String
|
||||
|
||||
anonymousAccessEnabled: Boolean
|
||||
authenticationEnabled: Boolean
|
||||
customConnectionsEnabled: Boolean
|
||||
}
|
||||
|
||||
extend type Query {
|
||||
|
||||
#### Users and roles
|
||||
@@ -90,10 +101,3 @@ extend type Query {
|
||||
setDefaultNavigatorSettings( settings: NavigatorSettingsInput!): Boolean!
|
||||
|
||||
}
|
||||
|
||||
input ServerConfigInput {
|
||||
serverName: String
|
||||
|
||||
adminName: String
|
||||
adminPassword: String
|
||||
}
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2020 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package io.cloudbeaver.service.admin;
|
||||
|
||||
/**
|
||||
* Server configuration for admin API
|
||||
*/
|
||||
public class AdminServerConfig {
|
||||
|
||||
private String serverName;
|
||||
|
||||
private String adminName;
|
||||
private String adminPassword;
|
||||
|
||||
private boolean anonymousAccessEnabled;
|
||||
private boolean authenticationEnabled;
|
||||
private boolean customConnectionsEnabled;
|
||||
|
||||
public String getServerName() {
|
||||
return serverName;
|
||||
}
|
||||
|
||||
public void setServerName(String serverName) {
|
||||
this.serverName = serverName;
|
||||
}
|
||||
|
||||
public String getAdminName() {
|
||||
return adminName;
|
||||
}
|
||||
|
||||
public void setAdminName(String adminName) {
|
||||
this.adminName = adminName;
|
||||
}
|
||||
|
||||
public String getAdminPassword() {
|
||||
return adminPassword;
|
||||
}
|
||||
|
||||
public void setAdminPassword(String adminPassword) {
|
||||
this.adminPassword = adminPassword;
|
||||
}
|
||||
|
||||
public boolean isAnonymousAccessEnabled() {
|
||||
return anonymousAccessEnabled;
|
||||
}
|
||||
|
||||
public void setAnonymousAccessEnabled(boolean anonymousAccessEnabled) {
|
||||
this.anonymousAccessEnabled = anonymousAccessEnabled;
|
||||
}
|
||||
|
||||
public boolean isAuthenticationEnabled() {
|
||||
return authenticationEnabled;
|
||||
}
|
||||
|
||||
public void setAuthenticationEnabled(boolean authenticationEnabled) {
|
||||
this.authenticationEnabled = authenticationEnabled;
|
||||
}
|
||||
|
||||
public boolean isCustomConnectionsEnabled() {
|
||||
return customConnectionsEnabled;
|
||||
}
|
||||
|
||||
public void setCustomConnectionsEnabled(boolean customConnectionsEnabled) {
|
||||
this.customConnectionsEnabled = customConnectionsEnabled;
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -88,8 +88,13 @@ public interface DBWServiceAdmin extends DBWService {
|
||||
@WebAction(requirePermissions = AdminPermissions.PERMISSION_ADMIN)
|
||||
boolean deleteConnectionConfiguration(@NotNull WebSession webSession, @NotNull String id) throws DBWebException;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Server configuration
|
||||
|
||||
@WebAction(requirePermissions = AdminPermissions.PERMISSION_ADMIN)
|
||||
boolean setDefaultNavigatorSettings(WebSession webSession, DBNBrowseSettings settings);
|
||||
boolean configureServer(WebSession webSession, AdminServerConfig config) throws DBWebException;
|
||||
@WebAction(requirePermissions = AdminPermissions.PERMISSION_ADMIN)
|
||||
boolean setDefaultNavigatorSettings(WebSession webSession, DBNBrowseSettings settings) throws DBWebException;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Permissions
|
||||
|
||||
+5
@@ -295,6 +295,11 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean configureServer(WebSession webSession, AdminServerConfig config) throws DBWebException {
|
||||
throw new DBWebException("Not implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setDefaultNavigatorSettings(WebSession webSession, DBNBrowseSettings settings) {
|
||||
CBApplication.getInstance().setDefaultNavigatorSettings(settings);
|
||||
|
||||
Reference in New Issue
Block a user