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

PYTHON-3716 OIDC-SASL Follow-Up #1365

Merged
merged 39 commits into from
Sep 28, 2023
Merged

Conversation

blink1073
Copy link
Member

@blink1073 blink1073 commented Aug 30, 2023

@blink1073
Copy link
Member Author

Working locally with the Atlas hosts:

================================= 32 passed, 1 skipped, 1 warning in 71.53s (0:01:11) ==================================

@blink1073
Copy link
Member Author

cc @durran

@blink1073 blink1073 changed the title DRIVERS-2415 Simplifications DRIVERS-2616 OIDC-SASL Follow-Up Sep 5, 2023
@blink1073 blink1073 marked this pull request as ready for review September 8, 2023 01:15
@blink1073 blink1073 requested a review from a team as a code owner September 8, 2023 01:15
@blink1073 blink1073 requested review from ShaneHarvey and removed request for a team September 8, 2023 01:15
TEST_ARGS="test/auth_aws/test_auth_oidc.py"

# Work around for root certifi not being installed.
# TODO: Remove after PYTHON-3952
Copy link
Member

Choose a reason for hiding this comment

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

Can this be removed now? If not can we open a new ticket so we don't forget?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to say "is deployed", I still need to coordinate that.

@@ -1,828 +0,0 @@
# Copyright 2023-present MongoDB, Inc.
Copy link
Member

Choose a reason for hiding this comment

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

Would you be able to rename this file in a separate commit to make this review easier?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in #1378

@blink1073 blink1073 changed the title DRIVERS-2616 OIDC-SASL Follow-Up PYTHON-3716 OIDC-SASL Follow-Up Sep 16, 2023
Copy link
Contributor

@NoahStapp NoahStapp left a comment

Choose a reason for hiding this comment

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

A couple minor comments, otherwise looks great!

if [ ! -f "./secrets-export.sh" ]; then
bash .evergreen/tox.sh -m aws-secrets -- drivers/oidc
fi
source ./secrets-export.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this source be under a set +x for safety?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -255,6 +269,9 @@ fi
# Show the installed packages
PIP_QUIET=0 python -m pip list

python -c "import urllib.request;urllib.request.urlopen('https://www.google.com')"
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of this line?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was for debugging, fixed

timeout = CALLBACK_TIMEOUT_SECONDS
if not use_callbacks and not current_valid_token:
# TODO: DRIVERS-2672, handle machine callback here as well.
cb = properties.request_token_callback
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nitpick, but this would be cleaner as a one-liner: cb = properties.request_token_callback if use_callback else None

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

def reauthenticate(self, conn: Connection) -> Optional[Mapping[str, Any]]:
"""Handle a reauthenticate from the server."""
# First see if we have the a newer token on the authenticator.
prev_id = getattr(conn, "oidc_token_gen_id", 0)
Copy link
Member

Choose a reason for hiding this comment

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

Let's make oidc_token_gen_id a well defined property on Connection and avoid getattr.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, it was already there as an optional int, updated

@blink1073 blink1073 merged commit 0590ce4 into mongodb:master Sep 28, 2023
10 checks passed
@blink1073 blink1073 deleted the DRIVERS-2415-13 branch September 28, 2023 17:48
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.

3 participants