Skip to content

fix: treat unset PASSBOLT_PLUGINS_JWT_AUTHENTICATION_ENABLED as true#249

Closed
0nelight wants to merge 1 commit intopassbolt:masterfrom
0nelight:patch-1
Closed

fix: treat unset PASSBOLT_PLUGINS_JWT_AUTHENTICATION_ENABLED as true#249
0nelight wants to merge 1 commit intopassbolt:masterfrom
0nelight:patch-1

Conversation

@0nelight
Copy link
Copy Markdown

@0nelight 0nelight commented Feb 24, 2026

What this PR does

Ensures the default value of PASSBOLT_PLUGINS_JWT_AUTHENTICATION_ENABLED (True) is set so that the JWT key pair is generated at container initialization. This ensures the Docker setup mirrors the default JWT authentication setup behavior found in bare-metal installations. fixes #243

Before
Keys were only generated if the env var was explicitly set to "true".

After

  • Unset → treated as true (keys generated if missing)
  • Explicit "true" → same as before
  • "false" / empty / other → no generation

Why needed
The default value true for JWT Authentication (set in defaults.php) does not apply to the bash entrypoint/healthcheck scripts in Docker images. We must explicitly mirror this default in the bash logic to match bare-metal behavior in containerized deployments.

Changes

  • Added unset check (-z "${VAR+xxx}") to the condition
  • Added proper quoting for all variables (safer against special chars)
  • No change when the var is explicitly set

Enables JWT key creation by default when the environment variable is not set. This aligns with the documented default and matches behavior seen in bare-metal / non-Docker installations.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 24, 2026

CLA assistant check
All committers have signed the CLA.

@LouisVallat
Copy link
Copy Markdown
Contributor

Hey 👋,
Thank you for the PR and the good description,
Although it was a correct suggestion, we wanted to refactor a bit of the surrounding code 🖖

Thank you again,
Louis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JWT secrets are not created

3 participants