Skip to content

Commit

Permalink
[SERV-976] Update auth cookie and CI defaults (#20)
Browse files Browse the repository at this point in the history
* Update sinai auth key from 3days to 1year
* Update jruby CI versions

---------

Co-authored-by: Kevin S. Clarke <ksclarke@ksclarke.io>
  • Loading branch information
angelahuqing and ksclarke authored Nov 17, 2023
1 parent 8bcb614 commit e05f7f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
test:
strategy:
matrix:
ruby: [ jruby, jruby-head ]
ruby: [ jruby ]
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
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 e05f7f9

Please sign in to comment.