Skip to content

Commit

Permalink
Ensure user can conenct to servers using SSL certificates,identity fi…
Browse files Browse the repository at this point in the history
…les available in the shared storage.pgadmin-org#7306
  • Loading branch information
yogeshmahajan-1903 committed Jun 4, 2024
1 parent 29a5266 commit 1bee3e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions web/pgadmin/browser/server_groups/servers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def get_shared_server_properties(server, sharedserver):
server.tunnel_username = sharedserver.tunnel_username
server.tunnel_password = sharedserver.tunnel_password
server.save_password = sharedserver.save_password
server.tunnel_identity_file = sharedserver.tunnel_identity_file
if hasattr(server, 'connection_params') and \
hasattr(sharedserver, 'connection_params') and \
'passfile' in server.connection_params and \
Expand Down
9 changes: 7 additions & 2 deletions web/pgadmin/static/js/components/FormComponents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { withColorPicker } from '../helpers/withColorPicker';
import { useWindowSize } from '../custom_hooks';
import PgTreeView from '../PgTreeView';
import Loader from 'sources/components/Loader';
import { MY_STORAGE } from '../../../misc/file_manager/static/js/components/FileManagerConstants';


const useStyles = makeStyles((theme) => ({
Expand Down Expand Up @@ -459,8 +460,12 @@ export function InputFileSelect({ controlProps, onChange, disabled, readonly, is
dialog_title: controlProps.dialogTitle || '',
btn_primary: controlProps.btnPrimary || '',
};
showFileManager(params, (fileName)=>{
onChange?.(decodeURI(fileName));
showFileManager(params, (fileName, dir)=>{
if (dir === MY_STORAGE){
onChange?.(decodeURI(fileName));
}else{
onChange?.(dir + ':/' + decodeURI(fileName));
}
inpRef.current.focus();
});
};
Expand Down
9 changes: 8 additions & 1 deletion web/pgadmin/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,14 @@ def get_complete_file_path(file, validate=True):
if current_app.PGADMIN_RUNTIME or not current_app.config['SERVER_MODE']:
return file if os.path.isfile(file) else None

storage_dir = get_storage_directory()
dir_path = ''
if file.find('://') != -1:
dir_file_paths = file.split('://')
dir_path = dir_file_paths[0]
file = dir_file_paths[1]

storage_dir = get_storage_directory(shared_storage=dir_path) if dir_path \
else get_storage_directory()
if storage_dir:
file = os.path.join(
storage_dir,
Expand Down

0 comments on commit 1bee3e7

Please sign in to comment.