Merge pull request #281 from sartography/feature/support_different_subdomains

Feature/support different subdomains
This commit is contained in:
jasquat 2023-05-26 11:17:50 -04:00 committed by GitHub
commit abe81821ff
4 changed files with 12 additions and 7 deletions

View File

@ -52,8 +52,8 @@ docker run \
script_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" script_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
cp "${script_dir}/../realm_exports/${realm_name}-realm.json" /tmp/${realm_name}-realm.json cp "${script_dir}/../realm_exports/${realm_name}-realm.json" /tmp/${realm_name}-realm.json
spiff_subdomain="unused-for-local-dev" spiff_subdomain="for-local-dev.spiffworkflow.org"
perl -pi -e "s/{{SPIFF_SUBDOMAIN}}/${spiff_subdomain}/g" /tmp/${realm_name}-realm.json perl -pi -e "s/replace-me-with-spiff-domain-and-api-path-prefix/${spiff_subdomain}/g" /tmp/${realm_name}-realm.json
docker cp /tmp/${realm_name}-realm.json keycloak:/tmp docker cp /tmp/${realm_name}-realm.json keycloak:/tmp
sleep 20 sleep 20

View File

@ -3250,7 +3250,7 @@
"alwaysDisplayInConsole" : false, "alwaysDisplayInConsole" : false,
"clientAuthenticatorType" : "client-secret", "clientAuthenticatorType" : "client-secret",
"secret" : "JXeQExm0JhQPLumgHtIIqf52bDalHz0q", "secret" : "JXeQExm0JhQPLumgHtIIqf52bDalHz0q",
"redirectUris" : [ "http://localhost:7000/*", "https://api.unused-for-local-dev.spiffworkflow.org/*", "https://api.replace-me-with-spiff-subdomain.spiffworkflow.org/*", "http://67.205.133.116:7000/*", "http://167.172.242.138:7000/*" ], "redirectUris" : [ "http://localhost:7000/*", "https://replace-me-with-spiff-domain-and-api-path-prefix/*", "http://67.205.133.116:7000/*", "http://167.172.242.138:7000/*" ],
"webOrigins" : [ ], "webOrigins" : [ ],
"notBefore" : 0, "notBefore" : 0,
"bearerOnly" : false, "bearerOnly" : false,
@ -3267,7 +3267,7 @@
"saml.force.post.binding" : "false", "saml.force.post.binding" : "false",
"saml.multivalued.roles" : "false", "saml.multivalued.roles" : "false",
"frontchannel.logout.session.required" : "false", "frontchannel.logout.session.required" : "false",
"post.logout.redirect.uris" : "https://replace-me-with-spiff-subdomain.spiffworkflow.org/*##http://localhost:7001/*", "post.logout.redirect.uris" : "https://replace-me-with-spiff-domain/*##http://localhost:7001/*",
"oauth2.device.authorization.grant.enabled" : "false", "oauth2.device.authorization.grant.enabled" : "false",
"backchannel.logout.revoke.offline.tokens" : "false", "backchannel.logout.revoke.offline.tokens" : "false",
"saml.server.signature.keyinfo.ext" : "false", "saml.server.signature.keyinfo.ext" : "false",

View File

@ -29,7 +29,7 @@ import { useUriListForPermissions } from '../hooks/UriListForPermissions';
import { PermissionsToCheck } from '../interfaces'; import { PermissionsToCheck } from '../interfaces';
import { usePermissionFetcher } from '../hooks/PermissionService'; import { usePermissionFetcher } from '../hooks/PermissionService';
import { UnauthenticatedError } from '../services/HttpService'; import { UnauthenticatedError } from '../services/HttpService';
import { SPIFF_ENVIRONMENT } from '../config'; import { DOCUMENTATION_URL, SPIFF_ENVIRONMENT } from '../config';
import appVersionInfo from '../helpers/appVersionInfo'; import appVersionInfo from '../helpers/appVersionInfo';
// for ref: https://react-bootstrap.github.io/components/navbar/ // for ref: https://react-bootstrap.github.io/components/navbar/
@ -61,8 +61,8 @@ export default function NavigationBar() {
// default to readthedocs and let someone specify an environment variable to override: // default to readthedocs and let someone specify an environment variable to override:
// //
let documentationUrl = 'https://spiffworkflow.readthedocs.io'; let documentationUrl = 'https://spiffworkflow.readthedocs.io';
if ('DOCUMENTATION_URL' in window.spiffworkflowFrontendJsenv) { if (DOCUMENTATION_URL) {
documentationUrl = window.spiffworkflowFrontendJsenv.DOCUMENTATION_URL; documentationUrl = DOCUMENTATION_URL;
} }
const versionInfo = appVersionInfo(); const versionInfo = appVersionInfo();

View File

@ -13,6 +13,7 @@ declare global {
let spiffEnvironment = ''; let spiffEnvironment = '';
let appRoutingStrategy = 'subdomain_based'; let appRoutingStrategy = 'subdomain_based';
let backendBaseUrl = null; let backendBaseUrl = null;
let documentationUrl = null;
if ('spiffworkflowFrontendJsenv' in window) { if ('spiffworkflowFrontendJsenv' in window) {
if ('APP_ROUTING_STRATEGY' in window.spiffworkflowFrontendJsenv) { if ('APP_ROUTING_STRATEGY' in window.spiffworkflowFrontendJsenv) {
appRoutingStrategy = window.spiffworkflowFrontendJsenv.APP_ROUTING_STRATEGY; appRoutingStrategy = window.spiffworkflowFrontendJsenv.APP_ROUTING_STRATEGY;
@ -23,6 +24,9 @@ if ('spiffworkflowFrontendJsenv' in window) {
if ('BACKEND_BASE_URL' in window.spiffworkflowFrontendJsenv) { if ('BACKEND_BASE_URL' in window.spiffworkflowFrontendJsenv) {
backendBaseUrl = window.spiffworkflowFrontendJsenv.BACKEND_BASE_URL; backendBaseUrl = window.spiffworkflowFrontendJsenv.BACKEND_BASE_URL;
} }
if ('DOCUMENTATION_URL' in window.spiffworkflowFrontendJsenv) {
documentationUrl = window.spiffworkflowFrontendJsenv.DOCUMENTATION_URL;
}
} }
if (!backendBaseUrl) { if (!backendBaseUrl) {
@ -66,6 +70,7 @@ if (!backendBaseUrl.endsWith('/v1.0')) {
} }
export const BACKEND_BASE_URL = backendBaseUrl; export const BACKEND_BASE_URL = backendBaseUrl;
export const DOCUMENTATION_URL = documentationUrl;
export const PROCESS_STATUSES = [ export const PROCESS_STATUSES = [
'not_started', 'not_started',