Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use authenticated requests on the cluster #319

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions config/settings/pod.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
okapi:
url: htts://okapi:9130
headers:
X-Okapi-Tenant: sul
User-Agent: FolioApiClient
login_params:
username: user
password: pass

hostname: https://folio.stanford.edu
namespace: folio
Expand Down
6 changes: 0 additions & 6 deletions lib/folio_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ def request(path, headers: {}, method: :get, **other)
.request(method, base_url + path, **other)
end

def unauthenticated_request(path, headers: {}, method: :get, **other)
HTTP
.headers(DEFAULT_HEADERS.merge(headers))
.request(method, base_url + path, **other)
end

def base_url
Settings.okapi.url
end
Expand Down
4 changes: 2 additions & 2 deletions tasks/helpers/okapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ module OkapiTaskHelpers
include FolioRequestHelper

def timers_get
JSON.parse(@@folio_request.unauthenticated_request('/_/proxy/tenants/sul/timers'))
JSON.parse(@@folio_request.request('/_/proxy/tenants/sul/timers'))
end

def timers_patch(json)
response = @@folio_request.unauthenticated_request('/_/proxy/tenants/sul/timers', method: :patch, body: json)
response = @@folio_request.request('/_/proxy/tenants/sul/timers', method: :patch, body: json)
response.code
end

Expand Down
Loading