-
Notifications
You must be signed in to change notification settings - Fork 30
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
Use a shared SASL implementation #69
base: master
Are you sure you want to change the base?
Commits on Apr 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 3e72a95 - Browse repository at this point
Copy the full SHA 3e72a95View commit details -
Add
auth
keyword arg tostart
methodsThis adds a new `auth` keyword param to `Net::SMTP.start` and `#start` that can be used to pass any arbitrary keyword parameters to `#authenticate`. The pre-existing `username`, `secret`, etc keyword params will retain their existing behavior as positional arguments to `#authenticate`.
Configuration menu - View commit details
-
Copy full SHA for 7a6f2f1 - Browse repository at this point
Copy the full SHA 7a6f2f1View commit details -
Add
username
keyword param tostart
Although "user" is a reasonable abbreviation, the parameter is more accurately described as a "username" or an "authentication identity". They are synonomous here, with "username" winning when both are present.
Configuration menu - View commit details
-
Copy full SHA for 33395bc - Browse repository at this point
Copy the full SHA 33395bcView commit details -
Add keyword parameters to authenticators
Username can be set by args[0], authcid, username, or user. Secret can be set by args[1], secret, or password. Since all of the existing authenticators have the same API, it is sufficient to update `check_args` in the base class.
Configuration menu - View commit details
-
Copy full SHA for f1fea49 - Browse repository at this point
Copy the full SHA f1fea49View commit details -
Do not require positional args for
#authenticate
This API is a little bit confusing, IMO. But it does preserve backward compatibility, while allowing authenticators that don't allow positional parameters to work without crashing. But, authenticators that require only one parameter—or more than three—will still be inaccessible.
Configuration menu - View commit details
-
Copy full SHA for 54ae43d - Browse repository at this point
Copy the full SHA 54ae43dView commit details -
Add
type
keyword arg to#authenticate
This is convenient for `smtp.start auth: {type:, **etc}`.
Configuration menu - View commit details
-
Copy full SHA for a47a7c3 - Browse repository at this point
Copy the full SHA a47a7c3View commit details -
Add
#auth
method for SASL authenticationAlthough `#authenticate` can be updated to make username and secret _both_ optional, by placing the mechanism last and making it optional, it's not possible to use an authenticator with a _single_ positional parameter or with more than two positional parameters. By placing `type` first among positional parameters or as a keyword argument, we avoid this problem.
Configuration menu - View commit details
-
Copy full SHA for d8cc256 - Browse repository at this point
Copy the full SHA d8cc256View commit details -
The net-imap dependency requires 2.7.3, to deal with kwargs.
Configuration menu - View commit details
-
Copy full SHA for e631221 - Browse repository at this point
Copy the full SHA e631221View commit details -
Use net-imap's SASL implementation 🚧[WIP]🚧
This commit adds the `net-imap` as a default fallback for mechanisms that haven't otherwise been added. In this commit, the original implementation is still used by `#authenticate` for the `PLAIN`, `XOAUTH2`, `LOGIN`, and `CRAM-MD5` mechanisms. Every other mechanism supported by `net-imap` v0.4.0 is added here: * `ANONYMOUS` * `DIGEST-MD5` _(deprecated)_ * `EXTERNAL` * `OAUTHBEARER` * `SCRAM-SHA-1` and `SCRAM-SHA-256` **TODO:** Ideally, `net-smtp` and `net-imap` should both depend on a shared `sasl` or `net-sasl` gem, rather than keep the SASL implementation inside one or the other. See ruby/net-imap#23.
Configuration menu - View commit details
-
Copy full SHA for 78e1da8 - Browse repository at this point
Copy the full SHA 78e1da8View commit details