Skip to content

Commit

Permalink
fix indent
Browse files Browse the repository at this point in the history
  • Loading branch information
pragatimodi committed May 26, 2023
1 parent 7183e4e commit 15575b9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 47 deletions.
46 changes: 25 additions & 21 deletions firebase_admin/password_policy_config_mgt.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class CustomStrengthOptionsServerConfig:
def __init__(self, data):
if not isinstance(data, dict):
raise ValueError(
'Invalid data argument in CustomStrengthOptionsServerConfig constructor: {0}'.format(data))
'Invalid data argument in CustomStrengthOptionsServerConfig'
' constructor: {0}'.format(data))
self._data = data

@property
Expand Down Expand Up @@ -100,13 +101,13 @@ class CustomStrengthOptionsConfig:
"""Represents the strength attributes for the password policy"""

def __init__(
self,
min_length: int = 6,
max_length: int = 4096,
require_uppercase: bool = False,
require_lowercase: bool = False,
require_non_alphanumeric: bool = False,
require_numeric: bool = False,
self,
min_length: int = 6,
max_length: int = 4096,
require_uppercase: bool = False,
require_lowercase: bool = False,
require_non_alphanumeric: bool = False,
require_numeric: bool = False,
):
self.min_length: int = min_length
self.max_length: int = max_length
Expand Down Expand Up @@ -139,14 +140,16 @@ def validate(self):
Raises:
ValueError: In case of an unsuccessful validation.
"""
validate_keys(keys=vars(self).keys(),
valid_keys={
'require_numeric',
'require_uppercase',
'require_lowercase',
'require_non_alphanumeric',
'min_length',
'max_length'},
validate_keys(
keys=vars(self).keys(),
valid_keys={
'require_numeric',
'require_uppercase',
'require_lowercase',
'require_non_alphanumeric',
'min_length',
'max_length'
},
config_name='CustomStrengthOptionsConfig')
if not isinstance(self.require_lowercase, bool):
raise ValueError('constraints.require_lowercase must be a boolean')
Expand Down Expand Up @@ -182,10 +185,10 @@ class EnforcementState(Enum):
OFF = 'OFF'

def __init__(
self,
enforcement_state: EnforcementState = None,
force_upgrade_on_signin: bool = False,
constraints: CustomStrengthOptionsConfig = None,
self,
enforcement_state: EnforcementState = None,
force_upgrade_on_signin: bool = False,
constraints: CustomStrengthOptionsConfig = None,
):
self.enforcement_state: self.EnforcementState = enforcement_state
self.force_upgrade_on_signin: bool = force_upgrade_on_signin
Expand Down Expand Up @@ -219,7 +222,8 @@ def validate(self):
'password_policy_config.enforcement_state must be defined.')
if not isinstance(self.enforcement_state, PasswordPolicyConfig.EnforcementState):
raise ValueError(
'password_policy_config.enforcement_state must be of type PasswordPolicyConfig.EnforcementState')
'password_policy_config.enforcement_state must be of type'
' PasswordPolicyConfig.EnforcementState')
if not isinstance(self.force_upgrade_on_signin, bool):
raise ValueError(
'password_policy_config.force_upgrade_on_signin must be a valid boolean')
Expand Down
52 changes: 26 additions & 26 deletions firebase_admin/tenant_mgt.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ def get_tenant(tenant_id, app=None):


def create_tenant(
display_name,
allow_password_sign_up=None,
enable_email_link_sign_in=None,
multi_factor_config: multi_factor_config_mgt.MultiFactorConfig = None,
password_policy_config: password_policy_config_mgt.PasswordPolicyConfig = None,
app=None,
display_name,
allow_password_sign_up=None,
enable_email_link_sign_in=None,
multi_factor_config: multi_factor_config_mgt.MultiFactorConfig = None,
password_policy_config: password_policy_config_mgt.PasswordPolicyConfig = None,
app=None,
):
"""Creates a new tenant from the given options.
Expand Down Expand Up @@ -131,13 +131,13 @@ def create_tenant(


def update_tenant(
tenant_id,
display_name=None,
allow_password_sign_up=None,
enable_email_link_sign_in=None,
multi_factor_config: multi_factor_config_mgt.MultiFactorConfig = None,
password_policy_config: password_policy_config_mgt.PasswordPolicyConfig = None,
app=None,
tenant_id,
display_name=None,
allow_password_sign_up=None,
enable_email_link_sign_in=None,
multi_factor_config: multi_factor_config_mgt.MultiFactorConfig = None,
password_policy_config: password_policy_config_mgt.PasswordPolicyConfig = None,
app=None,
):
"""Updates an existing tenant with the given options.
Expand Down Expand Up @@ -312,12 +312,12 @@ def get_tenant(self, tenant_id):
return Tenant(body)

def create_tenant(
self,
display_name,
allow_password_sign_up=None,
enable_email_link_sign_in=None,
multi_factor_config: multi_factor_config_mgt.MultiFactorConfig = None,
password_policy_config: password_policy_config_mgt.PasswordPolicyConfig = None,
self,
display_name,
allow_password_sign_up=None,
enable_email_link_sign_in=None,
multi_factor_config: multi_factor_config_mgt.MultiFactorConfig = None,
password_policy_config: password_policy_config_mgt.PasswordPolicyConfig = None,
):
"""Creates a new tenant from the given parameters."""

Expand Down Expand Up @@ -347,13 +347,13 @@ def create_tenant(
return Tenant(body)

def update_tenant(
self,
tenant_id,
display_name=None,
allow_password_sign_up=None,
enable_email_link_sign_in=None,
multi_factor_config: multi_factor_config_mgt.MultiFactorConfig = None,
password_policy_config: password_policy_config_mgt.PasswordPolicyConfig = None,
self,
tenant_id,
display_name=None,
allow_password_sign_up=None,
enable_email_link_sign_in=None,
multi_factor_config: multi_factor_config_mgt.MultiFactorConfig = None,
password_policy_config: password_policy_config_mgt.PasswordPolicyConfig = None,
):
"""Updates the specified tenant with the given parameters."""
if not isinstance(tenant_id, str) or not tenant_id:
Expand Down

0 comments on commit 15575b9

Please sign in to comment.