X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3c88abd3cb33cbe80bb81a7cca779fe668036c9e..215fe1cc2c7988b5267a6423dea559c9e85b15aa:/services/api/app/models/blob.rb diff --git a/services/api/app/models/blob.rb b/services/api/app/models/blob.rb index 41d5b27093..55a257856c 100644 --- a/services/api/app/models/blob.rb +++ b/services/api/app/models/blob.rb @@ -1,3 +1,9 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + +require 'request_error' + class Blob extend DbCurrentTime @@ -21,8 +27,8 @@ class Blob # 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. @@ -64,9 +70,9 @@ class Blob # 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