@@ -9,17 +9,21 @@ const { makeFixture } = require('./__helpers__/FixtureFS.js')
9
9
const localhost =
10
10
typeof window === 'undefined' ? 'localhost' : window.location.hostname
11
11
12
+
const reverse = t =>
13
+
t
14
+
.split('')
15
+
.reverse()
16
+
.join('')
17
+
12
18
describe('Hosting Providers', () => {
13
19
describe('AWS CodeCommit', () => {
20
+
// These HTTPS Git credentials for AWS CodeCommit are for IAM user arn:aws:iam::260687965765:user/tester
21
+
// which only has git access to the test repo:
22
+
// https://git-codecommit.us-west-2.amazonaws.com/v1/repos/test.empty
23
+
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
24
+
const password = reverse('=cYfZKeyeW3ig0yZrkzkd9ElDKYctLgV2WNOZ1Ctntnt')
25
+
const username = 'tester-at-260687965765'
14
26
it('fetch', async () => {
15
-
// These HTTPS Git credentials for AWS CodeCommit are for IAM user arn:aws:iam::260687965765:user/tester
16
-
// which only has git access to the test repo:
17
-
// https://git-codecommit.us-west-2.amazonaws.com/v1/repos/test.empty
18
-
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
19
-
const token = '=cYfZKeyeW3ig0yZrkzkd9ElDKYctLgV2WNOZ1Ctntnt'
20
-
.split('')
21
-
.reverse()
22
-
.join('')
23
27
// Setup
24
28
const { fs, gitdir } = await makeFixture('test-hosting-providers')
25
29
// Test
@@ -28,24 +32,15 @@ describe('Hosting Providers', () => {
28
32
http,
29
33
gitdir,
30
34
corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
31
-
username: 'tester-at-260687965765',
32
-
password: token,
33
35
remote: 'awscc',
34
36
ref: 'master',
37
+
onAuth: () => ({ username, password }),
35
38
})
36
39
expect(res).toBeTruthy()
37
40
expect(res.defaultBranch).toBe('refs/heads/master')
38
41
expect(res.fetchHead).toBe('c03e131196f43a78888415924bcdcbf3090f3316')
39
42
})
40
43
it('push', async () => {
41
-
// These HTTPS Git credentials for AWS CodeCommit are for IAM user arn:aws:iam::260687965765:user/tester
42
-
// which only has git access to the test repo:
43
-
// https://git-codecommit.us-west-2.amazonaws.com/v1/repos/test.empty
44
-
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
45
-
const token = '=cYfZKeyeW3ig0yZrkzkd9ElDKYctLgV2WNOZ1Ctntnt'
46
-
.split('')
47
-
.reverse()
48
-
.join('')
49
44
// Setup
50
45
const { fs, gitdir } = await makeFixture('test-hosting-providers')
51
46
// Test
@@ -54,25 +49,23 @@ describe('Hosting Providers', () => {
54
49
http,
55
50
gitdir,
56
51
corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
57
-
username: 'tester-at-260687965765',
58
-
password: token,
59
52
remote: 'awscc',
60
53
ref: 'master',
61
54
force: true,
55
+
onAuth: () => ({ username, password }),
62
56
})
63
57
expect(res).toBeTruthy()
64
58
expect(res.ok).toBe(true)
65
59
expect(res.refs['refs/heads/master'].ok).toBe(true)
66
60
})
67
61
})
62
+
68
63
describe('Azure DevOps', () => {
64
+
// These git credentials are specific to https://isomorphic-git@dev.azure.com/isomorphic-git/isomorphic-git/_git/test.empty
65
+
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
66
+
const password = reverse('ez8dMKyRfWpzMkhg3QJb5m')
67
+
const username = 'isomorphicgittestpush'
69
68
it('fetch', async () => {
70
-
// These git credentials are specific to https://isomorphic-git@dev.azure.com/isomorphic-git/isomorphic-git/_git/test.empty
71
-
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
72
-
const token = 'ez8dMKyRfWpzMkhg3QJb5m'
73
-
.split('')
74
-
.reverse()
75
-
.join('')
76
69
// Setup
77
70
const { fs, gitdir } = await makeFixture('test-hosting-providers')
78
71
// Test
@@ -81,22 +74,15 @@ describe('Hosting Providers', () => {
81
74
http,
82
75
gitdir,
83
76
// corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
84
-
username: 'isomorphicgittestpush',
85
-
password: token,
86
77
remote: 'azure',
87
78
ref: 'master',
79
+
onAuth: () => ({ username, password }),
88
80
})
89
81
expect(res).toBeTruthy()
90
82
expect(res.defaultBranch).toBe('refs/heads/master')
91
83
expect(res.fetchHead).toBe('c03e131196f43a78888415924bcdcbf3090f3316')
92
84
})
93
85
it('push', async () => {
94
-
// These git credentials are specific to https://isomorphic-git@dev.azure.com/isomorphic-git/isomorphic-git/_git/test.empty
95
-
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
96
-
const token = 'ez8dMKyRfWpzMkhg3QJb5m'
97
-
.split('')
98
-
.reverse()
99
-
.join('')
100
86
// Setup
101
87
const { fs, gitdir } = await makeFixture('test-hosting-providers')
102
88
// Test
@@ -105,27 +91,25 @@ describe('Hosting Providers', () => {
105
91
http,
106
92
gitdir,
107
93
// corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
108
-
username: 'isomorphicgittestpush',
109
-
password: token,
110
94
remote: 'azure',
111
95
ref: 'master',
112
96
force: true,
97
+
onAuth: () => ({ username, password }),
113
98
})
114
99
expect(res).toBeTruthy()
115
100
expect(res.ok).toBe(true)
116
101
expect(res.refs['refs/heads/master'].ok).toBe(true)
117
102
})
118
103
})
104
+
119
105
describe('Bitbucket', () => {
106
+
// This App Password is for the test account 'isomorphic-git' user on Bitbucket,
107
+
// with "repositories.read" and "repositories.write" access. However the only repo the account has access to is
108
+
// https://bitbucket.org/isomorphic-git/test.empty
109
+
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
110
+
const password = reverse('TqSWhF3xLxEEXKQtZTwn')
111
+
const username = 'isomorphic-git'
120
112
it('push', async () => {
121
-
// This App Password is for the test account 'isomorphic-git' user on Bitbucket,
122
-
// with "repositories.read" and "repositories.write" access. However the only repo the account has access to is
123
-
// https://bitbucket.org/isomorphic-git/test.empty
124
-
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
125
-
const token = 'TqSWhF3xLxEEXKQtZTwn'
126
-
.split('')
127
-
.reverse()
128
-
.join('')
129
113
// Setup
130
114
const { fs, gitdir } = await makeFixture('test-hosting-providers')
131
115
// Test
@@ -134,25 +118,16 @@ describe('Hosting Providers', () => {
134
118
http,
135
119
gitdir,
136
120
corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
137
-
username: 'isomorphic-git',
138
-
password: token,
139
121
remote: 'bitbucket',
140
122
ref: 'master',
141
123
force: true,
124
+
onAuth: () => ({ username, password }),
142
125
})
143
126
expect(res).toBeTruthy()
144
127
expect(res.ok).toBe(true)
145
128
expect(res.refs['refs/heads/master'].ok).toBe(true)
146
129
})
147
130
it('fetch', async () => {
148
-
// This App Password is for the test account 'isomorphic-git' user on Bitbucket,
149
-
// with "repositories.read" and "repositories.write" access. However the only repo the account has access to is
150
-
// https://bitbucket.org/isomorphic-git/test.empty
151
-
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
152
-
const token = 'TqSWhF3xLxEEXKQtZTwn'
153
-
.split('')
154
-
.reverse()
155
-
.join('')
156
131
// Setup
157
132
const { fs, gitdir } = await makeFixture('test-hosting-providers')
158
133
// Test
@@ -161,26 +136,23 @@ describe('Hosting Providers', () => {
161
136
http,
162
137
gitdir,
163
138
corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
164
-
username: 'isomorphic-git',
165
-
password: token,
166
139
remote: 'bitbucket',
167
140
ref: 'master',
141
+
onAuth: () => ({ username, password }),
168
142
})
169
143
expect(res).toBeTruthy()
170
144
expect(res.defaultBranch).toBe('refs/heads/master')
171
145
expect(res.fetchHead).toBe('c03e131196f43a78888415924bcdcbf3090f3316')
172
146
})
173
147
})
148
+
174
149
describe('GitHub', () => {
150
+
// This Personal OAuth token is for a test account (https://github.com/isomorphic-git-test-push)
151
+
// with "public_repo" access. The only repo it has write access to is
152
+
// https://github.com/isomorphic-git/test.empty
153
+
// It is stored reversed to avoid Github's auto-revoking feature.
154
+
const token = reverse('e8df25b340c98b7eec57a4976bd9074b93a7dc1c')
175
155
it('fetch', async () => {
176
-
// This Personal OAuth token is for a test account (https://github.com/isomorphic-git-test-push)
177
-
// with "public_repo" access. The only repo it has write access to is
178
-
// https://github.com/isomorphic-git/test.empty
179
-
// It is stored reversed to avoid Github's auto-revoking feature.
180
-
const token = 'e8df25b340c98b7eec57a4976bd9074b93a7dc1c'
181
-
.split('')
182
-
.reverse()
183
-
.join('')
184
156
// Setup
185
157
const { fs, gitdir } = await makeFixture('test-hosting-providers')
186
158
// Test
@@ -189,23 +161,15 @@ describe('Hosting Providers', () => {
189
161
http,
190
162
gitdir,
191
163
corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
192
-
token: token,
193
164
remote: 'github',
194
165
ref: 'master',
166
+
onAuth: () => ({ token }),
195
167
})
196
168
expect(res).toBeTruthy()
197
169
expect(res.defaultBranch).toBe('refs/heads/test')
198
170
expect(res.fetchHead).toBe('c03e131196f43a78888415924bcdcbf3090f3316')
199
171
})
200
172
it('push', async () => {
201
-
// This Personal OAuth token is for a test account (https://github.com/isomorphic-git-test-push)
202
-
// with "public_repo" access. The only repo it has write access to is
203
-
// https://github.com/isomorphic-git/test.empty
204
-
// It is stored reversed to avoid Github's auto-revoking feature.
205
-
const token = 'e8df25b340c98b7eec57a4976bd9074b93a7dc1c'
206
-
.split('')
207
-
.reverse()
208
-
.join('')
209
173
// Setup
210
174
const { fs, gitdir } = await makeFixture('test-hosting-providers')
211
175
// Test
@@ -214,26 +178,25 @@ describe('Hosting Providers', () => {
214
178
http,
215
179
gitdir,
216
180
corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
217
-
token: token,
218
181
remote: 'github',
219
182
ref: 'master',
220
183
force: true,
184
+
onAuth: () => ({ token }),
221
185
})
222
186
expect(res).toBeTruthy()
223
187
expect(res.ok).toBe(true)
224
188
expect(res.refs['refs/heads/master'].ok).toBe(true)
225
189
})
226
190
})
191
+
227
192
describe('GitLab', () => {
193
+
// This Personal Access Token is for a test account (https://gitlab.com/isomorphic-git-test-push)
194
+
// with "read_repository" and "write_repository" access. However the only repo it has write access to is
195
+
// https://gitlab.com/isomorphic-git/test.empty
196
+
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
197
+
const password = reverse('vjNzgKP7acS6e6vb2Q6g')
198
+
const username = 'isomorphic-git-test-push'
228
199
it('fetch', async () => {
229
-
// This Personal Access Token is for a test account (https://gitlab.com/isomorphic-git-test-push)
230
-
// with "read_repository" and "write_repository" access. However the only repo it has write access to is
231
-
// https://gitlab.com/isomorphic-git/test.empty
232
-
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
233
-
const token = 'vjNzgKP7acS6e6vb2Q6g'
234
-
.split('')
235
-
.reverse()
236
-
.join('')
237
200
// Setup
238
201
const { fs, gitdir } = await makeFixture('test-hosting-providers')
239
202
// Test
@@ -242,24 +205,15 @@ describe('Hosting Providers', () => {
242
205
http,
243
206
gitdir,
244
207
corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
245
-
username: 'isomorphic-git-test-push',
246
-
password: token,
247
208
remote: 'gitlab',
248
209
ref: 'master',
210
+
onAuth: () => ({ username, password }),
249
211
})
250
212
expect(res).toBeTruthy()
251
213
expect(res.defaultBranch).toBe('refs/heads/master')
252
214
expect(res.fetchHead).toBe('c03e131196f43a78888415924bcdcbf3090f3316')
253
215
})
254
216
it('push', async () => {
255
-
// This Personal Access Token is for a test account (https://gitlab.com/isomorphic-git-test-push)
256
-
// with "read_repository" and "write_repository" access. However the only repo it has write access to is
257
-
// https://gitlab.com/isomorphic-git/test.empty
258
-
// It is stored reversed because the GitHub one is stored reversed and I like being consistant.
259
-
const token = 'vjNzgKP7acS6e6vb2Q6g'
260
-
.split('')
261
-
.reverse()
262
-
.join('')
263
217
// Setup
264
218
const { fs, gitdir } = await makeFixture('test-hosting-providers')
265
219
// Test
@@ -268,11 +222,10 @@ describe('Hosting Providers', () => {
268
222
http,
269
223
gitdir,
270
224
corsProxy: process.browser ? `http://${localhost}:9999` : undefined,
271
-
username: 'isomorphic-git-test-push',
272
-
password: token,
273
225
remote: 'gitlab',
274
226
ref: 'master',
275
227
force: true,
228
+
onAuth: () => ({ username, password }),
276
229
})
277
230
expect(res).toBeTruthy()
278
231
expect(res.ok).toBe(true)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4