mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
Fix security schemes representation
This commit is contained in:
parent
1994002685
commit
343f51a867
|
@ -10,7 +10,7 @@ import { OpenAPISecurityScheme } from '../../types';
|
|||
const AUTH_TYPES = {
|
||||
oauth2: 'OAuth2',
|
||||
apiKey: 'API Key',
|
||||
basic: 'Basic Authorization',
|
||||
http: 'HTTP',
|
||||
openIdConnect: 'Open ID Connect',
|
||||
};
|
||||
|
||||
|
@ -23,6 +23,10 @@ const AuthTable = styled.table`
|
|||
ul > li {
|
||||
margin: 0.5em 0 !important;
|
||||
}
|
||||
|
||||
th {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
`;
|
||||
|
||||
export class OAuthFlow extends React.PureComponent<OAuthFlowProps> {
|
||||
|
@ -84,7 +88,7 @@ export class SecurityDefs extends React.PureComponent<SecurityDefsProps> {
|
|||
<tbody>
|
||||
<tr>
|
||||
<th> Security scheme type: </th>
|
||||
<td> {AUTH_TYPES[scheme.type]} </td>
|
||||
<td> {AUTH_TYPES[scheme.type] || scheme.type} </td>
|
||||
</tr>
|
||||
{scheme.apiKey ? (
|
||||
<tr>
|
||||
|
@ -93,14 +97,17 @@ export class SecurityDefs extends React.PureComponent<SecurityDefsProps> {
|
|||
</tr>
|
||||
) : scheme.http ? (
|
||||
[
|
||||
<tr>
|
||||
<tr key="scheme">
|
||||
<th> HTTP Authorization Scheme </th>
|
||||
<th> {scheme.http.scheme} </th>
|
||||
</tr>,
|
||||
<tr>
|
||||
<th> Bearer format </th>
|
||||
<th> "{scheme.http.bearerFormat}" </th>
|
||||
<td> {scheme.http.scheme} </td>
|
||||
</tr>,
|
||||
scheme.http.scheme === 'bearer' &&
|
||||
scheme.http.bearerFormat && (
|
||||
<tr key="bearer">
|
||||
<th> Bearer format </th>
|
||||
<td> "{scheme.http.bearerFormat}" </td>
|
||||
</tr>
|
||||
),
|
||||
]
|
||||
) : scheme.openId ? (
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue
Block a user