Skip to content
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

add name tag to bearer input field #7743

Merged
merged 3 commits into from
Mar 15, 2022
Merged

add name tag to bearer input field #7743

merged 3 commits into from
Mar 15, 2022

Conversation

RayBB
Copy link
Contributor

@RayBB RayBB commented Jan 10, 2022

Description

  • Adds the name tag to the html element

Motivation and Context

By default, swagger-ui does not save authorization bearer - see docs. fastapi does not yet enable users to change the swagger-ui configuration.

In the mean time I'd like to be able to use bitwarden, my password manager, to autofill this as a custom field. To do so, it needs to have some kind of selector id, name, aria-label, or placeholder.

Since the username and password input fields in swagger-ui already have the name tag I followed that pattern.

I understand this isn't the best place to add a fix but it is the easiest.

There are two additional benefits to adding this:

  • make using the website easier for users with assistive technology.
  • using a password manager to autofill lets you easily store/cycle through multiple tokens

How Has This Been Tested?

I ran npm run test.
Seeing as this is an extremely small change I wasn't sure if anything more would be appropriate.

Screenshots (if appropriate):

Checklist

My PR contains...

  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes.

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

@tim-lai
Copy link
Contributor

tim-lai commented Mar 10, 2022

@char0n I'm ok with this change, what do you think?

Copy link
Member

@char0n char0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks legit!

@char0n
Copy link
Member

char0n commented Mar 14, 2022

@tim-lai looks legit, it gives name to input which is specific to bearer auth workflow.

@tim-lai tim-lai merged commit d064198 into swagger-api:master Mar 15, 2022
@RayBB RayBB deleted the patch-1 branch March 15, 2022 18:43
@tim-lai
Copy link
Contributor

tim-lai commented Mar 23, 2022

@RayBB fyi, followup PR #7930 changes this to use aria-label instead of name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants