0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-04-15 03:02:51 -05:00

fix(api): cidr whitelist for tokens (#5186)

* fix(api): cidr whitelist for tokens

* remove debug
This commit is contained in:
Marc Bernard 2025-04-05 08:28:31 +02:00 committed by GitHub
parent ebc6171829
commit 5f036c0b57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'@verdaccio/api': patch
---
fix(api): cidr whitelist for tokens

View file

@ -14,12 +14,15 @@ import { mask, stringToMD5 } from '@verdaccio/utils';
import { $NextFunctionVer, $RequestExtend } from '../../types/custom';
export type NormalizeToken = Token & {
cidr_whitelist: string[];
created: string;
};
// npm expects "cidr_whitelist" for token list
function normalizeToken(token: Token): NormalizeToken {
return {
...token,
cidr_whitelist: token.cidr || [],
created: new Date(token.created).toISOString(),
};
}