Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions app/commands/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import click

from app.services.user_authentication.decorator import require_config
from app.services.user_authentication.decorator import require_login_session

from .container_registry import create_project
Expand All @@ -26,15 +25,14 @@

# Import custom commands
from .project import project_list_all
from .use_config import set_env
from .user import login
from .user import logout

container_registry_enabled = os.environ.get('PILOT_CLI_CONTAINER_REGISTRY_ENABLED', 'false') == 'true'


def command_groups():
commands = ['file', 'user', 'use_config', 'project', 'dataset']
commands = ['file', 'user', 'project', 'dataset']
if container_registry_enabled:
commands.append('container_registry')
return commands
Expand All @@ -46,37 +44,28 @@ def entry_point():


@entry_point.group(name='project')
@require_config
@require_login_session
def project_group():
pass


@entry_point.group(name='dataset')
@require_config
@require_login_session
def dataset_group():
pass


@entry_point.group(name='file')
@require_config
@require_login_session
def file_group():
pass


@entry_point.group(name='user')
@require_config
def user_group():
pass


@entry_point.group(name='use_config')
def config_group():
pass


file_group.add_command(file_put)
file_group.add_command(file_check_manifest)
file_group.add_command(file_export_manifest)
Expand All @@ -89,13 +78,11 @@ def config_group():
dataset_group.add_command(dataset_list)
dataset_group.add_command(dataset_show_detail)
dataset_group.add_command(dataset_download)
config_group.add_command(set_env)

# Custom commands
if container_registry_enabled:

@entry_point.group(name='container_registry')
@require_config
def cr_group():
pass

Expand Down
29 changes: 0 additions & 29 deletions app/commands/use_config.py

This file was deleted.

1 change: 0 additions & 1 deletion app/configs/app_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class Connections:
url_upload_greenroom = ConfigClass.url_upload_greenroom
url_upload_core = ConfigClass.url_upload_core
url_status = ConfigClass.url_status
url_lineage = ConfigClass.url_lineage
url_download_greenroom = ConfigClass.url_download_greenroom
url_download_core = ConfigClass.url_download_core
url_v2_download_pre = ConfigClass.url_v2_download_pre
Expand Down
8 changes: 1 addition & 7 deletions app/resources/custom_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class Error:
'INVALID_ATTRIBUTE': "Invalid attribute '%s'. Please verify and try again.",
'INVALID_UPLOAD_REQUEST': 'Invalid upload request: %s',
'INVALID_SOURCE_FILE': 'File does not exist or source file provided is invalid: %s',
'INVALID_LINEAGE': 'Create lineage failed: %s',
'INVALID_PIPELINENAME': (
'Invalid pipeline name. Pipeline names must be between 1 and 20 characters long and '
'may only contain lowercase letters, numbers, and/or special characters of -_, .'
Expand Down Expand Up @@ -66,7 +65,7 @@ class Error:
'It means the resumable file is not the same with previous one.\n'
'Please to double check the file content.'
),
'UNSUPPORT_TAG_MANIFEST': 'Tagging, lineage and manifest attaching are not supported for folder type.',
'UNSUPPORT_TAG_MANIFEST': 'Tagging and manifest attaching are not supported for folder type.',
'INVALID_INPUT': 'Invalid input. Please try again.',
'UNSUPPORTED_PROJECT': 'This function is not supported in the given Project %s',
'CREATE_FOLDER_IF_NOT_EXIST': 'Target folder does not exist. Would you like to create a new folder?',
Expand Down Expand Up @@ -112,11 +111,6 @@ class Error:
'sensitive identifiers, please cancel this transfer and upload the data to the Green Room to perform '
'these actions.'
),
'CONFIG_NOT_FOUND': 'This cli is not setup properly, please download config file and config again.',
'CONFIG_EXIST': (
'This cli has been configured already.'
'If you want to re-config this cli please remove previous file first'
),
'CONFIG_INVALID_PERMISSIONS': 'Cannot proceed with current config permissions.\n%s',
'CONTAINER_REGISTRY_NO_URL': (
'Container registry has not yet been configured. Related commands cannot be used at this time.'
Expand Down
3 changes: 0 additions & 3 deletions app/services/output_manager/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class ECustomizedError(enum.Enum):
MISSING_REQUIRED_ATTRIBUTE = 'MISSING_REQUIRED_ATTRIBUTE'
INVALID_UPLOAD_REQUEST = 'INVALID_UPLOAD_REQUEST'
INVALID_SOURCE_FILE = 'INVALID_SOURCE_FILE'
INVALID_LINEAGE = 'INVALID_LINEAGE'
INVALID_PIPELINENAME = 'INVALID_PIPELINENAME'
INVALID_PATHS = 'INVALID_PATHS'
INVALID_RESUMABLE = 'INVALID_RESUMABLE'
Expand Down Expand Up @@ -77,8 +76,6 @@ class ECustomizedError(enum.Enum):
USER_NOT_FOUND = 'USER_NOT_FOUND'
CONTAINER_REGISTRY_OTHER = 'CONTAINER_REGISTRY_OTHER'
CONTAINER_REGISTRY_NO_URL = 'CONTAINER_REGISTRY_NO_URL'
CONFIG_NOT_FOUND = 'CONFIG_NOT_FOUND'
CONFIG_EXIST = 'CONFIG_EXIST'
CONFIG_INVALID_PERMISSIONS = 'CONFIG_INVALID_PERMISSIONS'


Expand Down
10 changes: 0 additions & 10 deletions app/services/output_manager/help_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ def project_help_page(ProjectHELP: ProjectHELP):
return helps.get(ProjectHELP.name)


class ConfigHELP(enum.Enum):
SET_CONFIG = 'SET_CONFIG'
CONFIG_DESTINATION = 'CONFIG_DESTINATION'


def config_help_page(ConfigHELP: ConfigHELP):
helps = help_msg.get('config', 'default config help')
return helps.get(ConfigHELP.name)


class UserHELP(enum.Enum):
USER_LOGIN = 'USER_LOGIN'
USER_LOGOUT = 'USER_LOGOUT'
Expand Down
10 changes: 0 additions & 10 deletions app/services/user_authentication/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from .token_manager import SrvTokenManager
from .user_login_logout import check_is_active
from .user_login_logout import check_is_login
from .user_set_config import check_config


def require_valid_token(azp=AppConfig.Env.keycloak_device_client_id):
Expand Down Expand Up @@ -53,12 +52,3 @@ def decorated(*args, **kwargs):
return func(*args, **kwargs)

return decorated


def require_config(func):
@wraps(func)
def decorated(*args, **kwargs):
check_config()
return func(*args, **kwargs)

return decorated
27 changes: 0 additions & 27 deletions app/services/user_authentication/user_set_config.py

This file was deleted.

1 change: 0 additions & 1 deletion env.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def modify_values(self, settings):
settings.url_dataset_v2download = settings.base_url + 'portal/download/core/v2/dataset'
settings.url_dataset = settings.base_url + 'portal/v1/dataset'
settings.url_validation = settings.base_url + 'v1/files/validation'
settings.url_lineage = settings.url_bff + '/v1/lineage'

return settings

Expand Down