tokens: add ip restriction

This commit is contained in:
Girish Ramakrishnan
2025-03-07 11:53:03 +01:00
parent 2b0fd17fbf
commit 5342dae5b3
21 changed files with 177 additions and 44 deletions
+2 -2
View File
@@ -18,10 +18,10 @@ function create() {
if (error || result.status !== 200) return [error || result];
return [null, result.body.tokens];
},
async add(name, scope) {
async add(name, scope, allowedIpRanges) {
let error, result;
try {
result = await fetcher.post(`${API_ORIGIN}/api/v1/tokens`, { name, scope }, { access_token: accessToken });
result = await fetcher.post(`${API_ORIGIN}/api/v1/tokens`, { name, scope, allowedIpRanges }, { access_token: accessToken });
} catch (e) {
error = e;
}