@@ -64,7 +64,8 @@ describe('request authorizer tests', () => {
6464 } ,
6565
6666 {
67- description : 'should fail with an Unauthorized error' ,
67+ description :
68+ 'should fail with an Unauthorized error when identity source is explicitly not handled' ,
6869 expected : {
6970 error : 'Unauthorized' ,
7071 message : 'Unauthorized' ,
@@ -78,6 +79,19 @@ describe('request authorizer tests', () => {
7879 path : '/user1-header' ,
7980 status : 401 ,
8081 } ,
82+
83+ {
84+ description :
85+ 'should fail with an Unauthorized error when identity source is not present on the request' ,
86+ expected : {
87+ error : 'Unauthorized' ,
88+ message : 'User is not authorized to access this resource' ,
89+ statusCode : 401 ,
90+ } ,
91+ options : { } ,
92+ path : '/user1-header' ,
93+ status : 401 ,
94+ } ,
8195 ] . forEach ( doTest )
8296 } )
8397
@@ -106,7 +120,8 @@ describe('request authorizer tests', () => {
106120 } ,
107121
108122 {
109- description : 'should fail with an Unauthorized error' ,
123+ description :
124+ 'should fail with an Unauthorized error when identity source is explicitly not handled' ,
110125 expected : {
111126 error : 'Unauthorized' ,
112127 message : 'Unauthorized' ,
@@ -116,6 +131,19 @@ describe('request authorizer tests', () => {
116131 path : '/user1-querystring?query1=fc3e55ea-e6ec-4bf2-94d2-06ae6efe6e5c' ,
117132 status : 401 ,
118133 } ,
134+
135+ {
136+ description :
137+ 'should fail with an Unauthorized error when identity source is not present on the request' ,
138+ expected : {
139+ error : 'Unauthorized' ,
140+ message : 'User is not authorized to access this resource' ,
141+ statusCode : 401 ,
142+ } ,
143+ options : { } ,
144+ path : '/user1-querystring' ,
145+ status : 401 ,
146+ } ,
119147 ] . forEach ( doTest )
120148 } )
121149
@@ -152,7 +180,8 @@ describe('request authorizer tests', () => {
152180 } ,
153181
154182 {
155- description : 'should fail with an Unauthorized error' ,
183+ description :
184+ 'should fail with an Unauthorized error when identity source is explicitly not handled' ,
156185 expected : {
157186 error : 'Unauthorized' ,
158187 message : 'Unauthorized' ,
@@ -166,6 +195,19 @@ describe('request authorizer tests', () => {
166195 path : '/user2-header' ,
167196 status : 401 ,
168197 } ,
198+
199+ {
200+ description :
201+ 'should fail with an Unauthorized error when identity source is not present on the request' ,
202+ expected : {
203+ error : 'Unauthorized' ,
204+ message : 'User is not authorized to access this resource' ,
205+ statusCode : 401 ,
206+ } ,
207+ options : { } ,
208+ path : '/user2-header' ,
209+ status : 401 ,
210+ } ,
169211 ] . forEach ( doTest )
170212 } )
171213
@@ -194,7 +236,8 @@ describe('request authorizer tests', () => {
194236 } ,
195237
196238 {
197- description : 'should fail with an Unauthorized error' ,
239+ description :
240+ 'should fail with an Unauthorized error when identity source is explicitly not handled' ,
198241 expected : {
199242 error : 'Unauthorized' ,
200243 message : 'Unauthorized' ,
@@ -204,6 +247,19 @@ describe('request authorizer tests', () => {
204247 path : '/user2-querystring?query2=fc3e55ea-e6ec-4bf2-94d2-06ae6efe6e5c' ,
205248 status : 401 ,
206249 } ,
250+
251+ {
252+ description :
253+ 'should fail with an Unauthorized error when identity source is not present on the request' ,
254+ expected : {
255+ error : 'Unauthorized' ,
256+ message : 'User is not authorized to access this resource' ,
257+ statusCode : 401 ,
258+ } ,
259+ options : { } ,
260+ path : '/user2-querystring' ,
261+ status : 401 ,
262+ } ,
207263 ] . forEach ( doTest )
208264 } )
209265
@@ -240,7 +296,8 @@ describe('request authorizer tests', () => {
240296 } ,
241297
242298 {
243- description : 'should fail with an Unauthorized error' ,
299+ description :
300+ 'should fail with an Unauthorized error when identity source is explicitly not handled' ,
244301 expected : {
245302 error : 'Unauthorized' ,
246303 message : 'Unauthorized' ,
@@ -254,6 +311,19 @@ describe('request authorizer tests', () => {
254311 path : '/user2simple-header' ,
255312 status : 401 ,
256313 } ,
314+
315+ {
316+ description :
317+ 'should fail with an Unauthorized error when identity source is not present on the request' ,
318+ expected : {
319+ error : 'Unauthorized' ,
320+ message : 'User is not authorized to access this resource' ,
321+ statusCode : 401 ,
322+ } ,
323+ options : { } ,
324+ path : '/user2simple-header' ,
325+ status : 401 ,
326+ } ,
257327 ] . forEach ( doTest )
258328 } )
259329
@@ -282,7 +352,8 @@ describe('request authorizer tests', () => {
282352 } ,
283353
284354 {
285- description : 'should fail with an Unauthorized error' ,
355+ description :
356+ 'should fail with an Unauthorized error when identity source is explicitly not handled' ,
286357 expected : {
287358 error : 'Unauthorized' ,
288359 message : 'Unauthorized' ,
@@ -292,6 +363,19 @@ describe('request authorizer tests', () => {
292363 path : '/user2simple-querystring?query2simple=fc3e55ea-e6ec-4bf2-94d2-06ae6efe6e5c' ,
293364 status : 401 ,
294365 } ,
366+
367+ {
368+ description :
369+ 'should fail with an Unauthorized error when identity source is not present on the request' ,
370+ expected : {
371+ error : 'Unauthorized' ,
372+ message : 'User is not authorized to access this resource' ,
373+ statusCode : 401 ,
374+ } ,
375+ options : { } ,
376+ path : '/user2simple-querystring' ,
377+ status : 401 ,
378+ } ,
295379 ] . forEach ( doTest )
296380 } )
297381} )
0 commit comments