-
Notifications
You must be signed in to change notification settings - Fork 591
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
Hook up webflow auth during credential checks #94
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6108777
Hook up webflow auth during credential checks
db06fca
Update yarn dependencies
6590351
Update package-lock.json
5a1a708
Add missing hosts property
33d5ff5
Add ws
d605f65
Implementing oauth webflow via external webapp
04219f0
Add UI for initiating sign in. Try anonymous access if the server sup…
3c4c30d
Add support for any github host (hosted business instances, enterpris…
5b198d5
Check if the server is a github instance when selecting remotes to use
3856af5
Oh yeah, we don't want to save all the other fields...
7c64a68
Tweak the authentication user messages
87e21ae
Merge master into shana/login
shana f6f7799
Sync yarn.lock and package-lock.json
shana 1b51607
Delay checking credentials and displaying signin
ea59abb
Improve scope validation by checking supersets as well
7f1873f
Merge master into shana/login
4e49ad6
Add nice descriptions of the settings
cb7a3d2
Fix import casing
d62e444
Make sure we always look at uris in a case-insensitive way
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,4 +332,5 @@ ASALocalRun/ | |
|
||
out | ||
node_modules | ||
media | ||
media | ||
.DS_Store |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import * as vscode from 'vscode'; | ||
|
||
export interface IHostConfiguration { | ||
host: string; | ||
username: string | undefined; | ||
token: string | undefined; | ||
} | ||
|
||
export const HostHelper = class { | ||
public static getApiHost(host: IHostConfiguration | vscode.Uri): vscode.Uri { | ||
const hostUri: vscode.Uri = host instanceof vscode.Uri ? host : vscode.Uri.parse(host.host); | ||
if (hostUri.authority === 'github.com') { | ||
return vscode.Uri.parse('https://api.github.com'); | ||
} else { | ||
return vscode.Uri.parse(`${hostUri.scheme}://${hostUri.authority}`); | ||
} | ||
} | ||
|
||
public static getApiPath(host: IHostConfiguration | vscode.Uri, path: string): string { | ||
const hostUri: vscode.Uri = host instanceof vscode.Uri ? host : vscode.Uri.parse(host.host); | ||
if (hostUri.authority === 'github.com') { | ||
return path; | ||
} else { | ||
return `/api/v3${path}`; | ||
} | ||
} | ||
}; | ||
|
||
export interface IConfiguration extends IHostConfiguration { | ||
onDidChange: vscode.Event<IConfiguration>; | ||
} | ||
|
||
export class Configuration implements IConfiguration { | ||
public username: string | undefined; | ||
public token: string | undefined; | ||
public onDidChange: vscode.Event<IConfiguration>; | ||
private _emitter: vscode.EventEmitter<IConfiguration>; | ||
|
||
constructor(public host: string) { | ||
this._emitter = new vscode.EventEmitter<IConfiguration>(); | ||
this.onDidChange = this._emitter.event; | ||
} | ||
|
||
public update(username: string | undefined, token: string | undefined, raiseEvent: boolean = true): void { | ||
if (username !== this.username || token !== this.token) { | ||
this.username = username; | ||
this.token = token; | ||
if (raiseEvent) { | ||
this._emitter.fire(this); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is it possible for there to be a case mismatch?
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.
hmmmmm, good question. possibly, yes, I can test that quick