Skip to content

Commit 43fcd56

Browse files
committed
FSPT-342 - Disable JWT auth for Dev and Test envs as well as UAT
We are planning to shut down the UAT environment to save on costs. FAB in Production currently uses Form Runner in UAT for previewing forms. We are now switching Prod FAB to use Test Runner instead of UAT Runner, so that Prod FAB is unaffected when UAT is shut down. However, in order to do this we need to make sure that the /publish endpoint is unprotected by JWT auth in Test, as it has been in UAT, because otherwise we cannot preview from Prod FAB. This is because Prod FAB uses Prod Authenticator which authenticates only within the Prod env, not across envs. This is intended as a temporary measure to unblock UAT environment shutdown. Longer-term we plan to link Prod FAB to Prod Runner. This will allow this environment-conditional disabling of JWT auth to be rightfully abandoned, but requires some thought around ensuring that preview forms don't contaminate the production repository.
1 parent eff41bf commit 43fcd56

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

runner/src/server/plugins/engine/api/RegisterFormPublishApi.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ export class RegisterFormPublishApi implements RegisterApi {
244244
}
245245
}
246246

247-
// TODO: Stop being naughty! Conditionally disabling auth for UAT env is a temporary measure for getting FAB
248-
// into production
249-
if (config.jwtAuthEnabled && config.jwtAuthEnabled === "true" && config.copilotEnv !== "uat") {
247+
// TODO: Stop being naughty! Conditionally disabling auth for pre-prod envs is a temporary measure for getting
248+
// FAB into production
249+
if (config.jwtAuthEnabled && config.jwtAuthEnabled === "true" && config.copilotEnv === "prod") {
250250
getOptions.options.auth = jwtAuthStrategyName
251251
}
252252

@@ -311,7 +311,7 @@ export class RegisterFormPublishApi implements RegisterApi {
311311
handler: postHandler,
312312
}
313313
}
314-
if (config.jwtAuthEnabled && config.jwtAuthEnabled === "true" && config.copilotEnv !== "uat") {
314+
if (config.jwtAuthEnabled && config.jwtAuthEnabled === "true" && config.copilotEnv === "prod") {
315315
postConfig.options.auth = jwtAuthStrategyName
316316
}
317317
server.route(postConfig);

0 commit comments

Comments
 (0)