From 67d3111568effa54608f6572cb8610f09aa33d2b Mon Sep 17 00:00:00 2001 From: Michael Zangl Date: Mon, 19 Apr 2021 15:05:04 +0200 Subject: [PATCH] Include description of oauth endpoints when parsing openapi --- src/core/plugins/oas3/auth-extensions/wrap-selectors.js | 3 ++- test/unit/core/plugins/oas3/wrap-auth-selectors.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/plugins/oas3/auth-extensions/wrap-selectors.js b/src/core/plugins/oas3/auth-extensions/wrap-selectors.js index 847db87139e..f7b2ea75015 100644 --- a/src/core/plugins/oas3/auth-extensions/wrap-selectors.js +++ b/src/core/plugins/oas3/auth-extensions/wrap-selectors.js @@ -43,7 +43,8 @@ export const definitionsToAuthorize = onlyOAS3(createSelector( authorizationUrl: flowVal.get("authorizationUrl"), tokenUrl: flowVal.get("tokenUrl"), scopes: flowVal.get("scopes"), - type: definition.get("type") + type: definition.get("type"), + description: definition.get("description") }) list = list.push(new Map({ diff --git a/test/unit/core/plugins/oas3/wrap-auth-selectors.js b/test/unit/core/plugins/oas3/wrap-auth-selectors.js index a2203b94330..59fd8a900dc 100644 --- a/test/unit/core/plugins/oas3/wrap-auth-selectors.js +++ b/test/unit/core/plugins/oas3/wrap-auth-selectors.js @@ -21,6 +21,7 @@ describe("oas3 plugin - auth extensions - wrapSelectors", function(){ return fromJS({ "oauth2AuthorizationCode": { "type": "oauth2", + "description": "Some Oauth2 endpoint", "flows": { "authorizationCode": { "authorizationUrl": "http://google.com/", @@ -105,7 +106,8 @@ describe("oas3 plugin - auth extensions - wrapSelectors", function(){ scopes: { "myScope": "our only scope" }, - type: "oauth2" + type: "oauth2", + description: "Some Oauth2 endpoint" } }, { @@ -201,7 +203,7 @@ describe("oas3 plugin - auth extensions - wrapSelectors", function(){ // OPTIONAL. JSON array containing a list of the OAuth 2.0 Grant Type values that // this OP supports. Dynamic OpenID Providers MUST support the authorization_code // and implicit Grant Type values and MAY support other Grant Types. If omitted, - // the default value is ["authorization_code", "implicit"]. + // the default value is ["authorization_code", "implicit"]. oidcNoGrant: { flow: "authorization_code", authorizationUrl: "https://accounts.google.com/o/oauth2/v2/auth",