Skip to content

Commit

Permalink
fixes #1042 show HTTP Bearer token name if provided in the spec
Browse files Browse the repository at this point in the history
  • Loading branch information
mrin9 committed Oct 17, 2024
1 parent c922ffe commit ff96cdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/templates/security-scheme-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,10 @@ export function pathSecurityTemplate(pathSecurity) {
? html`
<div>
${orSecurityItem1.securityDefs.length > 1 ? html`<b>${j + 1}.</b> &nbsp;` : html`Requires`}
${andSecurityItem.scheme === 'basic' ? 'Base 64 encoded username:password' : 'Bearer Token'} in <b>Authorization header</b>
${andSecurityItem.scheme === 'basic'
? 'Base 64 encoded username:password'
: `Bearer Token' <b> ${andSecurityItem.name} </b>`
} in <b>Authorization header</b>
${scopeHtml}
</div>`
: html`
Expand Down
2 changes: 1 addition & 1 deletion src/utils/spec-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default async function ProcessSpec(
// Updated Security Type Display Text based on Type
securitySchemes.forEach((v) => {
if (v.type === 'http') {
v.typeDisplay = v.scheme === 'basic' ? 'HTTP Basic' : 'HTTP Bearer';
v.typeDisplay = v.scheme === 'basic' ? 'HTTP Basic' : `HTTP Bearer ${v.name}`;
} else if (v.type === 'apiKey') {
v.typeDisplay = `API Key (${v.name})`;
} else if (v.type === 'oauth2') {
Expand Down

0 comments on commit ff96cdc

Please sign in to comment.