From 0299a3f125486798504b64b178da6b60b6178776 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 4 Jun 2024 15:20:49 +0200 Subject: [PATCH 1/2] Add filename to asset token [SCI-10767] --- app/models/asset_sync_token.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/asset_sync_token.rb b/app/models/asset_sync_token.rb index 5b80255aa..ef24dd334 100644 --- a/app/models/asset_sync_token.rb +++ b/app/models/asset_sync_token.rb @@ -10,7 +10,7 @@ class AssetSyncToken < ApplicationRecord validates :token, uniqueness: true, presence: true def version_token - asset.file.checksum + Digest::SHA256.base64digest(asset.file.checksum + asset.file_name) end def token_valid? From ec2658b9d901ee7509a1d3453f2f57c7947346f6 Mon Sep 17 00:00:00 2001 From: Martin Artnik <85488244+artoscinote@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:20:24 +0200 Subject: [PATCH 2/2] Add OpenSSL namespace version_token --- app/models/asset_sync_token.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/asset_sync_token.rb b/app/models/asset_sync_token.rb index ef24dd334..2e9951d07 100644 --- a/app/models/asset_sync_token.rb +++ b/app/models/asset_sync_token.rb @@ -10,7 +10,7 @@ class AssetSyncToken < ApplicationRecord validates :token, uniqueness: true, presence: true def version_token - Digest::SHA256.base64digest(asset.file.checksum + asset.file_name) + OpenSSL::Digest::SHA256.base64digest(asset.file.checksum + asset.file_name) end def token_valid?