@@ -53,6 +53,7 @@ export interface VerdaccioGitLabPlugin extends IPluginAuth<VerdaccioGitlabConfig
53
53
export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
54
54
options : PluginOptions < VerdaccioGitlabConfig > ;
55
55
config : VerdaccioGitlabConfig ;
56
+ // @ts -ignore
56
57
authCache : AuthCache ;
57
58
logger : Logger ;
58
59
publishLevel : VerdaccioGitlabAccessLevel ;
@@ -93,6 +94,7 @@ export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
93
94
// Try to find the user groups in the cache
94
95
const cachedUserGroups = this . _getCachedUserGroups ( user , password ) ;
95
96
if ( cachedUserGroups ) {
97
+ // @ts -ignore
96
98
this . logger . debug ( `[gitlab] user: ${ user } found in cache, authenticated with groups:` , cachedUserGroups ) ;
97
99
return cb ( null , cachedUserGroups . publish ) ;
98
100
}
@@ -120,6 +122,7 @@ export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
120
122
// - for access, depending on the package settings in verdaccio
121
123
// - for publish, the logged in user id and all the groups they can reach as fixed `$auth.gitlab.publish` = `$owner`
122
124
const gitlabPublishQueryParams = this . config . legacy_mode ? { owned : true } : { min_access_level : publishLevelId } ;
125
+ // @ts -ignore
123
126
this . logger . trace ( '[gitlab] querying gitlab user groups with params:' , gitlabPublishQueryParams ) ;
124
127
125
128
const groupsPromise = GitlabAPI . Groups . all ( gitlabPublishQueryParams ) . then ( groups => {
@@ -135,6 +138,7 @@ export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
135
138
this . _setCachedUserGroups ( user , password , { publish : realGroups } ) ;
136
139
137
140
this . logger . info ( `[gitlab] user: ${ user } successfully authenticated` ) ;
141
+ // @ts -ignore
138
142
this . logger . debug ( `[gitlab] user: ${ user } , with groups:` , realGroups ) ;
139
143
140
144
return cb ( null , realGroups ) ;
@@ -201,7 +205,8 @@ export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
201
205
return cb ( null , true ) ;
202
206
} else {
203
207
this . logger . debug ( `[gitlab] user: ${ user . name || '' } denied from publishing package: ${ _package . name } ` ) ;
204
- const missingPerm = _package . name ?? _package . name . indexOf ( '@' ) === 0 ? 'package-scope' : 'package-name' ;
208
+ // @ts -ignore
209
+ const missingPerm = _package . name . indexOf ( '@' ) === 0 ? 'package-scope' : 'package-name' ;
205
210
return cb ( getForbidden ( `must have required permissions: ${ this . publishLevel || '' } at ${ missingPerm } ` ) ) ;
206
211
}
207
212
}
0 commit comments