[go: nahoru, domu]

Open Bug 1163345 Opened 9 years ago Updated 2 years ago

Resolve remaining issues in OAuth2 code implementation for Gmail

Categories

(MailNews Core :: Networking, defect)

defect

Tracking

(Not tracked)

People

(Reporter: rkent, Unassigned)

References

(Blocks 1 open bug)

Details

+++ This bug was initially created as a clone of Bug #849540 +++

In bug 849540, a number of issues were left unresolved, mainly because the feature was needed in Thunderbird 38, and desired changes could not be done due to string and interface freezes. This bug will address any remaining post-freeze issues and other disputes that arose during that bug's review.

Looking over the unresolved issues in bug 849540 comment 82, specific issues that I would like to see addressed from that comment are (these are quotes from that bug):

1) ::: mailnews/base/prefs/content/accountcreation/verifyConfig.js
(Diff revision 2)
> +        "chrome://messenger/locale/accountCreationModel.properties")

Please use a specific error message here.

2) ::: mailnews/base/public/msgIOAuth2Module.idl
(Diff revision 2)
> +   * Initialize the OAuth2 parameters from an SMTP server, and return whether or

... Please also write that you expect exactly one of the two functions being called. Also, describe briefly what the functions do, e.g. "Reads the OAuth settings for this server"

3) ::: mailnews/base/public/msgIOAuth2Module.idl
(Diff revision 2)
> +  void connect(in boolean aWithUI, in msgIOAuth2ModuleListener aCallback);

it's unclear at which steps you would call connect() vs. build*()

4) ::: mailnews/compose/src/nsSmtpProtocol.cpp
(Diff revision 2)
> +nsresult nsSmtpProtocol::OnSuccess(const nsACString &aAccessToken)

Rename this function (and OnFailure()). It's specific to OAuth, and should have OAuth in its name

5) ::: mailnews/imap/src/nsImapProtocol.cpp
(Diff revision 2)
> +    NS_ASSERTION(mOAuth2Support,

Funny message, but better would be: "Lack of oauthmodule should have been caught in [code place]"

(end quotes from bug)

There are a number of other comments that were made there that have been previously resolved, or with which I did not agree, or which are not longer relevant since what landed changed considerably from the code when those comments are made. But anyone who wants to advocate specific changes, within the scope of the functionality that landed for Thunderbird 38 (namely, hard-wired OAuth2 information for GMail servers) feel free to advocate for that here.

One remaining controversy is the naming of the new SMTP_SUSPENDED state in nsSmptProtocol.cpp  Given that currently and for the forseeable future that state is only used by OAuth2, perhaps it would be clearer to give it a name specific to AOuth2 ad BenB suggests, but I don't feel strongly about it. The state really means, as currently defined, "state is waiting for callbacks from OAuth2 methods that will reset the state depending on their results."
Type: enhancement → defect

Have 1-5 been addressed already in newer code?

Flags: needinfo?(alessandro)

I can't find a reference to 1, but 5 has still the same error message.

Flags: needinfo?(alessandro)

Ping do you think #5 might be resolved by your imap js efforts?

Blocks: tb-gmailWIP
Flags: needinfo?(remotenonsense)

(In reply to Wayne Mery (:wsmwk) from comment #3)

Ping do you think #5 might be resolved by your imap js efforts?

I think so

Flags: needinfo?(remotenonsense)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.