@@ -8,7 +8,7 @@ import { getDomainsOfRemotes, getRemotes } from 'vs/platform/extensionManagement
88
99suite ( 'Config Remotes' , ( ) => {
1010
11- const whitelist = [
11+ const allowedDomains = [
1212 'github.com' ,
1313 'github2.com' ,
1414 'github3.com' ,
@@ -20,37 +20,37 @@ suite('Config Remotes', () => {
2020 ] ;
2121
2222 test ( 'HTTPS remotes' , function ( ) {
23- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://github.com/Microsoft/vscode.git' ) , whitelist ) , [ 'github.com' ] ) ;
24- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://git.example.com/gitproject.git' ) , whitelist ) , [ 'example.com' ] ) ;
25- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://username@github2.com/username/repository.git' ) , whitelist ) , [ 'github2.com' ] ) ;
26- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://username:password@github3.com/username/repository.git' ) , whitelist ) , [ 'github3.com' ] ) ;
27- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://username:password@example2.com:1234/username/repository.git' ) , whitelist ) , [ 'example2.com' ] ) ;
28- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://example3.com:1234/username/repository.git' ) , whitelist ) , [ 'example3.com' ] ) ;
23+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://github.com/Microsoft/vscode.git' ) , allowedDomains ) , [ 'github.com' ] ) ;
24+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://git.example.com/gitproject.git' ) , allowedDomains ) , [ 'example.com' ] ) ;
25+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://username@github2.com/username/repository.git' ) , allowedDomains ) , [ 'github2.com' ] ) ;
26+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://username:password@github3.com/username/repository.git' ) , allowedDomains ) , [ 'github3.com' ] ) ;
27+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://username:password@example2.com:1234/username/repository.git' ) , allowedDomains ) , [ 'example2.com' ] ) ;
28+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'https://example3.com:1234/username/repository.git' ) , allowedDomains ) , [ 'example3.com' ] ) ;
2929 } ) ;
3030
3131 test ( 'SSH remotes' , function ( ) {
32- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'ssh://user@git.server.org/project.git' ) , whitelist ) , [ 'server.org' ] ) ;
32+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'ssh://user@git.server.org/project.git' ) , allowedDomains ) , [ 'server.org' ] ) ;
3333 } ) ;
3434
3535 test ( 'SCP-like remotes' , function ( ) {
36- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'git@github.com:Microsoft/vscode.git' ) , whitelist ) , [ 'github.com' ] ) ;
37- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'user@git.server.org:project.git' ) , whitelist ) , [ 'server.org' ] ) ;
38- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'git.server2.org:project.git' ) , whitelist ) , [ 'server2.org' ] ) ;
36+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'git@github.com:Microsoft/vscode.git' ) , allowedDomains ) , [ 'github.com' ] ) ;
37+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'user@git.server.org:project.git' ) , allowedDomains ) , [ 'server.org' ] ) ;
38+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'git.server2.org:project.git' ) , allowedDomains ) , [ 'server2.org' ] ) ;
3939 } ) ;
4040
4141 test ( 'Local remotes' , function ( ) {
42- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( '/opt/git/project.git' ) , whitelist ) , [ ] ) ;
43- assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'file:///opt/git/project.git' ) , whitelist ) , [ ] ) ;
42+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( '/opt/git/project.git' ) , allowedDomains ) , [ ] ) ;
43+ assert . deepStrictEqual ( getDomainsOfRemotes ( remote ( 'file:///opt/git/project.git' ) , allowedDomains ) , [ ] ) ;
4444 } ) ;
4545
4646 test ( 'Multiple remotes' , function ( ) {
4747 const config = [ 'https://github.com/Microsoft/vscode.git' , 'https://git.example.com/gitproject.git' ] . map ( remote ) . join ( '' ) ;
48- assert . deepStrictEqual ( getDomainsOfRemotes ( config , whitelist ) . sort ( ) , [ 'example.com' , 'github.com' ] ) ;
48+ assert . deepStrictEqual ( getDomainsOfRemotes ( config , allowedDomains ) . sort ( ) , [ 'example.com' , 'github.com' ] ) ;
4949 } ) ;
5050
51- test ( 'Whitelisting ' , ( ) => {
51+ test ( 'Non allowed domains are anonymized ' , ( ) => {
5252 const config = [ 'https://github.com/Microsoft/vscode.git' , 'https://git.foobar.com/gitproject.git' ] . map ( remote ) . join ( '' ) ;
53- assert . deepStrictEqual ( getDomainsOfRemotes ( config , whitelist ) . sort ( ) , [ 'aaaaaa.aaa' , 'github.com' ] ) ;
53+ assert . deepStrictEqual ( getDomainsOfRemotes ( config , allowedDomains ) . sort ( ) , [ 'aaaaaa.aaa' , 'github.com' ] ) ;
5454 } ) ;
5555
5656 test ( 'HTTPS remotes to be hashed' , function ( ) {
0 commit comments