-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cleanup deprecated and out-dated authentication API #11564
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I don't see any way we can guarantee compatibility with proposed API stages, and the entire purpose of declaring the API a proposal only is that it should not be relied upon indefinitely.
private accounts = new Map<string, string[]>(); // Map account name to session ids | ||
private sessions = new Map<string, string>(); // Map account id to name | ||
private sessions = new Map<string, string>(); // Map account id to name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe as a JSDoc so that it appears on hover for anyone working here in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, great idea, I fixed it!
.then(() => this.messageService.info('Successfully signed out.')) | ||
.then(() => { }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.then(() => this.messageService.info('Successfully signed out.')) | |
.then(() => { }); | |
.then(() => { this.messageService.info('Successfully signed out.'); }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, thanks!
$onDidChangeAuthenticationSessions(id: string, label: string): Promise<void> { | ||
this.onDidChangeSessionsEmitter.fire({ provider: { id, label } }); | ||
async $onDidChangeAuthenticationSessions(provider: theia.AuthenticationProviderInformation): Promise<void> { | ||
this.onDidChangeSessionsEmitter.fire({ provider }); | ||
return Promise.resolve(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be deleted if the function is declared async
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, thank you!
- Remove very out-dated backwards compatibility to proposed VS Code API -- Get rid of provider id-based API -- Remove deprecated 'hasSession' from API -- Deprecate login/logout (now: createSession/removeSession) in Theia Previously we were compatible with a very specific commit of the proposed authentication API of VS Code 1.53.2. The API was moved from its proposed state to stable with 1.54.0 to which we are fully compatible. Relates to #11556
d6b12a5
to
3850a44
Compare
@colin-grant-work Thank you very much! I fixed the issues you mentioned and pushed an update. Should we merge this then or do you (or someone else) want to perform additional tests? |
@martin-fleck-at, I'm fine with merging, but if you'd like to request additional reviews, that is of course perfectly fine. |
What it does
Previously we were compatible with a very specific commit of the proposed authentication API of VS Code 1.53.2. The API was moved from its proposed state to stable with 1.54.0 to which we are fully compatible even after this commit.
For a list of how the current compatibility came to be, please see #10709 (comment)
Relates to #11556
How to test
Check out commit https://github.com/martin-fleck-at/theia/tree/issue-1156-test which adds an authentication provider based on the stable API. We have commands that showcase the log in and log out of an account. This is basically an updated version of the testing strategy here: #10709
Review checklist
Reminder for reviewers