Skip to content

Commit

Permalink
[SERV-976] Update sinai auth key from 3days to 1year
Browse files Browse the repository at this point in the history
[SERV-976] Update to auth key for sinai
  • Loading branch information
angelahuqing committed Nov 17, 2023
1 parent 8bcb614 commit a589509
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/delegates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def authorize(_options = {})

# Our important cookie names
@iv = 'initialization_vector'
@auth = 'sinai_authenticated_3day'
@auth = 'sinai_authenticated_1year'

# If we have just the raw cookies header, parse it into cookies
parse_cookies if @cookies&.key?('Cookie')
Expand Down
8 changes: 4 additions & 4 deletions spec/custom_delegate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
'request_uri' => 'http://example.org/iiif/asdfasdf/full/pct:70/0/default.jpg',
'full_size' => { 'width' => '1024', 'height' => '1024' },
'cookies' => {
'sinai_authenticated_3day' => auth_cookie_value
'sinai_authenticated_1year' => auth_cookie_value
}
}
expect(delegate.authorize).to eq(false)
Expand All @@ -101,7 +101,7 @@
'full_size' => { 'width' => '1024', 'height' => '1024' },
'cookies' => {
'initialization_vector' => iv_cookie_value,
'sinai_authenticated_3day' => auth_cookie_value
'sinai_authenticated_1year' => auth_cookie_value
}
}
expect(delegate.authorize).to be(true)
Expand All @@ -114,7 +114,7 @@
'full_size' => { 'width' => '1024', 'height' => '1024' },
'cookies' =>
{
'Cookie' => 'initialization_vector=' + iv_cookie_value + '; ' + 'sinai_authenticated_3day=' + auth_cookie_value
'Cookie' => 'initialization_vector=' + iv_cookie_value + '; ' + 'sinai_authenticated_1year=' + auth_cookie_value
}
}
expect(delegate.authorize).to be(true)
Expand All @@ -127,7 +127,7 @@
'full_size' => { 'width' => '1024', 'height' => '1024' },
'cookies' => {
'initialization_vector' => iv_cookie_value,
'sinai_authenticated_3day' => auth_cookie_value
'sinai_authenticated_1year' => auth_cookie_value
}
}
expect(delegate.source).to be('S3Source')
Expand Down

0 comments on commit a589509

Please sign in to comment.