Skip to content

Commit 23699f4

Browse files
committed
feat!: support for creating granular access tokens
BREAKING CHANGE: The createToken function has been updated to support granular access tokens. The previous method of creating classic tokens is deprecated. Please use the new createToken function with appropriate parameters for granular tokens.
1 parent ef7203a commit 23699f4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,10 @@ const removeToken = async (tokenKey, opts = {}) => {
236236
return null
237237
}
238238

239-
const createToken = (password, readonly, cidrs, opts = {}) => fetch.json('/-/npm/v1/tokens', {
239+
const createToken = (tokenData, opts = {}) => fetch.json('/-/npm/v1/tokens', {
240240
...opts,
241241
method: 'POST',
242-
body: {
243-
password: password,
244-
readonly: readonly,
245-
cidr_whitelist: cidrs,
246-
},
242+
body: tokenData,
247243
})
248244

249245
class WebLoginInvalidResponse extends HttpErrorBase {

0 commit comments

Comments
 (0)