-
Notifications
You must be signed in to change notification settings - Fork 0
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
add blacklist file #21
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some food for thought. View full project report here.
src/shared/utils.py
Outdated
|
||
async def add_blacklist_token(self, token: str) -> bool: | ||
try: | ||
with open(file=self._token_file, mode="a") as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with open(file=self._token_file, mode="a") as file: | |
with open(file=self._token_file, mode="a", encoding="utf_8") as file: |
UnicodeEncodeError
can occur if the text being written to the file contain characters not compatible with the OS's default text encoding because encoding
is not set. More info.
src/shared/utils.py
Outdated
|
||
async def is_token_blacklisted(self, token: str) -> bool: | ||
try: | ||
with open(file=self._token_file) as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnicodeDecodeError
can occur if the content of the file has characters incompatible with the OS's default encoding. Python uses the OS's default text encoding on the content because encoding
is not set. More info.
e62a924
to
2a42999
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some food for thought. View full project report here.
src/shared/utils.py
Outdated
|
||
async def add_blacklist_token(self, token: str) -> bool: | ||
try: | ||
with open(file=self._token_file, mode="a") as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with open(file=self._token_file, mode="a") as file: | |
with open(file=self._token_file, mode="a", encoding="utf_8") as file: |
UnicodeEncodeError
can occur if the text being written to the file contain characters not compatible with the OS's default text encoding because encoding
is not set. Read more.
src/shared/utils.py
Outdated
|
||
async def is_token_blacklisted(self, token: str) -> bool: | ||
try: | ||
with open(file=self._token_file) as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnicodeDecodeError
can occur if the content of the file has characters incompatible with the OS's default encoding. Python uses the OS's default text encoding on the content because encoding
is not set. More info.
2a42999
to
66ca2f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth considering. View full project report here.
src/shared/utils.py
Outdated
|
||
async def add_blacklist_token(self, token: str) -> bool: | ||
try: | ||
with open(file=self._token_file, mode="a") as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with open(file=self._token_file, mode="a") as file: | |
with open(file=self._token_file, mode="a", encoding="utf_8") as file: |
UnicodeEncodeError
can occur if the text being written to the file contain characters not compatible with the OS's default text encoding because encoding
is not set. More details.
src/shared/utils.py
Outdated
|
||
async def is_token_blacklisted(self, token: str) -> bool: | ||
try: | ||
with open(file=self._token_file) as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnicodeDecodeError
can occur if the content of the file has characters incompatible with the OS's default encoding. Python uses the OS's default text encoding on the content because encoding
is not set. Explained here.
66ca2f7
to
f90379e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things to consider. View full project report here.
|
||
async def is_token_blacklisted(self, token: str) -> bool: | ||
try: | ||
with open(file=self._token_file, mode="r") as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnicodeDecodeError
can occur if the content of the file has characters incompatible with the OS's default encoding. Python uses the OS's default text encoding on the content because encoding
is not set. Explained here.
Add token to black list on logout.