Skip to content
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

Current github repo link isn't whitelisted in remote environments #99063

Closed
Tyriar opened this issue Jun 2, 2020 · 15 comments
Closed

Current github repo link isn't whitelisted in remote environments #99063

Tyriar opened this issue Jun 2, 2020 · 15 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded workbench-link Link protection in workbench
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 2, 2020

Testing #97578

Repro:

  1. Clone https://github.com/xtermjs/xterm.js
  2. Add // https://github.com/xtermjs/xterm.js to a file
  3. Click the link

It should work according to #97578

image

@JacksonKearl JacksonKearl added bug Issue identified by VS Code Team member as probable bug workbench-link Link protection in workbench labels Jun 2, 2020
@JacksonKearl JacksonKearl added this to the May 2020 milestone Jun 2, 2020
@JacksonKearl
Copy link
Contributor

Thanks! My regex didn't like dots 🙊

@Tyriar
Copy link
Member Author

Tyriar commented Jun 3, 2020

It doesn't appear to be fixed:

recording (11)

@Tyriar Tyriar reopened this Jun 3, 2020
@Tyriar Tyriar added the verification-found Issue verification failed label Jun 3, 2020
@JacksonKearl
Copy link
Contributor

It's checking .git/config, not package.json. With a config like this:

[remote "origin"]
        url = git@github.com:xtermjs/xterm.js.git # or https://github.com/xtermjs/xterm.js.git
        fetch = +refs/heads/*:refs/remotes/origin/*

I am seeing it behave correctly.

Whats your .git/config?

@JacksonKearl
Copy link
Contributor

@Tyriar To clarify, the .git/config file should be automatically generated when you clone/push/pull.

@JacksonKearl
Copy link
Contributor

Able to reproduce in remote-ssh. Seems to be a remote issue regarding accessing the config file.

@JacksonKearl JacksonKearl changed the title https://github.com/CURRENT_REPO_OWNER/CURRENT_REPO_NAME link isn't whitelisted Current github repo link isn't whitelisted in remote environments Jun 3, 2020
@JacksonKearl JacksonKearl removed insiders-released Patch has been released in VS Code Insiders verification-found Issue verification failed labels Jun 3, 2020
@miguelsolorio miguelsolorio added the verified Verification succeeded label Jun 4, 2020
@miguelsolorio
Copy link
Contributor

miguelsolorio commented Jun 4, 2020

I first tested this locally before I tested on a remote and am seeing this still appear (my git.config files are setup as above):

image

@miguelsolorio miguelsolorio reopened this Jun 4, 2020
@miguelsolorio miguelsolorio added verification-found Issue verification failed and removed verified Verification succeeded labels Jun 4, 2020
@JacksonKearl JacksonKearl removed the insiders-released Patch has been released in VS Code Insiders label Jun 4, 2020
@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jun 4, 2020

Fingers crossed this is actually fixed. Future verifiers, if you find a case where this doesn't work please provide the output of "Manage Trusted Domains" command and what the file {worksapceRoot}/.git/config contains

@miguelsolorio
Copy link
Contributor

FWIW, here's my setup:

trusted domains

[
  "*.microsoftonline.com",
  "*.azure.com",
]

git/config

[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
	precomposeunicode = true
[remote "origin"]
	url = git@github.com:xtermjs/xterm.js.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

@JacksonKearl
Copy link
Contributor

Re. the "Manage Trusted Domains" output, we actually alter the comments above the output. So the whole file is needed, for instance:

// Links matching one or more entries in the list below can be opened without link protection.
// The following examples show what entries can look like:
// - "https://microsoft.com": Matches this specific domain using https
// - "https://microsoft.com/foo": Matches https://microsoft.com/foo and https://microsoft.com/foo/bar,
//   but not https://microsoft.com/foobar or https://microsoft.com/bar
// - "https://*.microsoft.com": Match all domains ending in "microsoft.com" using https
// - "microsoft.com": Match this specific domain using either http or https
// - "*.microsoft.com": Match all domains ending in "microsoft.com" using either http or https
// - "*": Match all domains using either http or https
//
// By default, VS Code trusts "localhost" as well as the following domains:
// - "https://*.visualstudio.com"
// - "https://*.microsoft.com"
// - "https://aka.ms"
// - "https://vscode-auth.github.com"
// - "https://*.gallerycdn.vsassets.io"
// - "https://github.com/microsoft/"
// - "https://github.com/MicrosoftDocs/"
// - "https://login.microsoftonline.com"
//
// Additionally, the following domains are trusted based on your current GitHub login:
// - "https://github.com/JacksonKearl/"
//
// Further, the following domains are trusted based on your workspace configuration:
// - "https://github.com/microsoft/vscode.git/"
// - "https://github.com/microsoft/vscode-distro.git/"
// - "https://github.com/Dzejkop/vscode/"
//
// You can use the "Manage Trusted Domains" command to open this file.
// Save this file to apply the trusted domains rules.
[
	// "https://microsoft.com"
]

(above is in current Insiders, issue is the .git being added to the url)

@miguelsolorio
Copy link
Contributor

// Links matching one or more entries in the list below can be opened without link protection.
// The following examples show what entries can look like:
// - "https://microsoft.com": Matches this specific domain using https
// - "https://microsoft.com/foo": Matches https://microsoft.com/foo and https://microsoft.com/foo/bar,
//   but not https://microsoft.com/foobar or https://microsoft.com/bar
// - "https://*.microsoft.com": Match all domains ending in "microsoft.com" using https
// - "microsoft.com": Match this specific domain using either http or https
// - "*.microsoft.com": Match all domains ending in "microsoft.com" using either http or https
// - "*": Match all domains using either http or https
//
// By default, VS Code trusts "localhost" as well as the following domains:
// - "https://*.visualstudio.com"
// - "https://*.microsoft.com"
// - "https://aka.ms"
// - "https://vscode-auth.github.com"
// - "https://*.gallerycdn.vsassets.io"
// - "https://github.com/microsoft/"
// - "https://github.com/MicrosoftDocs/"
// - "https://login.microsoftonline.com"
//
// Additionally, the following domains are trusted based on your current GitHub login:
// - "https://github.com/misolori/"
//
// Further, the following domains are trusted based on your workspace configuration:
// - "https://github.com/misolori/playground.git/"
//
// You can use the "Manage Trusted Domains" command to open this file.
// Save this file to apply the trusted domains rules.
[
  "*.microsoftonline.com",
  "*.azure.com",
]

@JacksonKearl
Copy link
Contributor

Thanks!

@Tyriar
Copy link
Member Author

Tyriar commented Jun 5, 2020

Works for me now

@Tyriar Tyriar added the verified Verification succeeded label Jun 5, 2020
@miguelsolorio
Copy link
Contributor

miguelsolorio commented Jun 5, 2020

@JacksonKearl i noticed there was an issue in my managed trusted domains comments, my xterm project was added to a workspace project at some point and that somehow caused this line to get added to the comments (even though I wasn't in that workspace):

// Further, the following domains are trusted based on your workspace configuration:
// - "https://github.com/misolori/playground.git/"

Might be worth to follow up on that.

@JacksonKearl
Copy link
Contributor

@misolori if you delete all the comments and run "Manage Trusted Domains" does it reappear?

@miguelsolorio
Copy link
Contributor

@JacksonKearl yea that fixes it.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2020
@rzhao271 rzhao271 removed the verification-found Issue verification failed label Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded workbench-link Link protection in workbench
Projects
None yet
Development

No branches or pull requests

5 participants
@Tyriar @rzhao271 @JacksonKearl @miguelsolorio and others