Ory Hydra Client for Elixir has a typo which breaks the client
Open
Nobody has claimed this yet.
bug
- Dominant language
- PHP
- Stars
- 178
- Forks
- 96
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- This issue affects my Ory Network project.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Describe the bug
def authorization(token, _scopes) when is_binary(token) do
{Tesla.Middleware.Headers, ["authorization", token]}
end
should be
def authorization(token, _scopes) when is_binary(token) do
{Tesla.Middleware.Headers, [{"authorization", token}]}
end
Reproducing the bug
Try running any requests
Relevant log output
** (FunctionClauseError) no function clause matching in anonymous fn/1 in Tesla.Adapter.Httpc.request/2
The following arguments were given to anonymous fn/1 in Tesla.Adapter.Httpc.request/2:
# 1
"authorization"
(tesla 1.7.0) lib/tesla/adapter/httpc.ex:55: anonymous fn/1 in Tesla.Adapter.Httpc.request/2
(elixir 1.14.4) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
(elixir 1.14.4) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
(tesla 1.7.0) lib/tesla/adapter/httpc.ex:55: Tesla.Adapter.Httpc.request/2
(tesla 1.7.0) lib/tesla/adapter/httpc.ex:22: Tesla.Adapter.Httpc.call/2
(ory_hydra 2.2.0-pre.0) lib/ory/api/o_auth2.ex:644: Ory.Api.OAuth2.o_auth2_authorize/2
iex:5: (file)
### Relevant configuration
_No response_
### Version
e471477af9c733ee7b84a6c869a35d4a5f17b67e
### On which operating system are you observing this issue?
macOS
### In which environment are you deploying?
Ory Network
### Additional Context
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the OAuth2 authorization implementation in lib/ory/api/o_auth2.ex, using the Tesla.Adapter.Httpc stack trace to locate how the authorization header is assembled. Reproduce the failure with an authorization request and verify that the corrected header structure allows the request to complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- api
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100