Ensure API params have binary keys
Nobody has claimed this yet.
- Dominant language
- Erlang
- Stars
- 105
- Forks
- 34
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 6
Description
In some cases we manually use binary keys:
https://github.com/hexpm/hex_core/blob/v0.6.1/src/hex_api_key.erl#L20:
Params = #{<<"name">> => Name, <<"permissions">> => Permissions},
but in some we allow user to pass the map:
https://github.com/hexpm/hex_core/blob/v0.6.1/src/hex_api_release.erl#L45
hex_api:post(Config, Path, Params).
And so the user may pass atom keys like we used to do here:
We should ensure the params are always a map of binary keys.
Contributor guide
No contributing guide indexed for this repository
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 with the parameter construction in src/hex_api_key.erl and the user-supplied map passed through src/hex_api_release.erl to hex_api:post/3. Trace the request path to identify where key normalization belongs; done means every API parameter map sent through these paths uses binary keys, including maps supplied by users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100