verdaccio-auth-memory 10.3.0 → 10.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -29
- package/lib/Memory.d.ts +1 -1
- package/lib/Memory.js +114 -160
- package/lib/Memory.js.map +1 -1
- package/lib/_virtual/_rolldown/runtime.js +23 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +10 -14
- package/lib/index.js.map +1 -1
- package/package.json +11 -12
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# verdaccio-auth-memory
|
|
2
|
+
|
|
2
3
|
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fverdaccio%2Fverdaccio-auth-memory?ref=badge_shield)
|
|
3
4
|
[](https://circleci.com/gh/ayusharma/verdaccio-auth-memory)
|
|
4
5
|
[](https://codecov.io/gh/verdaccio/verdaccio-auth-memory)
|
|
5
6
|
|
|
6
|
-
|
|
7
7
|
This verdaccio auth plugin keeps the users in a memory plain object.
|
|
8
8
|
This means all sessions and users will disappear when you restart the verdaccio server.
|
|
9
9
|
|
|
@@ -44,46 +44,45 @@ plugin(config, appConfig);
|
|
|
44
44
|
|
|
45
45
|
Where:
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
- config - module's own config
|
|
48
|
+
- appOptions - collection of different internal verdaccio objects
|
|
49
|
+
- appOptions.config - main config
|
|
50
|
+
- appOptions.logger - logger
|
|
51
51
|
|
|
52
52
|
This should export four functions:
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
It should respond with:
|
|
57
|
-
- `cb(err)` in case of an error (error will be returned to user)
|
|
58
|
-
- `cb(null, false)` in case registration is disabled (next auth plugin will be executed)
|
|
59
|
-
- `cb(null, true)` in case user registered successfully
|
|
54
|
+
- `adduser(user, password, cb)` Add new users
|
|
60
55
|
|
|
61
|
-
|
|
56
|
+
It should respond with:
|
|
57
|
+
- `cb(err)` in case of an error (error will be returned to user)
|
|
58
|
+
- `cb(null, false)` in case registration is disabled (next auth plugin will be executed)
|
|
59
|
+
- `cb(null, true)` in case user registered successfully
|
|
62
60
|
|
|
63
|
-
|
|
61
|
+
It's useful to set `err.status` property to set http status code (e.g. `err.status = 403`).
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
- `cb(err)` in case of a fatal error (error will be returned to user, keep those rare)
|
|
67
|
-
- `cb(null, false)` in case user not authenticated (next auth plugin will be executed)
|
|
68
|
-
- `cb(null, [groups])` in case user is authenticated
|
|
63
|
+
- `authenticate(user, password, cb)` Authenticate the user
|
|
69
64
|
|
|
70
|
-
|
|
65
|
+
It should respond with:
|
|
66
|
+
- `cb(err)` in case of a fatal error (error will be returned to user, keep those rare)
|
|
67
|
+
- `cb(null, false)` in case user not authenticated (next auth plugin will be executed)
|
|
68
|
+
- `cb(null, [groups])` in case user is authenticated
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
Groups is an array of all users/usergroups this user has access to. You should probably include username itself here.
|
|
73
71
|
|
|
74
|
-
|
|
75
|
-
- `cb(err)` in case of a fatal error (error will be returned to user, keep those rare)
|
|
76
|
-
- `cb(null, false)` in case user not allowed to access (next auth plugin will be executed)
|
|
77
|
-
- `cb(null, true)` in case user is allowed to access
|
|
72
|
+
- `allow_access(user, pkg, cb)` Check whether the user has permissions to access a resource (package)
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- `cb(null, false)` in case user not allowed to publish (next auth plugin will be executed)
|
|
84
|
-
- `cb(null, true)` in case user is allowed to publish
|
|
74
|
+
It should respond with:
|
|
75
|
+
- `cb(err)` in case of a fatal error (error will be returned to user, keep those rare)
|
|
76
|
+
- `cb(null, false)` in case user not allowed to access (next auth plugin will be executed)
|
|
77
|
+
- `cb(null, true)` in case user is allowed to access
|
|
85
78
|
|
|
79
|
+
- `allow_publish(user, pkg, cb)` Check whether the user has permissions to publish a resource (package)
|
|
86
80
|
|
|
81
|
+
It should respond with:
|
|
82
|
+
- `cb(err)` in case of a fatal error (error will be returned to user, keep those rare)
|
|
83
|
+
- `cb(null, false)` in case user not allowed to publish (next auth plugin will be executed)
|
|
84
|
+
- `cb(null, true)` in case user is allowed to publish
|
|
87
85
|
|
|
88
86
|
## License
|
|
87
|
+
|
|
89
88
|
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fverdaccio%2Fverdaccio-auth-memory?ref=badge_large)
|
package/lib/Memory.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config,
|
|
1
|
+
import { Callback, Config, IPluginAuth, Logger, PackageAccess, PluginOptions, RemoteUser } from '@verdaccio/legacy-types';
|
|
2
2
|
export interface UserMemory {
|
|
3
3
|
name: string;
|
|
4
4
|
password: string;
|
package/lib/Memory.js
CHANGED
|
@@ -1,162 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this._logger.debug({
|
|
115
|
-
user: user.name
|
|
116
|
-
}, 'user: @{user} not allowed to access package');
|
|
117
|
-
return cb(err);
|
|
118
|
-
}
|
|
119
|
-
if (pkg.access && pkg.access.includes(user.name) || pkg.access && pkg.access.includes('$authenticated')) {
|
|
120
|
-
debug('user %s has been granted access to package', user.name);
|
|
121
|
-
this._logger.debug({
|
|
122
|
-
user: user.name
|
|
123
|
-
}, 'user: @{user} has been granted access');
|
|
124
|
-
return cb(null, true);
|
|
125
|
-
}
|
|
126
|
-
const err = getForbidden('not allowed to access package');
|
|
127
|
-
debug('user %s not allowed to access package', user.name);
|
|
128
|
-
this._logger.debug({
|
|
129
|
-
user: user.name
|
|
130
|
-
}, 'user: @{user} not allowed to access package');
|
|
131
|
-
return cb(err);
|
|
132
|
-
}
|
|
133
|
-
allow_publish(user, pkg, cb) {
|
|
134
|
-
debug('allow publish for user: %s', user.name);
|
|
135
|
-
if (pkg.publish && pkg.publish.includes('$all') || pkg.publish && pkg.publish.includes('$anonymous')) {
|
|
136
|
-
this._logger.debug({
|
|
137
|
-
user: user.name
|
|
138
|
-
}, 'user: @{user} has been granted to publish');
|
|
139
|
-
return cb(null, true);
|
|
140
|
-
}
|
|
141
|
-
if (!user.name) {
|
|
142
|
-
debug('user is not authenticated, cannot publish package');
|
|
143
|
-
const err = getForbidden('not allowed to publish package');
|
|
144
|
-
this._logger.debug({
|
|
145
|
-
user: user.name
|
|
146
|
-
}, 'user: @{user} not allowed to publish package');
|
|
147
|
-
return cb(err);
|
|
148
|
-
}
|
|
149
|
-
if (pkg.publish && pkg.publish.includes(user.name) || pkg.publish && pkg.publish.includes('$authenticated')) {
|
|
150
|
-
debug('user %s has been granted to publish package', user.name);
|
|
151
|
-
return cb(null, true);
|
|
152
|
-
}
|
|
153
|
-
const err = getForbidden('not allowed to publish package');
|
|
154
|
-
debug('user %s not allowed to publish package', user.name);
|
|
155
|
-
this._logger.debug({
|
|
156
|
-
user: user.name
|
|
157
|
-
}, 'user: @{user} not allowed to publish package');
|
|
158
|
-
return cb(err);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.js");
|
|
2
|
+
let debug = require("debug");
|
|
3
|
+
debug = require_runtime.__toESM(debug);
|
|
4
|
+
let _verdaccio_core = require("@verdaccio/core");
|
|
5
|
+
//#region src/Memory.ts
|
|
6
|
+
var { getConflict, getForbidden, getNotFound, getUnauthorized } = _verdaccio_core.errorUtils;
|
|
7
|
+
var debug$1 = (0, debug.default)("verdaccio:plugin:memory");
|
|
8
|
+
var Memory = class {
|
|
9
|
+
_logger;
|
|
10
|
+
_users;
|
|
11
|
+
_config;
|
|
12
|
+
_app_config;
|
|
13
|
+
constructor(config, appOptions) {
|
|
14
|
+
debug$1("init memory auth plugin with config: %o", config);
|
|
15
|
+
this._users = config.users || {};
|
|
16
|
+
this._config = config;
|
|
17
|
+
this._logger = appOptions.logger;
|
|
18
|
+
this._app_config = appOptions.config;
|
|
19
|
+
}
|
|
20
|
+
authenticate(user, password, done) {
|
|
21
|
+
debug$1("authenticate user: %s", user);
|
|
22
|
+
debug$1("authenticate password: %s", _verdaccio_core.cryptoUtils.mask(password, 5));
|
|
23
|
+
const userCredentials = this._users[user];
|
|
24
|
+
if (!userCredentials) {
|
|
25
|
+
debug$1("user %s does not exist", user);
|
|
26
|
+
this._logger.debug({ user }, "user @{user} does not exist");
|
|
27
|
+
return done(null, false);
|
|
28
|
+
}
|
|
29
|
+
if (password !== userCredentials.password) {
|
|
30
|
+
debug$1("password invalid for user %s", user);
|
|
31
|
+
const err = getUnauthorized("i don't like your password");
|
|
32
|
+
this._logger.info({ user }, "password invalid for: @{user}");
|
|
33
|
+
return done(err);
|
|
34
|
+
}
|
|
35
|
+
this._logger.info({ user }, "authentication succeeded for @{user}");
|
|
36
|
+
return done(null, [user]);
|
|
37
|
+
}
|
|
38
|
+
adduser(user, password, done) {
|
|
39
|
+
debug$1("add user: %s", user);
|
|
40
|
+
if (this._users[user]) {
|
|
41
|
+
this._logger.debug({ user }, "user @{user} already exist");
|
|
42
|
+
return done(null, true);
|
|
43
|
+
}
|
|
44
|
+
if (this._app_config.max_users) {
|
|
45
|
+
debug$1("max users configured: %d", this._app_config.max_users);
|
|
46
|
+
if (Object.keys(this._users).length >= this._app_config.max_users) return done(getConflict("maximum amount of users reached"));
|
|
47
|
+
}
|
|
48
|
+
this._users[user] = {
|
|
49
|
+
name: user,
|
|
50
|
+
password
|
|
51
|
+
};
|
|
52
|
+
this._logger.info({ user }, "user added succeeded for @{user}");
|
|
53
|
+
done(null, user);
|
|
54
|
+
}
|
|
55
|
+
changePassword(username, password, newPassword, cb) {
|
|
56
|
+
debug$1("change password for user: %s", username);
|
|
57
|
+
const user = this._users[username];
|
|
58
|
+
this._logger.debug({ user: username }, "user: @{user} init change password");
|
|
59
|
+
if (user && user.password === password) {
|
|
60
|
+
user.password = newPassword;
|
|
61
|
+
this._users[username] = user;
|
|
62
|
+
this._logger.info({ user }, "user changed password succeeded for @{user}");
|
|
63
|
+
cb(null, user);
|
|
64
|
+
} else {
|
|
65
|
+
const err = getNotFound("user not found");
|
|
66
|
+
this._logger.debug({ user: username }, "change password user @{user} not found");
|
|
67
|
+
return cb(err);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
allow_access(user, pkg, cb) {
|
|
71
|
+
if (pkg.access && pkg.access.includes("$all") || pkg.access && pkg.access.includes("$anonymous")) {
|
|
72
|
+
this._logger.debug({ user: user.name }, "user: @{user} has been granted access");
|
|
73
|
+
return cb(null, true);
|
|
74
|
+
}
|
|
75
|
+
if (!user.name) {
|
|
76
|
+
debug$1("user is not authenticated, cannot access package");
|
|
77
|
+
const err = getForbidden("not allowed to access package");
|
|
78
|
+
this._logger.debug({ user: user.name }, "user: @{user} not allowed to access package");
|
|
79
|
+
return cb(err);
|
|
80
|
+
}
|
|
81
|
+
if (pkg.access && pkg.access.includes(user.name) || pkg.access && pkg.access.includes("$authenticated")) {
|
|
82
|
+
debug$1("user %s has been granted access to package", user.name);
|
|
83
|
+
this._logger.debug({ user: user.name }, "user: @{user} has been granted access");
|
|
84
|
+
return cb(null, true);
|
|
85
|
+
}
|
|
86
|
+
const err = getForbidden("not allowed to access package");
|
|
87
|
+
debug$1("user %s not allowed to access package", user.name);
|
|
88
|
+
this._logger.debug({ user: user.name }, "user: @{user} not allowed to access package");
|
|
89
|
+
return cb(err);
|
|
90
|
+
}
|
|
91
|
+
allow_publish(user, pkg, cb) {
|
|
92
|
+
debug$1("allow publish for user: %s", user.name);
|
|
93
|
+
if (pkg.publish && pkg.publish.includes("$all") || pkg.publish && pkg.publish.includes("$anonymous")) {
|
|
94
|
+
this._logger.debug({ user: user.name }, "user: @{user} has been granted to publish");
|
|
95
|
+
return cb(null, true);
|
|
96
|
+
}
|
|
97
|
+
if (!user.name) {
|
|
98
|
+
debug$1("user is not authenticated, cannot publish package");
|
|
99
|
+
const err = getForbidden("not allowed to publish package");
|
|
100
|
+
this._logger.debug({ user: user.name }, "user: @{user} not allowed to publish package");
|
|
101
|
+
return cb(err);
|
|
102
|
+
}
|
|
103
|
+
if (pkg.publish && pkg.publish.includes(user.name) || pkg.publish && pkg.publish.includes("$authenticated")) {
|
|
104
|
+
debug$1("user %s has been granted to publish package", user.name);
|
|
105
|
+
return cb(null, true);
|
|
106
|
+
}
|
|
107
|
+
const err = getForbidden("not allowed to publish package");
|
|
108
|
+
debug$1("user %s not allowed to publish package", user.name);
|
|
109
|
+
this._logger.debug({ user: user.name }, "user: @{user} not allowed to publish package");
|
|
110
|
+
return cb(err);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
//#endregion
|
|
161
114
|
exports.default = Memory;
|
|
115
|
+
|
|
162
116
|
//# sourceMappingURL=Memory.js.map
|
package/lib/Memory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Memory.js","names":["_core","require","_debug","_interopRequireDefault","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","getConflict","getForbidden","getNotFound","getUnauthorized","errorUtils","debug","createDebug","Memory","constructor","config","appOptions","_users","users","_config","_logger","logger","_app_config","authenticate","user","password","done","cryptoUtils","mask","userCredentials","err","info","adduser","max_users","keys","length","name","changePassword","username","newPassword","cb","allow_access","pkg","access","includes","allow_publish","publish","exports"],"sources":["../src/Memory.ts"],"sourcesContent":["import { Config, PluginOptions, Callback, PackageAccess, IPluginAuth, RemoteUser, Logger } from '@verdaccio/legacy-types';\nimport {cryptoUtils, errorUtils } from '@verdaccio/core';\nimport createDebug from 'debug';\nconst { getConflict, getForbidden, getNotFound, getUnauthorized } = errorUtils;\n\nconst debug = createDebug('verdaccio:plugin:memory');\n\nexport interface UserMemory {\n name: string;\n password: string;\n}\n\nexport interface Users {\n [key: string]: UserMemory;\n}\n\nexport interface VerdaccioMemoryConfig extends Config {\n max_users?: number;\n users: Users;\n}\n\n\nexport default class Memory implements IPluginAuth<VerdaccioMemoryConfig> {\n public _logger: Logger;\n public _users: Users;\n public _config: {};\n public _app_config: VerdaccioMemoryConfig;\n\n public constructor(config: VerdaccioMemoryConfig, appOptions: PluginOptions<VerdaccioMemoryConfig>) {\n debug('init memory auth plugin with config: %o', config);\n this._users = config.users || {};\n this._config = config;\n this._logger = appOptions.logger;\n this._app_config = appOptions.config;\n }\n\n public authenticate(user: string, password: string, done: Callback): void {\n debug('authenticate user: %s', user);\n debug('authenticate password: %s', cryptoUtils.mask(password, 5));\n const userCredentials = this._users[user];\n\n if (!userCredentials) {\n debug('user %s does not exist', user);\n this._logger.debug({ user }, 'user @{user} does not exist');\n return done(null, false);\n }\n\n if (password !== userCredentials.password) {\n debug('password invalid for user %s', user);\n const err = getUnauthorized(\"i don't like your password\");\n this._logger.info({ user }, 'password invalid for: @{user}');\n\n return done(err);\n }\n\n // authentication succeeded!\n // return all usergroups this user has access to;\n this._logger.info({ user }, 'authentication succeeded for @{user}');\n return done(null, [user]);\n }\n\n public adduser(user: string, password: string, done: Callback): void {\n debug('add user: %s', user);\n if (this._users[user]) {\n this._logger.debug({ user }, 'user @{user} already exist');\n return done(null, true);\n }\n\n if (this._app_config.max_users) {\n debug('max users configured: %d', this._app_config.max_users);\n if (Object.keys(this._users).length >= this._app_config.max_users) {\n const err = getConflict('maximum amount of users reached');\n\n return done(err);\n }\n }\n\n this._users[user] = { name: user, password: password };\n\n this._logger.info({ user }, 'user added succeeded for @{user}');\n done(null, user);\n }\n\n public changePassword(username: string, password: string, newPassword: string, cb: Callback): void {\n debug('change password for user: %s', username);\n const user: UserMemory = this._users[username];\n this._logger.debug({ user: username }, 'user: @{user} init change password');\n\n if (user && user.password === password) {\n user.password = newPassword;\n this._users[username] = user;\n\n this._logger.info({ user }, 'user changed password succeeded for @{user}');\n cb(null, user);\n } else {\n const err = getNotFound('user not found');\n this._logger.debug({ user: username }, 'change password user @{user} not found');\n\n return cb(err);\n }\n }\n\n public allow_access(user: RemoteUser, pkg: PackageAccess, cb: Callback): void {\n if ((pkg.access && pkg.access.includes('$all')) || (pkg.access && pkg.access.includes('$anonymous'))) {\n this._logger.debug({ user: user.name }, 'user: @{user} has been granted access');\n\n return cb(null, true);\n }\n\n if (!user.name) {\n debug('user is not authenticated, cannot access package');\n const err = getForbidden('not allowed to access package');\n this._logger.debug({ user: user.name }, 'user: @{user} not allowed to access package');\n return cb(err);\n }\n\n if ((pkg.access && pkg.access.includes(user.name)) || (pkg.access && pkg.access.includes('$authenticated'))) {\n debug('user %s has been granted access to package', user.name);\n this._logger.debug({ user: user.name }, 'user: @{user} has been granted access');\n return cb(null, true);\n }\n\n const err = getForbidden('not allowed to access package');\n\n debug('user %s not allowed to access package', user.name);\n this._logger.debug({ user: user.name }, 'user: @{user} not allowed to access package');\n return cb(err);\n }\n\n public allow_publish(user: RemoteUser, pkg: PackageAccess, cb: Callback): void {\n debug('allow publish for user: %s', user.name);\n if ((pkg.publish && pkg.publish.includes('$all')) || (pkg.publish && pkg.publish.includes('$anonymous'))) {\n this._logger.debug({ user: user.name }, 'user: @{user} has been granted to publish');\n return cb(null, true);\n }\n\n if (!user.name) {\n debug('user is not authenticated, cannot publish package');\n const err = getForbidden('not allowed to publish package');\n this._logger.debug({ user: user.name }, 'user: @{user} not allowed to publish package');\n\n return cb(err);\n }\n\n if ((pkg.publish && pkg.publish.includes(user.name)) || (pkg.publish && pkg.publish.includes('$authenticated'))) {\n debug('user %s has been granted to publish package', user.name);\n return cb(null, true);\n }\n\n const err = getForbidden('not allowed to publish package');\n debug('user %s not allowed to publish package', user.name);\n this._logger.debug({ user: user.name }, 'user: @{user} not allowed to publish package');\n\n return cb(err);\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;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O,CAACF,QAAQ,CAACpB,IAAI,CAACY,IAAI,CAAC,IAAMM,GAAG,CAACI,OAAO,IAAIJ,GAAG,CAACI,OAAO,CAACF,QAAQ,CAAC,gBAAgB,CAAE,EAAE;MAC/GjC,KAAK,CAAC,6CAA6C,EAAEa,IAAI,CAACY,IAAI,CAAC;MAC/D,OAAOI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IACvB;IAEA,MAAMV,GAAG,GAAGvB,YAAY,CAAC,gCAAgC,CAAC;IAC1DI,KAAK,CAAC,wCAAwC,EAAEa,IAAI,CAACY,IAAI,CAAC;IAC1D,IAAI,CAAChB,OAAO,CAACT,KAAK,CAAC;MAAEa,IAAI,EAAEA,IAAI,CAACY;IAAK,CAAC,EAAE,8CAA8C,CAAC;IAEvF,OAAOI,EAAE,CAACV,GAAG,CAAC;EAChB;AACF;AAACiB,OAAA,CAAA5D,OAAA,GAAA0B,MAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Memory.js","names":[],"sources":["../src/Memory.ts"],"sourcesContent":["import createDebug from 'debug';\n\nimport { cryptoUtils, errorUtils } from '@verdaccio/core';\nimport type {\n Callback,\n Config,\n IPluginAuth,\n Logger,\n PackageAccess,\n PluginOptions,\n RemoteUser,\n} from '@verdaccio/legacy-types';\n\nconst { getConflict, getForbidden, getNotFound, getUnauthorized } = errorUtils;\n\nconst debug = createDebug('verdaccio:plugin:memory');\n\nexport interface UserMemory {\n name: string;\n password: string;\n}\n\nexport interface Users {\n [key: string]: UserMemory;\n}\n\nexport interface VerdaccioMemoryConfig extends Config {\n max_users?: number;\n users: Users;\n}\n\nexport default class Memory implements IPluginAuth<VerdaccioMemoryConfig> {\n public _logger: Logger;\n public _users: Users;\n public _config: {};\n public _app_config: VerdaccioMemoryConfig;\n\n public constructor(\n config: VerdaccioMemoryConfig,\n appOptions: PluginOptions<VerdaccioMemoryConfig>\n ) {\n debug('init memory auth plugin with config: %o', config);\n this._users = config.users || {};\n this._config = config;\n this._logger = appOptions.logger;\n this._app_config = appOptions.config;\n }\n\n public authenticate(user: string, password: string, done: Callback): void {\n debug('authenticate user: %s', user);\n debug('authenticate password: %s', cryptoUtils.mask(password, 5));\n const userCredentials = this._users[user];\n\n if (!userCredentials) {\n debug('user %s does not exist', user);\n this._logger.debug({ user }, 'user @{user} does not exist');\n return done(null, false);\n }\n\n if (password !== userCredentials.password) {\n debug('password invalid for user %s', user);\n const err = getUnauthorized(\"i don't like your password\");\n this._logger.info({ user }, 'password invalid for: @{user}');\n\n return done(err);\n }\n\n // authentication succeeded!\n // return all usergroups this user has access to;\n this._logger.info({ user }, 'authentication succeeded for @{user}');\n return done(null, [user]);\n }\n\n public adduser(user: string, password: string, done: Callback): void {\n debug('add user: %s', user);\n if (this._users[user]) {\n this._logger.debug({ user }, 'user @{user} already exist');\n return done(null, true);\n }\n\n if (this._app_config.max_users) {\n debug('max users configured: %d', this._app_config.max_users);\n if (Object.keys(this._users).length >= this._app_config.max_users) {\n const err = getConflict('maximum amount of users reached');\n\n return done(err);\n }\n }\n\n this._users[user] = { name: user, password: password };\n\n this._logger.info({ user }, 'user added succeeded for @{user}');\n done(null, user);\n }\n\n public changePassword(\n username: string,\n password: string,\n newPassword: string,\n cb: Callback\n ): void {\n debug('change password for user: %s', username);\n const user: UserMemory = this._users[username];\n this._logger.debug({ user: username }, 'user: @{user} init change password');\n\n if (user && user.password === password) {\n user.password = newPassword;\n this._users[username] = user;\n\n this._logger.info({ user }, 'user changed password succeeded for @{user}');\n cb(null, user);\n } else {\n const err = getNotFound('user not found');\n this._logger.debug({ user: username }, 'change password user @{user} not found');\n\n return cb(err);\n }\n }\n\n public allow_access(user: RemoteUser, pkg: PackageAccess, cb: Callback): void {\n if (\n (pkg.access && pkg.access.includes('$all')) ||\n (pkg.access && pkg.access.includes('$anonymous'))\n ) {\n this._logger.debug({ user: user.name }, 'user: @{user} has been granted access');\n\n return cb(null, true);\n }\n\n if (!user.name) {\n debug('user is not authenticated, cannot access package');\n const err = getForbidden('not allowed to access package');\n this._logger.debug({ user: user.name }, 'user: @{user} not allowed to access package');\n return cb(err);\n }\n\n if (\n (pkg.access && pkg.access.includes(user.name)) ||\n (pkg.access && pkg.access.includes('$authenticated'))\n ) {\n debug('user %s has been granted access to package', user.name);\n this._logger.debug({ user: user.name }, 'user: @{user} has been granted access');\n return cb(null, true);\n }\n\n const err = getForbidden('not allowed to access package');\n\n debug('user %s not allowed to access package', user.name);\n this._logger.debug({ user: user.name }, 'user: @{user} not allowed to access package');\n return cb(err);\n }\n\n public allow_publish(user: RemoteUser, pkg: PackageAccess, cb: Callback): void {\n debug('allow publish for user: %s', user.name);\n if (\n (pkg.publish && pkg.publish.includes('$all')) ||\n (pkg.publish && pkg.publish.includes('$anonymous'))\n ) {\n this._logger.debug({ user: user.name }, 'user: @{user} has been granted to publish');\n return cb(null, true);\n }\n\n if (!user.name) {\n debug('user is not authenticated, cannot publish package');\n const err = getForbidden('not allowed to publish package');\n this._logger.debug({ user: user.name }, 'user: @{user} not allowed to publish package');\n\n return cb(err);\n }\n\n if (\n (pkg.publish && pkg.publish.includes(user.name)) ||\n (pkg.publish && pkg.publish.includes('$authenticated'))\n ) {\n debug('user %s has been granted to publish package', user.name);\n return cb(null, true);\n }\n\n const err = getForbidden('not allowed to publish package');\n debug('user %s not allowed to publish package', user.name);\n this._logger.debug({ user: user.name }, 'user: @{user} not allowed to publish package');\n\n return cb(err);\n }\n}\n"],"mappings":";;;;;AAaA,IAAM,EAAE,aAAa,cAAc,aAAa,oBAAoB,gBAAA;AAEpE,IAAM,WAAA,GAAA,MAAA,SAAoB,0BAA0B;AAgBpD,IAAqB,SAArB,MAA0E;CACxE;CACA;CACA;CACA;CAEA,YACE,QACA,YACA;AACA,UAAM,2CAA2C,OAAO;AACxD,OAAK,SAAS,OAAO,SAAS,EAAE;AAChC,OAAK,UAAU;AACf,OAAK,UAAU,WAAW;AAC1B,OAAK,cAAc,WAAW;;CAGhC,aAAoB,MAAc,UAAkB,MAAsB;AACxE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AG,MAAM,KAAK;;AAGvB,MAAI,CAAC,KAAK,MAAM;AACd,WAAM,oDAAoD;GAC1D,MAAM,MAAM,aAAa,iCAAiC;AAC1D,QAAK,QAAQ,MAAM,EAAE,MAAM,KAAK,MAAM,EAAE,+CAA+C;AAEvF,UAAO,GAAG,IAAI;;AAGhB,MACG,IAAI,WAAW,IAAI,QAAQ,SAAS,KAAK,KAAK,IAC9C,IAAI,WAAW,IAAI,QAAQ,SAAS,iBAAiB,EACtD;AACA,WAAM,+CAA+C,KAAK,KAAK;AAC/D,UAAO,GAAG,MAAM,KAAK;;EAGvB,MAAM,MAAM,aAAa,iCAAiC;AAC1D,UAAM,0CAA0C,KAAK,KAAK;AAC1D,OAAK,QAAQ,MAAM,EAAE,MAAM,KAAK,MAAM,EAAE,+CAA+C;AAEvF,SAAO,GAAG,IAAI"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Memory", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Memory.default;
|
|
10
|
-
}
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
11
4
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
const require_Memory = require("./Memory.js");
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
var src_default = require_Memory.default;
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.Memory = require_Memory.default;
|
|
10
|
+
exports.default = src_default;
|
|
11
|
+
|
|
16
12
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import Memory from './Memory';\n\nexport { Memory };\n\nexport default Memory;\n"],"mappings":";;;;;;AAIA,IAAA,cAAe,eAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verdaccio-auth-memory",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.2",
|
|
4
4
|
"description": "Auth plugin for Verdaccio that keeps users in memory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"verdaccio",
|
|
@@ -28,24 +28,23 @@
|
|
|
28
28
|
"node": ">=18"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@verdaccio/core": "8.0.0-next-8.
|
|
32
|
-
"debug": "4.3
|
|
31
|
+
"@verdaccio/core": "8.0.0-next-8.29",
|
|
32
|
+
"debug": "4.4.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@types/debug": "4.1.
|
|
36
|
-
"@verdaccio/legacy-types": "1.0.
|
|
35
|
+
"@types/debug": "4.1.12",
|
|
36
|
+
"@verdaccio/legacy-types": "1.0.2",
|
|
37
|
+
"vite": "8.0.8",
|
|
38
|
+
"vite-plugin-dts": "4.5.4",
|
|
39
|
+
"vitest": "4.1.4"
|
|
37
40
|
},
|
|
38
41
|
"funding": {
|
|
39
42
|
"type": "opencollective",
|
|
40
43
|
"url": "https://opencollective.com/verdaccio"
|
|
41
44
|
},
|
|
42
45
|
"scripts": {
|
|
43
|
-
"clean": "rimraf ./
|
|
44
|
-
"test": "
|
|
45
|
-
"
|
|
46
|
-
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
47
|
-
"build:js": "babel src/ --out-dir lib/ --copy-files --extensions \".ts,.tsx\" --source-maps",
|
|
48
|
-
"watch": "pnpm build:js -- --watch",
|
|
49
|
-
"build": "pnpm run build:js && pnpm run build:types"
|
|
46
|
+
"clean": "rimraf ./lib",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"build": "vite build"
|
|
50
49
|
}
|
|
51
50
|
}
|