Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-45706: Add imaplib.IMAP4.login_plain#29398

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
przemub wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromprzemub:feature/imaplib/login_plain

Conversation

przemub
Copy link

@przemubprzemub commentedNov 4, 2021
edited
Loading

Adds authentication using PLAIN SASL mechanism.

This is a plain-text authentication mechanism that can be used
instead of :meth:IMAP4.login() when UTF-8 support is required.

https://bugs.python.org/issue45706

Adds authentication using PLAIN SASL mechanism.This is a plain-text authentication mechanism which can be usedinstead of :meth:`IMAP4.login()` when UTF-8 support is required.
@przemubprzemub requested a review froma team as acode ownerNovember 4, 2021 00:44
@the-knights-who-say-ni

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed thePSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@przemub

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please followthe steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You cancheck yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelDec 5, 2021
Copy link
Contributor

@MaxwellDupreMaxwellDupre left a comment

Choose a reason for hiding this comment

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

Both tests passed.
Looks ok to me.

See :RFC:`6855`, page 5.

It will only work if the server ``CAPABILITY`` response includes
the phrase ``AUTH=PLAIN``.
Copy link
Member

Choose a reason for hiding this comment

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

The module partially supports RFC 3501, which says that AUTH=PLAIN is mandatory. I understand that means advertising it in CAPABILITY is optional, so it might work regardless.

"""
return self.authenticate(
"PLAIN",
lambda _: "{0}\x00{0}\x00{1}".format(user, password).encode()
Copy link
Member

Choose a reason for hiding this comment

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

This sets the authorization identity (authzid) to the user name. Wouldn’t it be better to allow omittingauthzid by default, let the server derive it?https://datatracker.ietf.org/doc/html/rfc4616#section-2

f'\x00{user}\x00{password}'.encode('utf-8')


This is a plain-text authentication mechanism that can be used
instead of :meth:`IMAP4.login()` when UTF-8 support is required.
See :RFC:`6855`, page 5.
Copy link
Member

Choose a reason for hiding this comment

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

Not sure that referring to RFC 6855 is that relevant. All it does is recommend against UTF-8 support with LOGIN, and say that AUTHENTICATE supports UTF-8.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vadmiumvadmiumvadmium left review comments

@MaxwellDupreMaxwellDupreMaxwellDupre approved these changes

Assignees
No one assigned
Labels
awaiting core reviewstaleStale PR or inactive for long period of time.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@przemub@the-knights-who-say-ni@vadmium@MaxwellDupre@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp