File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -558,10 +558,21 @@ const generateToken = (
558558 audience : string ,
559559 access : Access [ ] ,
560560) : string => {
561+ const payloadAccess =
562+ subject === 'admin'
563+ ? [
564+ {
565+ type : 'registry' ,
566+ class : '' ,
567+ name : 'catalog' ,
568+ actions : [ '*' ] ,
569+ } ,
570+ ]
571+ : access ;
561572 const payload = {
562573 jti : randomUUID ( ) ,
563574 nbf : Math . floor ( Date . now ( ) / 1000 ) - 10 ,
564- access,
575+ access : payloadAccess ,
565576 } ;
566577 const options = {
567578 algorithm : CERT . algo ,
@@ -571,6 +582,8 @@ const generateToken = (
571582 expiresIn : REGISTRY_TOKEN_EXPIRY_SECONDS ,
572583 keyid : CERT . kid ,
573584 } ;
585+ console . error ( '=== payload:' , JSON . stringify ( payload , null , 2 ) ) ;
586+ console . error ( '=== options:' , JSON . stringify ( options , null , 2 ) ) ;
574587 return jsonwebtoken . sign ( payload , CERT . key , options ) ;
575588} ;
576589
You can’t perform that action at this time.
0 commit comments