diff --git a/cas_wrapper.py b/cas_wrapper.py index 301e07e..512a923 100644 --- a/cas_wrapper.py +++ b/cas_wrapper.py @@ -122,8 +122,7 @@ class CasWrapper: self.ensure_login() try: result_json = self.authenticate(local_path, return_json=True) - # it should return 0 for authenticated and trusted commits - is_authenticated = not bool(result_json['status']) + is_authenticated = result_json['verified'] commit_cas_hash = result_json['hash'] # we can fall with ProcessExecutionError, # because source can be not notarized @@ -135,7 +134,6 @@ class CasWrapper: self, local_path: str, use_hash: bool = False, - return_json: bool = False, ) -> bool: """ Authenticates artifact by artifact path or hash if `use_hash` is True. @@ -147,10 +145,10 @@ class CasWrapper: is_authenticated = self.authenticate( local_path, use_hash=use_hash, - return_json=return_json, - ) + return_json=True, + )['verified'] # we can fall with ProcessExecutionError, - # because source can be not notarized + # because artifact can be not notarized except ProcessExecutionError: self._logger.exception('Cannot authenticate: %s', local_path) return is_authenticated