-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathD_ISP_Suggestion.py
144 lines (111 loc) · 3.71 KB
/
D_ISP_Suggestion.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Collection
# Old ASP.Net site members DAO abstraction
class MembershipProvider(ABC):
#region IApplicationNameHolder
@abstractmethod
def get_app_name(self) -> str:
...
@abstractmethod
def set_app_name(self, app_name: str) -> None:
...
#endregion
#region IPasswordValidator
@abstractmethod
def validate_user(self, user_name: str, password: str) -> bool:
...
#endregion
#region IPasswordChanger
@abstractmethod
def can_reset_password(self) -> bool:
...
@abstractmethod
def change_password(self, user_name: str, old_password: str, new_password: str) -> bool:
...
@abstractmethod
def change_password_question_and_answer(self, user_name: str, password: str, new_password_question: str, new_password_answer: str) -> bool:
...
@abstractmethod
def reset_password(self, user_name: str, answer: str) -> str:
...
#endregion
#region IPasswordRetriever
@abstractmethod
def can_retrieve_password(self) -> bool:
...
@abstractmethod
def get_password(self, user_name: str, answer: str) -> str:
...
#endregion
#region IUserRepository
@abstractmethod
def create_user(self,
user_name: str, password: str, email: str,
password_question: str, pasword_answer: str, is_approved: bool, provider_user_key: object) -> tuple[MembershipUser, MembershipCreateStatus]:
...
@abstractmethod
def delete_user(self, user_name: str, delete_all_related_data: bool) -> bool:
...
@abstractmethod
def unlock_user(self, user_name: str) -> bool:
...
@abstractmethod
def update_user(self, user: MembershipUser) -> None:
...
@abstractmethod
def get_all_users(self, page_index: int, page_size: int) -> Collection[MembershipUser]:
...
@abstractmethod
def get_user_by_name(self, user_name: str, user_is_online: bool) -> MembershipUser:
...
@abstractmethod
def get_user_by_provider_key(self, provider_user_key: object, user_is_online: bool) -> MembershipUser:
...
@abstractmethod
def get_user_name_by_email(self, email: str) -> str:
...
@abstractmethod
def find_users_by_email(self, email_to_match: str, page_index: int, page_size: int) -> Collection[MembershipUser]:
...
@abstractmethod
def find_users_by_name(self, user_name_to_match: str, page_index: int, page_size: int) -> Collection[MembershipUser]:
...
@abstractmethod
def get_number_of_online_userS(self) -> int:
...
#endregion
#region IUserRestrictions
@abstractmethod
def requires_unique_email(self) -> bool:
...
#endregion
#region IPasswordRestrictions
@abstractmethod
def requires_question_and_answer(self) -> bool:
...
@abstractmethod
def get_max_invalid_password_attempts(self) -> int:
...
@abstractmethod
def get_min_required_alphanumberic_characters(self) -> int:
...
@abstractmethod
def get_min_required_password_length(self) -> int:
...
@abstractmethod
def get_password_attempt_window(self) -> int:
...
@abstractmethod
def get_password_format(self) -> MembershipPasswordFormat:
...
@abstractmethod
def get_password_strength_regular_expression(self) -> str:
...
#endregion
class MembershipUser:
pass
class MembershipCreateStatus:
pass
class MembershipPasswordFormat:
pass