mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix an issue where role is used as username for newly added servers when opening query tool. #5702
This commit is contained in:
parent
103cf0eba5
commit
932dcd9666
@ -268,7 +268,7 @@ class ServerModule(sg.ServerGroupPluginModule):
|
|||||||
was_connected=was_connected,
|
was_connected=was_connected,
|
||||||
errmsg=errmsg,
|
errmsg=errmsg,
|
||||||
user_id=server.user_id,
|
user_id=server.user_id,
|
||||||
user_name=server.username,
|
username=server.username,
|
||||||
shared=server.shared,
|
shared=server.shared,
|
||||||
is_kerberos_conn=bool(server.kerberos_conn),
|
is_kerberos_conn=bool(server.kerberos_conn),
|
||||||
gss_authenticated=manager.gss_authenticated,
|
gss_authenticated=manager.gss_authenticated,
|
||||||
@ -593,7 +593,7 @@ class ServerNode(PGChildNodeView):
|
|||||||
is_tunnel_password_saved=True
|
is_tunnel_password_saved=True
|
||||||
if server.tunnel_password is not None else False,
|
if server.tunnel_password is not None else False,
|
||||||
errmsg=errmsg,
|
errmsg=errmsg,
|
||||||
user_name=server.username,
|
username=server.username,
|
||||||
shared=server.shared,
|
shared=server.shared,
|
||||||
is_kerberos_conn=bool(server.kerberos_conn),
|
is_kerberos_conn=bool(server.kerberos_conn),
|
||||||
gss_authenticated=manager.gss_authenticated
|
gss_authenticated=manager.gss_authenticated
|
||||||
@ -663,7 +663,7 @@ class ServerNode(PGChildNodeView):
|
|||||||
if server.tunnel_password is not None else False,
|
if server.tunnel_password is not None else False,
|
||||||
errmsg=errmsg,
|
errmsg=errmsg,
|
||||||
shared=server.shared,
|
shared=server.shared,
|
||||||
user_name=server.username,
|
username=server.username,
|
||||||
is_kerberos_conn=bool(server.kerberos_conn),
|
is_kerberos_conn=bool(server.kerberos_conn),
|
||||||
gss_authenticated=manager.gss_authenticated
|
gss_authenticated=manager.gss_authenticated
|
||||||
),
|
),
|
||||||
@ -845,7 +845,7 @@ class ServerNode(PGChildNodeView):
|
|||||||
user_id=server.user_id,
|
user_id=server.user_id,
|
||||||
user=manager.user_info if connected else None,
|
user=manager.user_info if connected else None,
|
||||||
server_type='pg', # default server type
|
server_type='pg', # default server type
|
||||||
user_name=server.username,
|
username=server.username,
|
||||||
role=server.role,
|
role=server.role,
|
||||||
is_password_saved=bool(server.save_password)
|
is_password_saved=bool(server.save_password)
|
||||||
)
|
)
|
||||||
|
@ -32,7 +32,7 @@ export function generateUrl(trans_id, parentData, sqlId) {
|
|||||||
if(parentData.database.label) {
|
if(parentData.database.label) {
|
||||||
url_endpoint += `&database_name=${parentData.database.label}`;
|
url_endpoint += `&database_name=${parentData.database.label}`;
|
||||||
}
|
}
|
||||||
if(!parentData.server.user_name && parentData.server.user?.name) {
|
if(!parentData.server.username && parentData.server.user?.name) {
|
||||||
url_endpoint += `&user=${parentData.server.user?.name}`;
|
url_endpoint += `&user=${parentData.server.user?.name}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ function generateUrl(trans_id, connectionData, nodeData, parentData) {
|
|||||||
+`&did=${parentData.database._id}`
|
+`&did=${parentData.database._id}`
|
||||||
+`&server_type=${parentData.server.server_type}`;
|
+`&server_type=${parentData.server.server_type}`;
|
||||||
|
|
||||||
if(!parentData.server.user_name && parentData.server.user?.name) {
|
if(!parentData.server.username && parentData.server.user?.name) {
|
||||||
url_endpoint += `&user=${parentData.server.user?.name}`;
|
url_endpoint += `&user=${parentData.server.user?.name}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ describe('FunctionSchema', ()=>{
|
|||||||
connected: true,
|
connected: true,
|
||||||
user: {id: 10, name: 'postgres', is_superuser: true, can_create_role: true, can_create_db: true},
|
user: {id: 10, name: 'postgres', is_superuser: true, can_create_role: true, can_create_db: true},
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 130005,
|
version: 130005,
|
||||||
server: {
|
server: {
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
@ -83,7 +83,7 @@ describe('FunctionSchema', ()=>{
|
|||||||
can_create_db: true,
|
can_create_db: true,
|
||||||
},
|
},
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 130005,
|
version: 130005,
|
||||||
server: {
|
server: {
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
@ -157,7 +157,7 @@ describe('FunctionSchema', ()=>{
|
|||||||
catalog: {},
|
catalog: {},
|
||||||
connected: true,
|
connected: true,
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 130005,
|
version: 130005,
|
||||||
server: {
|
server: {
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
@ -209,7 +209,7 @@ describe('FunctionSchema', ()=>{
|
|||||||
catalog: {},
|
catalog: {},
|
||||||
connected: true,
|
connected: true,
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 130005,
|
version: 130005,
|
||||||
server: {
|
server: {
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
@ -265,7 +265,7 @@ describe('FunctionSchema', ()=>{
|
|||||||
node_info: {
|
node_info: {
|
||||||
connected: true,
|
connected: true,
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 130005,
|
version: 130005,
|
||||||
server: {
|
server: {
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
@ -310,7 +310,7 @@ describe('FunctionSchema', ()=>{
|
|||||||
node_info: {
|
node_info: {
|
||||||
connected: true,
|
connected: true,
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 130005,
|
version: 130005,
|
||||||
server: {
|
server: {
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
@ -362,7 +362,7 @@ describe('FunctionSchema', ()=>{
|
|||||||
catalog: {},
|
catalog: {},
|
||||||
connected: true,
|
connected: true,
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 130005,
|
version: 130005,
|
||||||
server: {
|
server: {
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
|
@ -31,7 +31,7 @@ describe('LanguageSchema', ()=>{
|
|||||||
node_info: {connected: true,
|
node_info: {connected: true,
|
||||||
user: {id: 10, name: 'postgres', is_superuser: true, can_create_role: true, can_create_db: true},
|
user: {id: 10, name: 'postgres', is_superuser: true, can_create_role: true, can_create_db: true},
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 120005,
|
version: 120005,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@ describe('PublicationSchema', ()=>{
|
|||||||
connected: true,
|
connected: true,
|
||||||
user: {id: 10, name: 'postgres', is_superuser: true, can_create_role: true, can_create_db: true},
|
user: {id: 10, name: 'postgres', is_superuser: true, can_create_role: true, can_create_db: true},
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 130005,
|
version: 130005,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@ describe('SubscriptionSchema', ()=>{
|
|||||||
connected: true,
|
connected: true,
|
||||||
user: {id: 10, name: 'postgres', is_superuser: true, can_create_role: true, can_create_db: true},
|
user: {id: 10, name: 'postgres', is_superuser: true, can_create_role: true, can_create_db: true},
|
||||||
user_id: 1,
|
user_id: 1,
|
||||||
user_name: 'postgres',
|
username: 'postgres',
|
||||||
version: 130005,
|
version: 130005,
|
||||||
server: {host: '127.0.0.1', port: 5432},
|
server: {host: '127.0.0.1', port: 5432},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user