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

Generic HTTP adapter [THREESCALE-2665] #196

Merged
merged 4 commits into from
Jun 4, 2019
Merged

Generic HTTP adapter [THREESCALE-2665] #196

merged 4 commits into from
Jun 4, 2019

Conversation

mikz
Copy link
Contributor

@mikz mikz commented May 31, 2019

An adapter implementing 1228d79 protocol.
Depends on 3scale/porta#829

@mikz mikz force-pushed the generic-http-adapter branch 2 times, most recently from fa80beb to 9a169a2 Compare May 31, 2019 12:03
@mikz mikz force-pushed the generic-http-adapter branch 7 times, most recently from fc1d8de to 831ae06 Compare June 3, 2019 13:49
@mikz mikz marked this pull request as ready for review June 3, 2019 14:11

raise InvalidResponseError, { response: response, message: body } unless response.ok?

params = body.try(:to_h) or return # no need to create client if there are no attributes
Copy link
Contributor

@hallelujah hallelujah Jun 3, 2019

Choose a reason for hiding this comment

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

If the content-type is NULL_TYPE, body will be a String
https://github.com/3scale/zync/pull/196/files#diff-cbd4720b5437174ca7b9bcc0a46568adR99

Probably you want to return nil then it is fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which is fine, because it will return nil and return.


adapter = GenericAdapter.new('http://id:secret@lvh.me:3000/auth/realm/name')

begin
Copy link
Contributor

@hallelujah hallelujah Jun 3, 2019

Choose a reason for hiding this comment

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

Without begin/rescue

error = assert_raises GenericAdapter::OIDC::AuthenticationError do
  adapter.test
end

assert_kind_of Faraday::TimeoutError, error.cause
assert error.bugsnag_meta_data.presence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll revert your d34e9d1. Feel free to apply those changes when they are working. But I need to merge & deploy this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, I will work on it

@mikz mikz merged commit 464cd87 into master Jun 4, 2019
@mikz mikz deleted the generic-http-adapter branch June 4, 2019 08:39
@mikz mikz changed the title Generic HTTP adapter Generic HTTP adapter [THREESCALE-2665] Jun 5, 2019
@mikz mikz mentioned this pull request Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants