-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Fix for fernetkey and add test of its value #52977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Signed-off-by: Grégoire Bellon-Gervais <[email protected]>
11 tasks
Signed-off-by: Grégoire Bellon-Gervais <[email protected]>
When test fail, you have a nice: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cryptography.fernet.Fernet object at 0x7fe8226949a0>, key = b'\xd0\xec\x8a\xb5\xe6\xb4\x17\x1cG\'mU\xbea^\x9c\xdd\xd0\x11=w\xbe\xbc"', backend = None
def __init__(
self,
key: bytes | str,
backend: typing.Any = None,
) -> None:
try:
key = base64.urlsafe_b64decode(key)
except binascii.Error as exc:
raise ValueError(
"Fernet key must be 32 url-safe base64-encoded bytes."
) from exc
if len(key) != 32:
> raise ValueError(
"Fernet key must be 32 url-safe base64-encoded bytes."
)
E ValueError: Fernet key must be 32 url-safe base64-encoded bytes.
.venv/lib/python3.10/site-packages/cryptography/fernet.py:40: ValueError |
Signed-off-by: Grégoire Bellon-Gervais <[email protected]>
Signed-off-by: Grégoire Bellon-Gervais <[email protected]>
Signed-off-by: Grégoire Bellon-Gervais <[email protected]>
jedcunningham
approved these changes
Jul 8, 2025
HsiuChuanHsu
pushed a commit
to HsiuChuanHsu/airflow
that referenced
this pull request
Jul 10, 2025
Signed-off-by: Grégoire Bellon-Gervais <[email protected]>
stephen-bracken
pushed a commit
to stephen-bracken/airflow
that referenced
this pull request
Jul 15, 2025
Signed-off-by: Grégoire Bellon-Gervais <[email protected]>
2 tasks
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.
This will fix an issue that I have introduced myself with this commit.
See this comment and error description here.
Also add simple test to check generated value is in correct Fernet key format.