ensure that the guest auth config schema is present

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-03-01 10:21:28 +01:00
parent 6f5388b4f6
commit 72dd380d14
3 changed files with 36 additions and 25 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend-module-guest-provider': patch
---
Ensure that the config schema is present
+15 -11
View File
@@ -25,17 +25,19 @@ This will only work with the new backend system. There is no support for this in
Add the `@backstage/plugin-auth-backend-module-guest-provider` to your backend installation.
```
```sh
# From your Backstage root directory
yarn --cwd packages/backend add @backstage/plugin-auth-backend-module-guest-provider
```
Then, add it to your backend's `index.ts` file,
Then, add it to your backend's source,
```diff
```ts title="packages/backend/src/index.ts"
const backend = createBackend();
backend.add('@backstage/plugin-auth-backend');
+backend.add('@backstage/plugin-auth-backend-module-guest-provider');
backend.add(import('@backstage/plugin-auth-backend'));
// highlight-add-next-line
backend.add(import('@backstage/plugin-auth-backend-module-guest-provider'));
await backend.start();
```
@@ -44,10 +46,11 @@ await backend.start();
Add the following to your `SignInPage` providers,
```diff
```ts
const providers = [
+ 'guest',
...
// highlight-add-next-line
'guest',
...
]
```
@@ -55,8 +58,9 @@ const providers = [
Similar to the other authentication providers, you have to enable the provider in config. Add the following to your `app-config.local.yaml`,
```diff
```yaml title="app-config.local.yaml"
auth:
providers:
+ guest: {}
providers:
# highlight-add-next-line
guest: {}
```
@@ -1,10 +1,10 @@
{
"name": "@backstage/plugin-auth-backend-module-guest-provider",
"description": "The guest-provider backend module for the auth plugin.",
"version": "0.1.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"description": "The guest-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-guest-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-common": "workspace:^",
@@ -41,7 +45,5 @@
"@backstage/config": "workspace:^",
"express": "^4.18.2"
},
"files": [
"dist"
]
"configSchema": "config.d.ts"
}