swagger-api / swagger-api/swagger-ui

Disable autocompletion for authorization secrets

Open
#9,921 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

When inputting values for the API key and bearer token, there's a possibility of autocompletion, which can potentially reveal previously used secrets.
We want these values to remain visible to users as they type, while ensuring that they are not exposed through autocompletion, similar to how it happens when creating secrets in GitHub repositories. As such, we propose to implement a simple solution by setting autoComplete=off for these inputs:
https://github.com/swagger-api/swagger-ui/blob/1367a8fbdfddd697b8c71493bb09c01baf17d5a3/src/core/components/auth/api-key-auth.jsx#L73-L78

https://github.com/swagger-api/swagger-ui/blob/1367a8fbdfddd697b8c71493bb09c01baf17d5a3/src/core/plugins/oas3/components/auth/http-auth.jsx#L132-L138

Additional context or thoughts

This issue was raised with https://github.com/swagger-api/swagger-ui/pull/9858

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 src/core/components/auth/api-key-auth.jsx lines 73-78 and src/core/plugins/oas3/components/auth/http-auth.jsx lines 132-138, as linked in the issue. Verify how the API key and bearer token inputs are defined, then confirm that autocomplete is disabled while values remain visible during typing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, frontend, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.