Skip to content
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

Fix extra requirements for MFA #295

Closed
dantownsend opened this issue Sep 9, 2024 · 0 comments · Fixed by #296
Closed

Fix extra requirements for MFA #295

dantownsend opened this issue Sep 9, 2024 · 0 comments · Fixed by #296
Labels
bug Something isn't working

Comments

@dantownsend
Copy link
Member

dantownsend commented Sep 9, 2024

@dantownsend Just one thing. I just tried the Piccolo Admin MFA branch with newest Piccolo API version and removing those imports breaks the MFA flow. The error log is

File "/home/rkl/dev/admin_env/lib/python3.11/site-packages/piccolo_api/mfa/endpoints.py", line 126, in post
    html_content = await self._provider.get_registration_html(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rkl/dev/admin_env/lib/python3.11/site-packages/piccolo_api/mfa/authenticator/provider.py", line 121, in get_registration_html
  secret, recovery_codes = await self.secret_table.create_new(
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rkl/dev/admin_env/lib/python3.11/site-packages/piccolo_api/mfa/authenticator/tables.py", line 116, in create_new
  encrypted_secret = encryption_provider.encrypt(value=secret)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rkl/dev/admin_env/lib/python3.11/site-packages/piccolo_api/encryption/providers.py", line 122, in encrypt
  fernet = cryptography.fernet.Fernet(  # type: ignore
            ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'cryptography' has no attribute 'fernet'

If I patch the local Piccolo API installation with those imports, everything works.

Originally posted by @sinisaos in #292 (comment)

@dantownsend dantownsend added this to Bugs Sep 9, 2024
@github-project-automation github-project-automation bot moved this to Needs triage in Bugs Sep 9, 2024
@dantownsend dantownsend added the bug Something isn't working label Sep 9, 2024
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bugs Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

1 participant