@@ -97,7 +97,7 @@ describe("operator scope authorization", () => {
9797 } ) ;
9898 } ) ;
9999
100- it . each ( [ "exec.approval.get" , "exec.approval.resolve" ] ) (
100+ it . each ( [ "exec.approval.get" , "exec.approval.list" , "exec.approval. resolve"] ) (
101101 "requires approvals scope for %s" ,
102102 ( method ) => {
103103 expect ( authorizeOperatorScopesForMethod ( method , [ "operator.write" ] ) ) . toEqual ( {
@@ -110,18 +110,20 @@ describe("operator scope authorization", () => {
110110 } ,
111111 ) ;
112112
113- it . each ( [ "plugin.approval.request" , "plugin.approval.waitDecision" , "plugin.approval.resolve" ] ) (
114- "requires approvals scope for %s" ,
115- ( method ) => {
116- expect ( authorizeOperatorScopesForMethod ( method , [ "operator.write" ] ) ) . toEqual ( {
117- allowed : false ,
118- missingScope : "operator.approvals" ,
119- } ) ;
120- expect ( authorizeOperatorScopesForMethod ( method , [ "operator.approvals" ] ) ) . toEqual ( {
121- allowed : true ,
122- } ) ;
123- } ,
124- ) ;
113+ it . each ( [
114+ "plugin.approval.list" ,
115+ "plugin.approval.request" ,
116+ "plugin.approval.waitDecision" ,
117+ "plugin.approval.resolve" ,
118+ ] ) ( "requires approvals scope for %s" , ( method ) => {
119+ expect ( authorizeOperatorScopesForMethod ( method , [ "operator.write" ] ) ) . toEqual ( {
120+ allowed : false ,
121+ missingScope : "operator.approvals" ,
122+ } ) ;
123+ expect ( authorizeOperatorScopesForMethod ( method , [ "operator.approvals" ] ) ) . toEqual ( {
124+ allowed : true ,
125+ } ) ;
126+ } ) ;
125127
126128 it ( "requires admin for unknown methods" , ( ) => {
127129 expect ( authorizeOperatorScopesForMethod ( "unknown.method" , [ "operator.read" ] ) ) . toEqual ( {
@@ -145,12 +147,14 @@ describe("operator scope authorization", () => {
145147describe ( "plugin approval method registration" , ( ) => {
146148 it ( "lists all plugin approval methods" , ( ) => {
147149 const methods = listGatewayMethods ( ) ;
150+ expect ( methods ) . toContain ( "plugin.approval.list" ) ;
148151 expect ( methods ) . toContain ( "plugin.approval.request" ) ;
149152 expect ( methods ) . toContain ( "plugin.approval.waitDecision" ) ;
150153 expect ( methods ) . toContain ( "plugin.approval.resolve" ) ;
151154 } ) ;
152155
153156 it ( "classifies plugin approval methods" , ( ) => {
157+ expect ( isGatewayMethodClassified ( "plugin.approval.list" ) ) . toBe ( true ) ;
154158 expect ( isGatewayMethodClassified ( "plugin.approval.request" ) ) . toBe ( true ) ;
155159 expect ( isGatewayMethodClassified ( "plugin.approval.waitDecision" ) ) . toBe ( true ) ;
156160 expect ( isGatewayMethodClassified ( "plugin.approval.resolve" ) ) . toBe ( true ) ;
0 commit comments