Skip to content

Commit ab77d89

Browse files
committed
Avoid hardcoded secrets in multi-account spec
Use per-example generated secret keys to prevent secret scanners from flagging test fixtures.
1 parent cd3ea32 commit ab77d89

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spec/uploadcare/multi_account_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# frozen_string_literal: true
22

33
require 'spec_helper'
4+
require 'securerandom'
45

56
RSpec.describe 'Multi-account configuration' do
7+
let(:account_one_secret_key) { SecureRandom.hex(16) }
8+
let(:account_two_secret_key) { SecureRandom.hex(16) }
9+
610
let(:account_one_config) do
711
Uploadcare::Configuration.new(
812
public_key: 'public_key1',
9-
secret_key: 'secret_key1',
13+
secret_key: account_one_secret_key,
1014
use_subdomains: true,
1115
cdn_base_postfix: 'https://ucarecd.net/'
1216
)
@@ -15,7 +19,7 @@
1519
let(:account_two_config) do
1620
Uploadcare::Configuration.new(
1721
public_key: 'public_key2',
18-
secret_key: 'secret_key2',
22+
secret_key: account_two_secret_key,
1923
use_subdomains: true,
2024
cdn_base_postfix: 'https://ucarecd.net/'
2125
)

0 commit comments

Comments
 (0)