Skip to content
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

Merged
merged 14 commits into from
Jun 27, 2024
Merged

Mfa branch #84

merged 14 commits into from
Jun 27, 2024

Conversation

katiebuntic
Copy link
Collaborator

Changes for MFA

@katiebuntic katiebuntic self-assigned this Jun 27, 2024
Copy link
Collaborator

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Comment on lines 20 to 22
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__)
Copy link
Collaborator

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

Comment on lines 52 to 53
f"Please follow auth flow by going to this link, then enter in the final redirect URL {auth_code_flow['auth_uri']}\n"
)
Copy link
Collaborator

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

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(
Copy link
Collaborator

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

Suggested change
final_url = click.confirm(
click.confirm(

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)
Copy link
Collaborator

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

Suggested change
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)

@stefpiatek
Copy link
Collaborator

looks like you'll need to resolve some conflicts before it can merge btw, have you done that before?

Copy link
Collaborator

@stefpiatek stefpiatek left a 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

@katiebuntic katiebuntic merged commit eab399e into main Jun 27, 2024
7 checks passed
@katiebuntic katiebuntic deleted the mfa-branch branch June 27, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants