Updated comments and code to reflect feedbacks

This commit is contained in:
keshan
2020-12-03 09:07:04 +05:30
parent ff243ce96a
commit 6a5e3e204f
3 changed files with 27 additions and 12 deletions
+10 -1
View File
@@ -2,4 +2,13 @@
'@backstage/core': minor
---
Introducing env prop to have configurable authentication env
Introducing a new optional property within `app-config.yaml` called `auth.environment` to have configurable environment value for `auth.providers`
**Default Value:** 'development'
**Optional Values:** 'production' | 'development'
**Migration-steps:**
- To override the default value, one could simply introduce the new property `environment` within the `auth` section of the `config.yaml`
- re-run the build to reflect the changed configs
+7 -1
View File
@@ -62,9 +62,15 @@ export interface Config {
timezone: string;
}[];
};
/**
* Configuration that provides information on available authentication providers configured for app
*/
auth?: {
/**
* The environment config added to be able to change the authentication environment.
* The 'environment' attribute added as an optional parameter to have configurable environment value for `auth.providers`.
* default value: 'development'
* optional values: 'development' | 'production'
* @visibility frontend
*/
environment?: string;
+10 -10
View File
@@ -84,7 +84,7 @@ export const defaultApis = [
GoogleAuth.create({
discoveryApi,
oauthRequestApi,
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
createApiFactory({
@@ -98,7 +98,7 @@ export const defaultApis = [
MicrosoftAuth.create({
discoveryApi,
oauthRequestApi,
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
createApiFactory({
@@ -113,7 +113,7 @@ export const defaultApis = [
discoveryApi,
oauthRequestApi,
defaultScopes: ['read:user'],
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
createApiFactory({
@@ -127,7 +127,7 @@ export const defaultApis = [
OktaAuth.create({
discoveryApi,
oauthRequestApi,
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
createApiFactory({
@@ -141,7 +141,7 @@ export const defaultApis = [
GitlabAuth.create({
discoveryApi,
oauthRequestApi,
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
createApiFactory({
@@ -155,7 +155,7 @@ export const defaultApis = [
Auth0Auth.create({
discoveryApi,
oauthRequestApi,
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
createApiFactory({
@@ -169,7 +169,7 @@ export const defaultApis = [
OAuth2.create({
discoveryApi,
oauthRequestApi,
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
createApiFactory({
@@ -181,7 +181,7 @@ export const defaultApis = [
factory: ({ discoveryApi, configApi }) =>
SamlAuth.create({
discoveryApi,
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
createApiFactory({
@@ -195,7 +195,7 @@ export const defaultApis = [
OneLoginAuth.create({
discoveryApi,
oauthRequestApi,
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
createApiFactory({
@@ -214,7 +214,7 @@ export const defaultApis = [
title: 'Your Identity Provider',
icon: OAuth2Icon,
},
environment: configApi.getString('auth.environment'),
environment: configApi.getOptionalString('auth.environment'),
}),
}),
];