From ece858b60957a8372aa89eab2abe12e46f541bb1 Mon Sep 17 00:00:00 2001 From: Jack Palmer Date: Fri, 3 May 2024 14:20:46 +0100 Subject: [PATCH 1/7] fix: Add config.d.ts for auth-backend-module-github-provider Signed-off-by: Jack Palmer --- .../config.d.ts | 34 +++++++++++++++++++ .../package.json | 30 ++++++++-------- 2 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 plugins/auth-backend-module-github-provider/config.d.ts diff --git a/plugins/auth-backend-module-github-provider/config.d.ts b/plugins/auth-backend-module-github-provider/config.d.ts new file mode 100644 index 0000000000..c8af7eb5db --- /dev/null +++ b/plugins/auth-backend-module-github-provider/config.d.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Config { + auth?: { + providers?: { + /** @visibility frontend */ + github?: { + [authEnv: string]: { + clientId: string; + /** + * @visibility secret + */ + clientSecret: string; + callbackUrl?: string; + enterpriseInstanceUrl?: string; + }; + }; + }; + }; +} diff --git a/plugins/auth-backend-module-github-provider/package.json b/plugins/auth-backend-module-github-provider/package.json index 65217f0eeb..0e8db4d1a5 100644 --- a/plugins/auth-backend-module-github-provider/package.json +++ b/plugins/auth-backend-module-github-provider/package.json @@ -1,10 +1,10 @@ { "name": "@backstage/plugin-auth-backend-module-github-provider", - "description": "The github-provider backend module for the auth plugin.", "version": "0.1.15-next.1", - "main": "src/index.ts", - "types": "src/index.ts", - "license": "Apache-2.0", + "description": "The github-provider backend module for the auth plugin.", + "backstage": { + "role": "backend-plugin-module" + }, "publishConfig": { "access": "public", "main": "dist/index.cjs.js", @@ -15,17 +15,21 @@ "url": "https://github.com/backstage/backstage", "directory": "plugins/auth-backend-module-github-provider" }, - "backstage": { - "role": "backend-plugin-module" - }, + "license": "Apache-2.0", + "main": "src/index.ts", + "types": "src/index.ts", + "files": [ + "dist", + "config.d.ts" + ], "scripts": { - "start": "backstage-cli package start", "build": "backstage-cli package build", - "lint": "backstage-cli package lint", - "test": "backstage-cli package test", "clean": "backstage-cli package clean", + "lint": "backstage-cli package lint", "prepack": "backstage-cli package prepack", - "postpack": "backstage-cli package postpack" + "postpack": "backstage-cli package postpack", + "start": "backstage-cli package start", + "test": "backstage-cli package test" }, "dependencies": { "@backstage/backend-plugin-api": "workspace:^", @@ -39,7 +43,5 @@ "@backstage/plugin-auth-backend": "workspace:^", "supertest": "^6.3.3" }, - "files": [ - "dist" - ] + "configSchema": "config.d.ts" } From e4fb486a3edc86617eaccd95f601323e0b983d0a Mon Sep 17 00:00:00 2001 From: Jack Palmer Date: Fri, 3 May 2024 14:23:11 +0100 Subject: [PATCH 2/7] chore: add changeset Signed-off-by: Jack Palmer --- .changeset/blue-balloons-draw.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/blue-balloons-draw.md diff --git a/.changeset/blue-balloons-draw.md b/.changeset/blue-balloons-draw.md new file mode 100644 index 0000000000..8208af5105 --- /dev/null +++ b/.changeset/blue-balloons-draw.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend-module-github-provider': patch +--- + +fix: Add missing config.d.ts for auth-backend-module-github-provider From 8f6a945b0ee0b33bc32dbce0bccd5e53c68ef0d6 Mon Sep 17 00:00:00 2001 From: Jack Palmer Date: Fri, 3 May 2024 14:24:23 +0100 Subject: [PATCH 3/7] fix: Typo in copyright Signed-off-by: Jack Palmer --- plugins/auth-backend-module-github-provider/config.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/auth-backend-module-github-provider/config.d.ts b/plugins/auth-backend-module-github-provider/config.d.ts index c8af7eb5db..e79711310d 100644 --- a/plugins/auth-backend-module-github-provider/config.d.ts +++ b/plugins/auth-backend-module-github-provider/config.d.ts @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Backstage Authors + * Copyright 2024 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From c52052bdceda72743e2d0305d1f6aff3c2d6728c Mon Sep 17 00:00:00 2001 From: Jack Palmer Date: Fri, 3 May 2024 15:49:28 +0100 Subject: [PATCH 4/7] fox: Add config.d.ts for aws-alb and rename iss to issuer Signed-off-by: Jack Palmer --- .../config.d.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 plugins/auth-backend-module-aws-alb-provider/config.d.ts diff --git a/plugins/auth-backend-module-aws-alb-provider/config.d.ts b/plugins/auth-backend-module-aws-alb-provider/config.d.ts new file mode 100644 index 0000000000..1978e5a4df --- /dev/null +++ b/plugins/auth-backend-module-aws-alb-provider/config.d.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Config { + auth?: { + providers?: { + /** @visibility frontend */ + awsalb?: { + issuer?: string; + region: string; + }; + }; + }; +} From 9f974a05da653abd5a24ea43f7f496e43291066b Mon Sep 17 00:00:00 2001 From: Jack Palmer Date: Fri, 3 May 2024 15:49:53 +0100 Subject: [PATCH 5/7] fix: Tidy auth-backend config.d.ts Signed-off-by: Jack Palmer --- plugins/auth-backend/config.d.ts | 42 -------------------------------- 1 file changed, 42 deletions(-) diff --git a/plugins/auth-backend/config.d.ts b/plugins/auth-backend/config.d.ts index f0ceaa4224..a7ea18ed1d 100644 --- a/plugins/auth-backend/config.d.ts +++ b/plugins/auth-backend/config.d.ts @@ -89,29 +89,6 @@ export interface Config { * @additionalProperties true */ providers?: { - /** @visibility frontend */ - google?: { - [authEnv: string]: { - clientId: string; - /** - * @visibility secret - */ - clientSecret: string; - callbackUrl?: string; - }; - }; - /** @visibility frontend */ - github?: { - [authEnv: string]: { - clientId: string; - /** - * @visibility secret - */ - clientSecret: string; - callbackUrl?: string; - enterpriseInstanceUrl?: string; - }; - }; /** @visibility frontend */ saml?: { entryPoint: string; @@ -137,20 +114,6 @@ export interface Config { acceptedClockSkewMs?: number; }; /** @visibility frontend */ - oauth2?: { - [authEnv: string]: { - clientId: string; - /** - * @visibility secret - */ - clientSecret: string; - authorizationUrl: string; - tokenUrl: string; - scope?: string; - disableRefresh?: boolean; - }; - }; - /** @visibility frontend */ auth0?: { [authEnv: string]: { clientId: string; @@ -177,11 +140,6 @@ export interface Config { callbackUrl?: string; }; }; - /** @visibility frontend */ - awsalb?: { - iss?: string; - region: string; - }; /** * The backstage token expiration. */ From ed4cd84b10ae123882b0cf549ea9f541ae7d843d Mon Sep 17 00:00:00 2001 From: Jack Palmer Date: Fri, 3 May 2024 15:51:05 +0100 Subject: [PATCH 6/7] chore: Update changelog Signed-off-by: Jack Palmer --- .changeset/blue-balloons-draw.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.changeset/blue-balloons-draw.md b/.changeset/blue-balloons-draw.md index 8208af5105..d17760a92b 100644 --- a/.changeset/blue-balloons-draw.md +++ b/.changeset/blue-balloons-draw.md @@ -3,3 +3,5 @@ --- fix: Add missing config.d.ts for auth-backend-module-github-provider +fix: Add missing config.d.ts for auth-backend-module-aws-alb-provider +fix: Remove duplicate provider config from auth-backend From 4a0577e0ea14c7b490e7ef0d0a459a8b375e292b Mon Sep 17 00:00:00 2001 From: Jack Palmer Date: Fri, 3 May 2024 15:54:41 +0100 Subject: [PATCH 7/7] chore: Fix changelog Signed-off-by: Jack Palmer --- .changeset/blue-balloons-draw.md | 7 ------- .changeset/little-rockets-live.md | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 .changeset/blue-balloons-draw.md create mode 100644 .changeset/little-rockets-live.md diff --git a/.changeset/blue-balloons-draw.md b/.changeset/blue-balloons-draw.md deleted file mode 100644 index d17760a92b..0000000000 --- a/.changeset/blue-balloons-draw.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-github-provider': patch ---- - -fix: Add missing config.d.ts for auth-backend-module-github-provider -fix: Add missing config.d.ts for auth-backend-module-aws-alb-provider -fix: Remove duplicate provider config from auth-backend diff --git a/.changeset/little-rockets-live.md b/.changeset/little-rockets-live.md new file mode 100644 index 0000000000..767fda917e --- /dev/null +++ b/.changeset/little-rockets-live.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-auth-backend-module-aws-alb-provider': patch +'@backstage/plugin-auth-backend-module-github-provider': patch +'@backstage/plugin-auth-backend': patch +--- + +fix: Move config declarations to appropriate auth backend modules