-
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
Mfa branch #84
Mfa branch #84
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.
🎉
src/rred_reports/reports/auth.py
Outdated
LOG_FORMAT = "%(levelname)-10s %(asctime)s %(name)-30s %(funcName)-35s %(lineno)-5d: %(message)s" | ||
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) | ||
logger = logging.getLogger(__name__) |
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.
I think we're using loguru in this project, can just replace all of this with
from loguru import logger
src/rred_reports/reports/auth.py
Outdated
f"Please follow auth flow by going to this link, then enter in the final redirect URL {auth_code_flow['auth_uri']}\n" | ||
) |
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.
should probably change the text here to say to write to the access_link.txt file in at the top level of the directory
src/rred_reports/reports/auth.py
Outdated
else: | ||
logger.info("No suitable token exists in cache. Let's initiate interactive login.") | ||
auth_code_flow = app.initiate_auth_code_flow(scopes=[self.settings.scope], login_hint=self.settings.username) | ||
final_url = click.confirm( |
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.
because we don't use it, probably worth not keeping the output
final_url = click.confirm( | |
click.confirm( |
src/rred_reports/reports/auth.py
Outdated
result = app.acquire_token_silent([self.settings.scope], account=accounts[0]) | ||
else: | ||
logger.info("No suitable token exists in cache. Let's initiate interactive login.") | ||
auth_code_flow = app.initiate_auth_code_flow(scopes=[self.settings.scope], login_hint=self.settings.username) |
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.
Looks like you can set how long this token is valid for, might be worth seeing if we can make it a day so that you don't have to do it every hour
auth_code_flow = app.initiate_auth_code_flow(scopes=[self.settings.scope], login_hint=self.settings.username) | |
auth_code_flow = app.initiate_auth_code_flow(scopes=[self.settings.scope], login_hint=self.settings.username, max_age=60*60*24) |
looks like you'll need to resolve some conflicts before it can merge btw, have you done that before? |
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.
looking nice, thanks for getting this in
Changes for MFA