|
10 | 10 | let headscaleAPIKey = localStorage.getItem('headscaleAPIKey') || ''; |
11 | 11 |
|
12 | 12 | // endpoint url for getting users |
13 | | - let endpointURL = '/api/v1/namespace'; |
| 13 | + let endpointURL = '/api/v1/user'; |
14 | 14 |
|
15 | 15 | //returning variables |
16 | 16 | let headscaleUsers = [new User()]; |
|
40 | 40 | }); |
41 | 41 |
|
42 | 42 | await headscaleUsersResponse.json().then((data) => { |
43 | | - headscaleUsers = data.namespaces |
| 43 | + headscaleUsers = data.users |
44 | 44 | // sort the users |
45 | 45 | headscaleUsers = sortUsers(headscaleUsers); |
46 | 46 | }); |
|
57 | 57 | let headscaleAPIKey = localStorage.getItem('headscaleAPIKey') || ''; |
58 | 58 |
|
59 | 59 | // endpoint url for editing users |
60 | | - let endpointURL = '/api/v1/namespace/' + currentUsername + '/rename/' + newUsername; |
| 60 | + let endpointURL = '/api/v1/user/' + currentUsername + '/rename/' + newUsername; |
61 | 61 |
|
62 | 62 | await fetch(headscaleURL + endpointURL, { |
63 | 63 | method: 'POST', |
|
189 | 189 | let headscaleAPIKey = localStorage.getItem('headscaleAPIKey') || ''; |
190 | 190 |
|
191 | 191 | // endpoint url for editing users |
192 | | - let endpointURL = '/api/v1/namespace/' + currentUsername; |
| 192 | + let endpointURL = '/api/v1/user/' + currentUsername; |
193 | 193 |
|
194 | 194 | await fetch(headscaleURL + endpointURL, { |
195 | 195 | method: 'DELETE', |
|
218 | 218 | let headscaleAPIKey = localStorage.getItem('headscaleAPIKey') || ''; |
219 | 219 |
|
220 | 220 | // endpoint url for editing users |
221 | | - let endpointURL = '/api/v1/namespace'; |
| 221 | + let endpointURL = '/api/v1/user'; |
222 | 222 |
|
223 | 223 | await fetch(headscaleURL + endpointURL, { |
224 | 224 | method: 'POST', |
|
281 | 281 | }); |
282 | 282 |
|
283 | 283 | await headscaleDeviceResponse.json().then((data) => { |
284 | | - headscaleDevices = data.machines |
285 | | - headscaleDevices = sortDevices(headscaleDevices) |
| 284 | + headscaleDevices = data.machines; |
| 285 | + headscaleDevices = sortDevices(headscaleDevices); |
286 | 286 | }); |
287 | 287 | // set the stores |
288 | 288 | apiTestStore.set('succeeded'); |
|
341 | 341 | let headscalePreAuthKey = [new PreAuthKey()]; |
342 | 342 | let headscalePreAuthKeyResponse: Response = new Response(); |
343 | 343 |
|
344 | | - await fetch(headscaleURL + endpointURL + '?namespace=' + userName, { |
| 344 | + await fetch(headscaleURL + endpointURL + '?user=' + userName, { |
345 | 345 | method: 'GET', |
346 | 346 | headers: { |
347 | 347 | Accept: 'application/json', |
|
381 | 381 | Authorization: `Bearer ${headscaleAPIKey}` |
382 | 382 | }, |
383 | 383 | body: JSON.stringify({ |
384 | | - namespace: userName, |
| 384 | + user: userName, |
385 | 385 | expiration: expiry, |
386 | 386 | reusable: reusable, |
387 | 387 | ephemeral: ephemeral |
|
416 | 416 | Authorization: `Bearer ${headscaleAPIKey}` |
417 | 417 | }, |
418 | 418 | body: JSON.stringify({ |
419 | | - namespace: userName, |
| 419 | + user: userName, |
420 | 420 | key: preAuthKey |
421 | 421 | }) |
422 | 422 | }) |
|
442 | 442 | // endpoint url for editing users |
443 | 443 | let endpointURL = '/api/v1/machine/register'; |
444 | 444 |
|
445 | | - await fetch(headscaleURL + endpointURL + '?namespace=' + userName + '&key=' + key, { |
| 445 | + await fetch(headscaleURL + endpointURL + '?user=' + userName + '&key=' + key, { |
446 | 446 | method: 'POST', |
447 | 447 | headers: { |
448 | 448 | Accept: 'application/json', |
|
469 | 469 | let headscaleAPIKey = localStorage.getItem('headscaleAPIKey') || ''; |
470 | 470 |
|
471 | 471 | // endpoint url for editing users |
472 | | - let endpointURL = '/api/v1/machine/' + deviceID + '/namespace?namespace=' + user; |
| 472 | + let endpointURL = '/api/v1/machine/' + deviceID + '/user?user=' + user; |
473 | 473 |
|
474 | 474 | await fetch(headscaleURL + endpointURL, { |
475 | 475 | method: 'POST', |
|
0 commit comments