-
Notifications
You must be signed in to change notification settings - Fork 4
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
[TEC-3472] Add client authorization by session_id #26
base: main
Are you sure you want to change the base?
Conversation
…k (flowcommerce is relying on git tags only)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @texpert - Thank you for the PR! We really appreciate the input, and recognize this is a lacking feature in our Ruby SDK.
Please note that the file lib/flow_commerce/flow_api_v0_client.rb
is actually an auto-generated Ruby client by apibuilder. This is a tool we use to document our REST APIs at Flow, and generate clients across multiple languages and platforms. Manually altering this file would mean possible loss of these changes when we deploy new versions of this project.
The Ruby generator currently does not support auth schemes other than basic auth. Feel free to add an issue directly to https://github.com/apicollective/apibuilder-generator
In the meantime, a possible way around this is to override/monkeypatch Io::Flow::V0::HttpClient::Request
, similar to what you did, but not on the generated file itself. This will ensure a manually created session auth will be reusable even if the file is replaced with a newly generated version.
Another way around this it to manually pass Authorization
in the default_headers
hash, while passing in no authorization
, eg:
flow_client_with_session_auth = ::Io::Flow::V0::Client.new(
default_headers: { "Authorization": "session XXXXXXXXXXXXX", "Other-Header": "YYYYYYYYYYY" },
authorization: nil
)
Hello, @paololim! Thank you for review and advise! Meanwhile, I have opened a PR to the apibuilder-generator, please, review: apicollective/apibuilder-generator#624 If it will happen to be acceptable, then the |
…ion_id specified in default headers This is a workaround for Missing Session AuthScema proposed by the flow.io dev - flowcommerce/ruby-sdk#26 (review) Allows to update flowcommerce gem, not depending on a fork.
…ion_id specified in default headers This is a workaround for Missing Session AuthScema proposed by the flow.io dev - flowcommerce/ruby-sdk#26 (review) Allows to update flowcommerce gem, not depending on a fork.
…ion_id specified in default headers This is a workaround for Missing Session AuthScema proposed by the flow.io dev - flowcommerce/ruby-sdk#26 (review) Allows to update flowcommerce gem, not depending on a fork.
…ion_id specified in default headers This is a workaround for Missing Session AuthScema proposed by the flow.io dev - flowcommerce/ruby-sdk#26 (review) Allows to update flowcommerce gem, not depending on a fork.
…ion_id specified in default headers This is a workaround for Missing Session AuthScema proposed by the flow.io dev - flowcommerce/ruby-sdk#26 (review) Allows to update flowcommerce gem, not depending on a fork.
…ion_id specified in default headers This is a workaround for Missing Session AuthScema proposed by the flow.io dev - flowcommerce/ruby-sdk#26 (review) Allows to update flowcommerce gem, not depending on a fork.
…ion_id specified in default headers This is a workaround for Missing Session AuthScema proposed by the flow.io dev - flowcommerce/ruby-sdk#26 (review) Allows to update flowcommerce gem, not depending on a fork.
…ion_id specified in default headers This is a workaround for Missing Session AuthScema proposed by the flow.io dev - flowcommerce/ruby-sdk#26 (review) Allows to update flowcommerce gem, not depending on a fork.
…ommerce-to-latest
…atest [RO-817] Update flowcommerce to latest version
Pass the Flow Session id in the authorization header when syncing orders to flow.io