Skip to content

Commit

Permalink
fix: render specs that contain oauth2 password flow only (#1023)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukasz Gornicki <[email protected]>
  • Loading branch information
pltod2 and derberg authored Jul 17, 2024
1 parent 6936c78 commit f087fd0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions library/src/__tests__/docs/v3/streetlights-mqtt.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
},
{
"$ref": "#/components/securitySchemes/openIdConnectWellKnown"
},
{
"$ref": "#/components/securitySchemes/oauth2Password"
}
],
"tags": [
Expand Down Expand Up @@ -348,6 +351,18 @@
"openIdConnectWellKnown": {
"type": "openIdConnect",
"openIdConnectUrl": "https://authserver.example/.well-known"
},
"oauth2Password": {
"type": "oauth2",
"description": "Flows to support OAuth 2.0",
"flows": {
"password": {
"tokenUrl": "https://authserver.example/token",
"availableScopes": {
"streetlights:on": "Ability to switch lights on"
}
}
}
}
},
"parameters": {
Expand Down
2 changes: 1 addition & 1 deletion library/src/containers/Servers/Security.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const SecurityItem: React.FunctionComponent<SecurityItemProps> = ({
unwrappedFlows.clientCredentials = flows.clientCredentials()!;
}
if (flows?.hasPassword()) {
unwrappedFlows.password = flows.implicit()!;
unwrappedFlows.password = flows.password()!;
}
const renderedFlows = Object.entries(unwrappedFlows).map(
([flowName, flow]) => {
Expand Down

0 comments on commit f087fd0

Please sign in to comment.