mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 10:33:44 +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 = {
|
const AUTH_TYPES = {
|
||||||
oauth2: 'OAuth2',
|
oauth2: 'OAuth2',
|
||||||
apiKey: 'API Key',
|
apiKey: 'API Key',
|
||||||
basic: 'Basic Authorization',
|
http: 'HTTP',
|
||||||
openIdConnect: 'Open ID Connect',
|
openIdConnect: 'Open ID Connect',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,6 +23,10 @@ const AuthTable = styled.table`
|
||||||
ul > li {
|
ul > li {
|
||||||
margin: 0.5em 0 !important;
|
margin: 0.5em 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export class OAuthFlow extends React.PureComponent<OAuthFlowProps> {
|
export class OAuthFlow extends React.PureComponent<OAuthFlowProps> {
|
||||||
|
@ -84,7 +88,7 @@ export class SecurityDefs extends React.PureComponent<SecurityDefsProps> {
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th> Security scheme type: </th>
|
<th> Security scheme type: </th>
|
||||||
<td> {AUTH_TYPES[scheme.type]} </td>
|
<td> {AUTH_TYPES[scheme.type] || scheme.type} </td>
|
||||||
</tr>
|
</tr>
|
||||||
{scheme.apiKey ? (
|
{scheme.apiKey ? (
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -93,14 +97,17 @@ export class SecurityDefs extends React.PureComponent<SecurityDefsProps> {
|
||||||
</tr>
|
</tr>
|
||||||
) : scheme.http ? (
|
) : scheme.http ? (
|
||||||
[
|
[
|
||||||
<tr>
|
<tr key="scheme">
|
||||||
<th> HTTP Authorization Scheme </th>
|
<th> HTTP Authorization Scheme </th>
|
||||||
<th> {scheme.http.scheme} </th>
|
<td> {scheme.http.scheme} </td>
|
||||||
</tr>,
|
|
||||||
<tr>
|
|
||||||
<th> Bearer format </th>
|
|
||||||
<th> "{scheme.http.bearerFormat}" </th>
|
|
||||||
</tr>,
|
</tr>,
|
||||||
|
scheme.http.scheme === 'bearer' &&
|
||||||
|
scheme.http.bearerFormat && (
|
||||||
|
<tr key="bearer">
|
||||||
|
<th> Bearer format </th>
|
||||||
|
<td> "{scheme.http.bearerFormat}" </td>
|
||||||
|
</tr>
|
||||||
|
),
|
||||||
]
|
]
|
||||||
) : scheme.openId ? (
|
) : scheme.openId ? (
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user