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
Changes from 1 commit
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: 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.authenticated_request('/_/proxy/tenants/sul/timers'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we pair on this? We don't have to be authenticated in order to run this within the cluster. Doing curl $OKAPI_URL/_/proxy/tenants/sul/timers from the folio-k8s-pod returns data.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I can change it to @@folio_request.request('/_/proxy/tenants/sul/timers') and that should work as well.

end

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

Expand Down
Loading