@@ -53,6 +53,7 @@ export interface VerdaccioGitLabPlugin extends IPluginAuth<VerdaccioGitlabConfig
5353export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
5454 options : PluginOptions < VerdaccioGitlabConfig > ;
5555 config : VerdaccioGitlabConfig ;
56+ // @ts -ignore
5657 authCache : AuthCache ;
5758 logger : Logger ;
5859 publishLevel : VerdaccioGitlabAccessLevel ;
@@ -93,6 +94,7 @@ export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
9394 // Try to find the user groups in the cache
9495 const cachedUserGroups = this . _getCachedUserGroups ( user , password ) ;
9596 if ( cachedUserGroups ) {
97+ // @ts -ignore
9698 this . logger . debug ( `[gitlab] user: ${ user } found in cache, authenticated with groups:` , cachedUserGroups ) ;
9799 return cb ( null , cachedUserGroups . publish ) ;
98100 }
@@ -120,6 +122,7 @@ export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
120122 // - for access, depending on the package settings in verdaccio
121123 // - for publish, the logged in user id and all the groups they can reach as fixed `$auth.gitlab.publish` = `$owner`
122124 const gitlabPublishQueryParams = this . config . legacy_mode ? { owned : true } : { min_access_level : publishLevelId } ;
125+ // @ts -ignore
123126 this . logger . trace ( '[gitlab] querying gitlab user groups with params:' , gitlabPublishQueryParams ) ;
124127
125128 const groupsPromise = GitlabAPI . Groups . all ( gitlabPublishQueryParams ) . then ( groups => {
@@ -135,6 +138,7 @@ export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
135138 this . _setCachedUserGroups ( user , password , { publish : realGroups } ) ;
136139
137140 this . logger . info ( `[gitlab] user: ${ user } successfully authenticated` ) ;
141+ // @ts -ignore
138142 this . logger . debug ( `[gitlab] user: ${ user } , with groups:` , realGroups ) ;
139143
140144 return cb ( null , realGroups ) ;
@@ -201,7 +205,8 @@ export default class VerdaccioGitLab implements VerdaccioGitLabPlugin {
201205 return cb ( null , true ) ;
202206 } else {
203207 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' ;
205210 return cb ( getForbidden ( `must have required permissions: ${ this . publishLevel || '' } at ${ missingPerm } ` ) ) ;
206211 }
207212 }
0 commit comments