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:
parent
ebc6171829
commit
5f036c0b57
2 changed files with 8 additions and 0 deletions
5
.changeset/swift-zebras-cheer.md
Normal file
5
.changeset/swift-zebras-cheer.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@verdaccio/api': patch
|
||||
---
|
||||
|
||||
fix(api): cidr whitelist for tokens
|
|
@ -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(),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue