Skip to content

Commit 7c8c1c6

Browse files
authored
Remove additional checksum option (#174)
1 parent 8c73a91 commit 7c8c1c6

File tree

4 files changed

+6
-22
lines changed

4 files changed

+6
-22
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,12 @@ The `transfer_max_retries` configuration property specifies the maximum number o
208208
When uploading files to Cirro, network issues or temporary outages can occasionally cause a transfer to fail.
209209
It will pause for an increasing amount of time for each retry attempt.
210210
211-
The `enable_additional_checksums` property manages the utilization of SHA-256 hashing for enhanced data integrity.
212-
This feature computes the SHA-256 hash of a file during the upload process, and subsequently cross-validates it with the server upon completion.
213-
When retrieving files, it ensures that the hash received matches the server's stored hash.
214211
The default hashing algorithm for files is CRC64. In many cases, CRC64 is sufficient to ensure data integrity upon upload.
215212
216213
```ini
217214
[General]
218215
base_url = cirro.bio
219216
transfer_max_retries = 15
220-
enable_additional_checksums = true
221217
```
222218
223219
### Clearing saved login

cirro/cli/controller.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,11 @@ def run_upload_reference(input_params: UploadReferenceArguments, interactive=Fal
254254

255255

256256
def run_configure():
257-
auth_method, base_url, auth_method_config, enable_additional_checksum = gather_auth_config()
257+
auth_method, base_url, auth_method_config = gather_auth_config()
258258
save_user_config(UserConfig(auth_method=auth_method,
259259
auth_method_config=auth_method_config,
260260
base_url=base_url,
261-
transfer_max_retries=None,
262-
enable_additional_checksum=enable_additional_checksum))
261+
transfer_max_retries=None))
263262

264263

265264
def run_create_pipeline_config(input_params: CreatePipelineConfigArguments, interactive=False):

cirro/cli/interactive/auth_args.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
logger = logging.getLogger()
88

99

10-
def gather_auth_config() -> Tuple[str, str, Dict, bool]:
10+
def gather_auth_config() -> Tuple[str, str, Dict]:
1111
base_url = ask(
1212
'text',
1313
'Enter the URL of the Cirro instance you\'d like to connect to:'
@@ -19,10 +19,4 @@ def gather_auth_config() -> Tuple[str, str, Dict, bool]:
1919
'enable_cache': ask_yes_no('Would you like to save your login? (do not use this on shared devices)')
2020
}
2121

22-
enable_additional_checksum = ask(
23-
'select',
24-
'Upload / download file validation type (note: SHA-256 requires additional local compute)',
25-
choices=['CRC64 (default)', 'SHA-256']
26-
) == 'SHA-256'
27-
28-
return 'ClientAuth', base_url, auth_method_config, enable_additional_checksum
22+
return 'ClientAuth', base_url, auth_method_config

cirro/config.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class UserConfig(NamedTuple):
2020
auth_method_config: Dict # This needs to match the init params of the auth method
2121
base_url: Optional[str]
2222
transfer_max_retries: Optional[int]
23-
enable_additional_checksum: Optional[bool]
2423

2524

2625
def extract_base_url(base_url: str):
@@ -59,7 +58,6 @@ def load_user_config() -> Optional[UserConfig]:
5958
auth_method = main_config.get('auth_method')
6059
base_url = main_config.get('base_url')
6160
transfer_max_retries = main_config.getint('transfer_max_retries', Constants.default_max_retries)
62-
enable_additional_checksum = main_config.getboolean('enable_additional_checksum', False)
6361

6462
if auth_method and ini_config.has_section(auth_method):
6563
auth_method_config = dict(ini_config[auth_method])
@@ -70,8 +68,7 @@ def load_user_config() -> Optional[UserConfig]:
7068
auth_method=auth_method,
7169
auth_method_config=auth_method_config,
7270
base_url=base_url,
73-
transfer_max_retries=transfer_max_retries,
74-
enable_additional_checksum=enable_additional_checksum
71+
transfer_max_retries=transfer_max_retries
7572
)
7673
except Exception:
7774
raise RuntimeError('Configuration load error, please re-run configuration')
@@ -90,8 +87,6 @@ def __init__(self, base_url: str = None):
9087
self.base_url = re.compile(r'https?://').sub('', self.base_url).strip()
9188
self.transfer_max_retries = self.user_config.transfer_max_retries\
9289
if self.user_config else Constants.default_max_retries
93-
self.enable_additional_checksum = self.user_config.enable_additional_checksum\
94-
if self.user_config else False
9590
self._init_config()
9691

9792
@property
@@ -100,7 +95,7 @@ def checksum_method_display(self):
10095

10196
@property
10297
def checksum_method(self):
103-
return 'SHA-256' if self.enable_additional_checksum else 'CRC64NVME'
98+
return 'CRC64NVME'
10499

105100
def _init_config(self):
106101
self.rest_endpoint = f'https://{self.base_url}/api'

0 commit comments

Comments
 (0)