USACE / USACE/cwms-data-api

Consistent use of apiKey

Open
#926 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Java
Stars
28
Forks
25
Avg merge
4d 22h
Merged PRs (30d)
20

Description

The apiKey in the swagger docs lists "ApiKey", "apiKey" and "apikey" all in the same view.
image
on 3.1.5-RC14

Suggesting making all three "apiKey", to ensure users are not confused on the correct usage.

It is shown as apikey in this example
https://github.com/USACE/cwms-data-api/blob/1fc86810fe2c9808a6d27b1877c45cb4f5061a11/cwms-data-api/src/main/java/cwms/cda/security/KeyAccessManager.java#L59

If you try to enter "apikey" in swagger it will work, (possibly due to this toLowerCase()?

However doing this in CURL fails unless you capitalize the K.

  • @tsressin also ran into this

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cwms-data-api/src/main/java/cwms/cda/security/KeyAccessManager.java at lines 59 and 75, then inspect the Swagger/OpenAPI security definition that displays the three variants. Confirm that the apiKey spelling is consistent and that the documented value works in both Swagger and cURL.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, authentication
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.