Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Base64 Encoding in Fideslib #43

Closed
pattisdr opened this issue Jul 6, 2022 · 0 comments · Fixed by #44
Closed

Base64 Encoding in Fideslib #43

pattisdr opened this issue Jul 6, 2022 · 0 comments · Fixed by #44
Labels
bug Something isn't working

Comments

@pattisdr
Copy link
Contributor

pattisdr commented Jul 6, 2022

Bug Description

To fix a recent regression in fidesops, we need the Base64 encoding pieces ethyca/fidesops#700 recently removed from Fidesops ethyca/fidesops#749 to be added to Fideslib.

For example:

class UserCreate(UserUpdate):
    """Data required to create a FidesUser"""

    username: str
    password: str

    --- 
    @validator("password")
    def validate_password(cls, password: str) -> str:
        """Add some password requirements"""
        decoded_password = b64_str_to_str(password) <---***
        if len(decoded_password) < 8:
            raise ValueError("Password must have at least eight characters.")
        if re.search("[0-9]", decoded_password) is None:
            raise ValueError("Password must have at least one number.")
        if re.search("[A-Z]", decoded_password) is None:
            raise ValueError("Password must have at least one capital letter.")
        if re.search("[a-z]", decoded_password) is None:
            raise ValueError("Password must have at least one lowercase letter.")
        if re.search(r"[\W]", decoded_password) is None:
            raise ValueError("Password must have at least one symbol.")

        return decoded_password

Steps to Reproduce

  1. Do this...
  2. Then This...

Expected behavior

A description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • Version:
  • OS:
  • Python Version:
  • Docker Version:

Additional context

Add any other context about the problem here.

@pattisdr pattisdr added the bug Something isn't working label Jul 6, 2022
@pattisdr pattisdr changed the title Update UserCreate password validation: Base64 Encoding Base64 Encoding in Fideslib Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant