From 4cf3494eb8f6fabdc38c91605ec6ad20a692ffd8 Mon Sep 17 00:00:00 2001 From: Csaky Date: Fri, 7 Oct 2022 17:17:32 -0700 Subject: [PATCH 1/2] test API Gateway --- app/config/default.json | 1 + app/src/components/keycloak.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/config/default.json b/app/config/default.json index ada1c44..3781283 100644 --- a/app/config/default.json +++ b/app/config/default.json @@ -17,4 +17,5 @@ "uploadCount": "1", "uploadSize": "25MB" } + } diff --git a/app/src/components/keycloak.js b/app/src/components/keycloak.js index c5aac02..76e038a 100644 --- a/app/src/components/keycloak.js +++ b/app/src/components/keycloak.js @@ -11,6 +11,6 @@ module.exports = new Keycloak({}, { secret: config.has('keycloak.clientSecret') ? config.get('keycloak.clientSecret') : undefined, serverUrl: config.get('keycloak.serverUrl'), 'ssl-required': 'external', - 'use-resource-role-mappings': true, + 'use-resource-role-mappings': false, 'verify-token-audience': true }); From 2e3477d88de125464163dd2ed7d3ea983daf92ba Mon Sep 17 00:00:00 2001 From: Csaky Date: Fri, 21 Oct 2022 16:58:17 -0700 Subject: [PATCH 2/2] Disable checking for resource roles in client JWT's --- app/config/default.json | 1 - app/src/docs/v1.api-spec.yaml | 3 --- app/src/docs/v2.api-spec.yaml | 3 ++- app/src/routes/v1/index.js | 4 +--- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/config/default.json b/app/config/default.json index 3781283..ada1c44 100644 --- a/app/config/default.json +++ b/app/config/default.json @@ -17,5 +17,4 @@ "uploadCount": "1", "uploadSize": "25MB" } - } diff --git a/app/src/docs/v1.api-spec.yaml b/app/src/docs/v1.api-spec.yaml index 2e99dde..a175ca5 100644 --- a/app/src/docs/v1.api-spec.yaml +++ b/app/src/docs/v1.api-spec.yaml @@ -87,9 +87,6 @@ paths: operationId: postDocGen tags: - DocGen - security: - - OpenID: - - GENERATOR requestBody: description: Fields required to generate a document required: true diff --git a/app/src/docs/v2.api-spec.yaml b/app/src/docs/v2.api-spec.yaml index e0b0e79..5313ac9 100644 --- a/app/src/docs/v2.api-spec.yaml +++ b/app/src/docs/v2.api-spec.yaml @@ -141,7 +141,8 @@ paths: type: object properties: template: - type: binary + type: string + format: binary responses: "200": description: Returns the supplied document with variables merged in diff --git a/app/src/routes/v1/index.js b/app/src/routes/v1/index.js index 363f890..2f06075 100644 --- a/app/src/routes/v1/index.js +++ b/app/src/routes/v1/index.js @@ -1,4 +1,3 @@ -const config = require('config'); const router = require('express').Router(); const docGenRouter = require('./docGen'); @@ -8,7 +7,6 @@ const healthRouter = require('./health'); const { protect } = require('../../middleware/authorization'); const { getDocs, getJsonSpec, getYamlSpec } = require('../../middleware/openapi'); -const clientId = config.has('keycloak.enabled') ? config.get('keycloak.clientId') : ''; const version = 'v1'; /** Base Responder */ @@ -35,7 +33,7 @@ router.get('/api-spec.yaml', getYamlSpec(version)); router.get('/docs', getDocs(version)); /** Doc Gen Router */ -router.use('/docGen', protect(`${clientId}:GENERATOR`), docGenRouter); +router.use('/docGen', protect(), docGenRouter); /** File Types Router */ router.use('/fileTypes', protect(), fileTypesRouter);