fix(UPM-81611): Use URL-safe base64 for Fernet key generation#7104
Merged
josh-heyer merged 1 commit intodevelopfrom Mar 10, 2026
Merged
fix(UPM-81611): Use URL-safe base64 for Fernet key generation#7104josh-heyer merged 1 commit intodevelopfrom
josh-heyer merged 1 commit intodevelopfrom
Conversation
The Fernet specification (https://github.com/fernet/spec/) requires URL-safe base64 encoding (RFC 4648 Section 5), which uses `-` and `_` instead of `+` and `/`. The existing `dd | base64` command produces standard base64 which may contain `+` and `/` characters, making the generated key non-compliant with the Fernet spec. Add `| tr '+/' '-_'` to all Fernet key generation commands across all doc versions (1.2, 1.3, preview). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed?
Fixed Fernet key generation commands across all Hybrid Manager doc versions (1.2, 1.3, preview) to produce URL-safe base64 output per the Fernet specification.
Problem
The existing command:
FERNET_KEY=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | base64)produces standard base64 which may contain
+and/characters. The Fernet spec requires URL-safe base64 (RFC 4648 Section 5), which uses-and_instead. Python'scryptography.fernet.Fernet.generate_key()also produces URL-safe base64.Keys generated with the old command are non-compliant with the Fernet spec and will be rejected by
edbctl setupvalidation approximately 50% of the time (whenever+or/appear in the output).Fix
Added
| tr '+/' '-_'to convert standard base64 to URL-safe base64:FERNET_KEY=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | base64 | tr '+/' '-_')This same pattern was already used in the migration portal secrets docs for password generation.
Files changed (10)
1.2:
ai-factory/enabling.mdxinstall/customization/genai_secret.mdxinstall/eks/installing/assets-helm/eks-install-secrets.shinstall/eks/installing/assets-op/eks-install-secrets.shinstall/gcp/prerequisites/gcpcluster.mdx1.3:
ai-factory/how-to-enable-ai-factory.mdxinstall/configuration/genai_secret.mdxpreview:
ai-factory/how-to-enable-ai-factory.mdxinstall/configuration/genai_secret.mdxusing_hybrid_manager/upgrading_hm/2025.11_to_2025.12.mdx🤖 Generated with Claude Code