diff --git a/README.md b/README.md index c5ae09f..d795543 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The wrapped methods include: | method | FOLIO API endpoint | | ------ | ----- | -| authenticate | /authn/login | +| authenticate | /authn/login-with-expiry | | patron_record | /users | | patron_account | /patron/account | | renew_item | /patron/account | diff --git a/lib/cul/folio/edge.rb b/lib/cul/folio/edge.rb index acca970..a7a57e6 100644 --- a/lib/cul/folio/edge.rb +++ b/lib/cul/folio/edge.rb @@ -5,11 +5,17 @@ module CUL module FOLIO module Edge - class Error < StandardError; end + class Error < StandardError; end ## - # Connects to an Okapi instance and uses the +/authn/login+ endpoint - # to authenticate the user. + # Connects to an Okapi instance and uses the +/authn/login-with-expiry+ endpoint + # to authenticate the user. This version of the method is intended for use with + # FOLIO's new Refresh Token Rotation approach to authentication, which is detailed + # at https://folio-org.atlassian.net/wiki/spaces/FOLIJET/pages/1396980/Refresh+Token+Rotation+RTR. + # + # Note that the return value ignores the refresh token that FOLIO provides. Since this library + # is intended for short-lived interactions with FOLIO, the refresh token is not needed. The access + # token should have a sufficient TTL for the duration of the interaction. # # Params: # +okapi+:: URL of an okapi instance (e.g., "https://folio-snapshot-okapi.dev.folio.org") @@ -19,12 +25,13 @@ class Error < StandardError; end # # Return: # A hash containing: - # +:token+:: An Okapi X-Okapi-Token string, or nil + # +:token+:: An Okapi Access Token, or nil + # +:token_exp+:: The expiration date of the token, or nil # +:code+:: An HTTP response code # +:error+:: An error message, or nil ## def self.authenticate(okapi, tenant, username, password) - url = "#{okapi}/authn/login" + url = "#{okapi}/authn/login-with-expiry" headers = { 'X-Okapi-Tenant' => tenant, :accept => 'application/json', @@ -42,15 +49,24 @@ def self.authenticate(okapi, tenant, username, password) } begin + # A successful login will return a 201 with a Set-Cookie header that includes both the Access Token + # and the Refresh Token. We're only interested in the Access Token, so we'll parse that out from Set-Cookie. response = RestClient.post(url, body, headers) - return_value[:token] = response.headers[:x_okapi_token] + cookies = response.headers[:set_cookie] + cookies.each do |cookie| + if cookie.start_with?('folioAccessToken=') + return_value[:token] = cookie.match(/folioAccessToken=(.*?);/)[1] + return_value[:token_exp] = JSON.parse(response.body)['accessTokenExpiration'] + break + end + end return_value[:code] = response.code rescue RestClient::ExceptionWithResponse => err return_value[:code] = err.response.code return_value[:error] = err.response.body end - return return_value + return_value end ## diff --git a/lib/cul/folio/edge/version.rb b/lib/cul/folio/edge/version.rb index 3083dee..741a02e 100644 --- a/lib/cul/folio/edge/version.rb +++ b/lib/cul/folio/edge/version.rb @@ -1,7 +1,7 @@ module Cul module Folio module Edge - VERSION = "3.0" + VERSION = "3.1" end end end diff --git a/release_notes.md b/release_notes.md index e7eb2bf..617cf6b 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,9 @@ # Release Notes - cul-folio-edge +## [3.1] - 2024-08-12 +### Changed +- Updated the `authenticate` method to use the new token rotation/refresh system implemented in Quesnalia, Ransoms, and higher (DACCESS-261) + ## 3.0 - Update the `request_item` method for FOLIO Poppy change to spelling of `fulfillmentPreference` (DACCESS-207) - Add basic test setup using RSpec, VCR, and initial tests (cf. DACCESS-97) diff --git a/spec/authenticate_spec.rb b/spec/authenticate_spec.rb index 6aac615..ab8fbbb 100644 --- a/spec/authenticate_spec.rb +++ b/spec/authenticate_spec.rb @@ -9,6 +9,7 @@ VCR.use_cassette('authentication_successful') do response = CUL::FOLIO::Edge.authenticate(okapi, tenant, ENV['OKAPI_USER'], ENV['OKAPI_PW']) expect(response[:token]).to_not be_nil + expect { DateTime.parse(response[:token_exp]) }.not_to raise_error(TypeError) expect(response[:code]).to be(201) expect(response[:error]).to be_nil end @@ -18,6 +19,7 @@ VCR.use_cassette('authentication_unsuccessful') do response = CUL::FOLIO::Edge.authenticate(okapi, tenant, 'George', 'letmein') expect(response[:token]).to be_nil + expect { DateTime.parse(response[:token_exp]) }.to raise_error(TypeError) expect(response[:code]).to be(422) expect(response[:error]).to_not be_nil end diff --git a/spec/cassettes/authentication_successful.yml b/spec/cassettes/authentication_successful.yml index 8a10017..9c5d2ae 100644 --- a/spec/cassettes/authentication_successful.yml +++ b/spec/cassettes/authentication_successful.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: "/authn/login" + uri: "/authn/login-with-expiry" body: encoding: UTF-8 string: '{"username":"","password":""}' @@ -10,9 +10,8 @@ http_interactions: Accept: - application/json User-Agent: - - rest-client/2.1.0 (darwin21 x86_64) ruby/3.1.2p20 - X-Okapi-Tenant: - - "" + - rest-client/2.1.0 (darwin23 x86_64) ruby/3.1.2p20 + X-Okapi-Tenant: "" X-Forwarded-For: - Stripes Content-Type: @@ -22,13 +21,14 @@ http_interactions: Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: "" + X-Okapi-Token: "" response: status: code: 201 message: Created headers: Date: - - Thu, 22 Feb 2024 21:12:21 GMT + - Thu, 18 Apr 2024 14:30:37 GMT Content-Type: - application/json Transfer-Encoding: @@ -37,14 +37,11 @@ http_interactions: - keep-alive Server: - nginx + Set-Cookie: folioAccessToken=; folioRefreshToken= X-Okapi-Token: "" Refreshtoken: "" body: encoding: ASCII-8BIT - string: |- - { - "okapiToken" : "", - "refreshToken" : "" - } - recorded_at: Thu, 22 Feb 2024 21:12:21 GMT -recorded_with: VCR 6.1.0 + string: '{"accessTokenExpiration":"2024-04-18T15:30:37Z","refreshTokenExpiration":"2024-04-18T15:30:37Z"}' + recorded_at: Thu, 18 Apr 2024 14:30:37 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/authentication_unsuccessful.yml b/spec/cassettes/authentication_unsuccessful.yml index e5e6cc5..4ceb1fa 100644 --- a/spec/cassettes/authentication_unsuccessful.yml +++ b/spec/cassettes/authentication_unsuccessful.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: "/authn/login" + uri: "/authn/login-with-expiry" body: encoding: UTF-8 string: '{"username":"George","password":"letmein"}' @@ -10,9 +10,8 @@ http_interactions: Accept: - application/json User-Agent: - - rest-client/2.1.0 (darwin21 x86_64) ruby/3.1.2p20 - X-Okapi-Tenant: - - "" + - rest-client/2.1.0 (darwin23 x86_64) ruby/3.1.2p20 + X-Okapi-Tenant: "" X-Forwarded-For: - Stripes Content-Type: @@ -22,13 +21,14 @@ http_interactions: Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: "" + X-Okapi-Token: "" response: status: code: 422 message: Unprocessable Entity headers: Date: - - Thu, 22 Feb 2024 21:14:25 GMT + - Thu, 18 Apr 2024 14:30:37 GMT Content-Type: - application/json Transfer-Encoding: @@ -37,6 +37,7 @@ http_interactions: - keep-alive Server: - nginx + Set-Cookie: folioAccessToken=; folioRefreshToken= X-Okapi-Token: "" Refreshtoken: "" body: @@ -53,5 +54,5 @@ http_interactions: } ] } ] } - recorded_at: Thu, 22 Feb 2024 21:14:25 GMT -recorded_with: VCR 6.1.0 + recorded_at: Thu, 18 Apr 2024 14:30:37 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/request_item_error.yml b/spec/cassettes/request_item_error.yml index a04097e..656b7bf 100644 --- a/spec/cassettes/request_item_error.yml +++ b/spec/cassettes/request_item_error.yml @@ -5,17 +5,17 @@ http_interactions: uri: "/circulation/requests" body: encoding: UTF-8 - string: '{"instanceId":"33e31b39-c9f1-469a-84bf-ff144e9f594f","holdingsRecordId":"097481bf-dcd5-4745-a66e-f63410285a12","itemId":"397905ac-819f-4bd6-8b2e-32925be9d5b8","requesterId":"53020f20-a1f0-4ef1-b3f3-7a27567f62ec","requestType":"Hold","requestDate":"2024-02-29T22:25:37Z","requestLevel":"Item","fulfilmentPreference":"Hold + string: '{"instanceId":"33e31b39-c9f1-469a-84bf-ff144e9f594f","holdingsRecordId":"097481bf-dcd5-4745-a66e-f63410285a12","itemId":"397905ac-819f-4bd6-8b2e-32925be9d5b8","requesterId":"53020f20-a1f0-4ef1-b3f3-7a27567f62ec","requestType":"Hold","requestDate":"2024-02-29T22:25:37Z","requestLevel":"Item","fulfillmentPreference":"Hold Shelf","pickupServicePointId":"760beccd-362d-45b6-bfae-639565a877f2"}' headers: Accept: - application/json User-Agent: - - rest-client/2.1.0 (darwin21 x86_64) ruby/3.1.2p20 + - rest-client/2.1.0 (darwin23 x86_64) ruby/3.1.2p20 X-Okapi-Tenant: "" X-Okapi-Token: "" Content-Length: - - '390' + - '391' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: "" @@ -25,7 +25,7 @@ http_interactions: message: Unprocessable Entity headers: Date: - - Mon, 26 Feb 2024 20:42:20 GMT + - Thu, 18 Apr 2024 13:56:03 GMT Content-Type: - application/json; charset=utf-8 Transfer-Encoding: @@ -34,6 +34,7 @@ http_interactions: - keep-alive Server: - nginx + Set-Cookie: "" X-Okapi-Token: "" Refreshtoken: "" body: @@ -51,8 +52,9 @@ http_interactions: }, { "key" : "requestId", "value" : null - } ] + } ], + "code" : "ITEM_ALREADY_REQUESTED" } ] } - recorded_at: Mon, 26 Feb 2024 20:42:16 GMT -recorded_with: VCR 6.1.0 + recorded_at: Thu, 18 Apr 2024 13:56:03 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/request_item_successful.yml b/spec/cassettes/request_item_successful.yml index 87e8f40..8743904 100644 --- a/spec/cassettes/request_item_successful.yml +++ b/spec/cassettes/request_item_successful.yml @@ -5,17 +5,17 @@ http_interactions: uri: "/circulation/requests" body: encoding: UTF-8 - string: '{"instanceId":"33e31b39-c9f1-469a-84bf-ff144e9f594f","holdingsRecordId":"097481bf-dcd5-4745-a66e-f63410285a12","itemId":"397905ac-819f-4bd6-8b2e-32925be9d5b8","requesterId":"53020f20-a1f0-4ef1-b3f3-7a27567f62ec","requestType":"Hold","requestDate":"2024-02-29T22:25:37Z","requestLevel":"Item","fulfilmentPreference":"Hold + string: '{"instanceId":"33e31b39-c9f1-469a-84bf-ff144e9f594f","holdingsRecordId":"097481bf-dcd5-4745-a66e-f63410285a12","itemId":"397905ac-819f-4bd6-8b2e-32925be9d5b8","requesterId":"53020f20-a1f0-4ef1-b3f3-7a27567f62ec","requestType":"Hold","requestDate":"2024-02-29T22:25:37Z","requestLevel":"Item","fulfillmentPreference":"Hold Shelf","pickupServicePointId":"760beccd-362d-45b6-bfae-639565a877f2"}' headers: Accept: - application/json User-Agent: - - rest-client/2.1.0 (darwin21 x86_64) ruby/3.1.2p20 + - rest-client/2.1.0 (darwin23 x86_64) ruby/3.1.2p20 X-Okapi-Tenant: "" X-Okapi-Token: "" Content-Length: - - '390' + - '391' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: "" @@ -25,7 +25,7 @@ http_interactions: message: Created headers: Date: - - Mon, 26 Feb 2024 20:40:44 GMT + - Thu, 18 Apr 2024 13:56:02 GMT Content-Type: - application/json; charset=utf-8 Transfer-Encoding: @@ -34,11 +34,12 @@ http_interactions: - keep-alive Server: - nginx + Set-Cookie: "" X-Okapi-Token: "" Refreshtoken: "" body: encoding: ASCII-8BIT string: !binary |- - ewogICJpZCIgOiAiM2QyNjIwZTMtZDZmZS00OTRhLTk0YTAtNmVlMjMxNTgwNzYxIiwKICAicmVxdWVzdExldmVsIiA6ICJJdGVtIiwKICAicmVxdWVzdFR5cGUiIDogIkhvbGQiLAogICJyZXF1ZXN0RGF0ZSIgOiAiMjAyNC0wMi0yOVQyMjoyNTozNy4wMDArMDA6MDAiLAogICJyZXF1ZXN0ZXJJZCIgOiAiNTMwMjBmMjAtYTFmMC00ZWYxLWIzZjMtN2EyNzU2N2Y2MmVjIiwKICAiaW5zdGFuY2VJZCIgOiAiMzNlMzFiMzktYzlmMS00NjlhLTg0YmYtZmYxNDRlOWY1OTRmIiwKICAiaG9sZGluZ3NSZWNvcmRJZCIgOiAiMDk3NDgxYmYtZGNkNS00NzQ1LWE2NmUtZjYzNDEwMjg1YTEyIiwKICAiaXRlbUlkIiA6ICIzOTc5MDVhYy04MTlmLTRiZDYtOGIyZS0zMjkyNWJlOWQ1YjgiLAogICJzdGF0dXMiIDogIk9wZW4gLSBOb3Qge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ml0aXNoIExpYnJhcnkiCiAgICB9IF0sCiAgICAicHVibGljYXRpb24iIDogWyB7CiAgICAgICJwdWJsaXNoZXIiIDogIkJsb29tc2J1cnkgUHVibGlzaGluZyIsCiAgICAgICJwbGFjZSIgOiAiTG9uZG9uIiwKICAgICAgImRhdGVPZlB1YmxpY2F0aW9uIiA6ICIyMDE3IiwKICAgICAgInJvbGUiIDogIlB1YmxpY2F0aW9uIgogICAgfSwgewogICAgICAiZGF0ZU9mUHVibGljYXRpb24iIDogIsKpMjAxNyIKICAgIH0gXQogIH0sCiAgIml0ZW0iIDogewogICAgImJhcmNvZGUiIDogIjMxOTI0MTI1NzIyMzgzIiwKICAgICJsb2NhdGlvbiIgOiB7CiAgICAgICJuYW1lIiA6ICJPbGluIiwKICAgICAgImxpYnJhcnlOYW1lIiA6ICJPbGluIExpYnJhcnkiLAogICAgICAiY29kZSIgOiAib2xpbiIKICAgIH0sCiAgICAic3RhdHVzIiA6ICJDaGVja2VkIG91dCIsCiAgICAiY2FsbE51bWJlciIgOiAiUFI2MDY4Lk85MyBIMzcgMjAxNyIsCiAgICAiY2FsbE51bWJlckNvbXBvbmVudHMiIDogewogICAgICAiY2FsbE51bWJlciIgOiAiUFI2MDY4Lk85MyBIMzcgMjAxNyIsCiAgICAgICJwcmVmaXgiIDogIk92ZXJzaXplIiwKICAgICAgInN1ZmZpeCIgOiAiKyIKICAgIH0sCiAgICAiY29weU51bWJlciIgOiAiMSIKICB9LAogICJyZXF1ZXN0ZXIiIDogewogICAgImxhc3ROYW1lIiA6ICJDb25ub2xseSIsCiAgICAiZmlyc3ROYW1lIiA6ICJNYXR0IiwKICAgICJiYXJjb2RlIiA6ICIyNTUxMDAwMTIxOTY4MjEiLAogICAgInBhdHJvbkdyb3VwSWQiIDogIjM2ODRhNzg2LTY2NzEtNDI2OC04ZWQwLTlkYjgyZWJjYTYwYiIKICB9LAogICJmdWxmaWxsbWVudFByZWZlcmVuY2UiIDogIkhvbGQgU2hlbGYiLAogICJwaWNrdXBTZXJ2aWNlUG9pbnRJZCIgOiAiNzYwYmVjY2QtMzYyZC00NWI2LWJmYWUtNjM5NTY1YTg3N2YyIiwKICAibWV0YWRhdGEiIDogewogICAgImNyZWF0ZWREYXRlIiA6ICIyMDI0LTA0LTE4VDEzOjU2OjAyLjI2NSswMDowMCIsCiAgICAiY3JlYXRlZEJ5VXNlcklkIiA6ICJlODE2YmQ0MS05MWRkLTQzNzUtYmUyNi0zNDJmMGY3YjgyZTMiLAogICAgInVwZGF0ZWREYXRlIiA6ICIyMDI0LTA0LTE4VDEzOjU2OjAyLjI2NSswMDowMCIsCiAgICAidXBkYXRlZEJ5VXNlcklkIiA6ICJlODE2YmQ0MS05MWRkLTQzNzUtYmUyNi0zNDJmMGY3YjgyZTMiCiAgfSwKICAicG9zaXRpb24iIDogMSwKICAibG9hbiIgOiB7CiAgICAiZHVlRGF0ZSIgOiAiMjAyNC0wOS0xMlQwMzo1OTo1OS4wMDBaIgogIH0sCiAgInBpY2t1cFNlcnZpY2VQb2ludCIgOiB7CiAgICAibmFtZSIgOiAiT2xpbiBTZXJ2aWNlIFBvaW50IiwKICAgICJjb2RlIiA6ICJvbGluLGNpcmMiLAogICAgImRpc2NvdmVyeURpc3BsYXlOYW1lIiA6ICJPbGluIExpYnJhcnkiLAogICAgImRlc2NyaXB0aW9uIiA6IG51bGwsCiAgICAic2hlbHZpbmdMYWdUaW1lIiA6IDQzMjAsCiAgICAicGlja3VwTG9jYXRpb24iIDogdHJ1ZQogIH0KfQ== + recorded_at: Thu, 18 Apr 2024 13:56:02 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 143a871..dc14397 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -32,6 +32,7 @@ # ...rather than: # # => "be bigger than 2" expectations.include_chain_clauses_in_custom_matcher_descriptions = true + expectations.on_potential_false_positives = :nothing end # rspec-mocks config goes here. You can use an alternate test double @@ -142,6 +143,7 @@ refreshToken = interaction.response.headers['Refreshtoken']&.first interaction.response.body.gsub!(token, '') if token interaction.response.body.gsub!(refreshToken, '') if refreshToken + interaction.response.headers['Set-Cookie'] = 'folioAccessToken=; folioRefreshToken=' interaction.response.headers['X-Okapi-Token'] = '' interaction.response.headers['Refreshtoken'] = '' end