+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+require 'request_error'
+
class Blob
extend DbCurrentTime
# locator_hash +A blob_signature @ timestamp
# where the timestamp is a Unix time expressed as a hexadecimal value,
# and the blob_signature is the signed locator_hash + API token + timestamp.
- #
- class InvalidSignatureError < StandardError
+ #
+ class InvalidSignatureError < RequestError
end
# Blob.sign_locator: return a signed and timestamped blob locator.
# Return value: true if the locator has a valid signature, false otherwise
# Arguments: signed_blob_locator, opts
#
- def self.verify_signature *args
+ def self.verify_signature(*args)
begin
- self.verify_signature! *args
+ self.verify_signature!(*args)
true
rescue Blob::InvalidSignatureError
false