File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
lib/plugins/aws/package/compile/events/alb Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33const BbPromise = require ( 'bluebird' ) ;
4+ const _ = require ( 'lodash' ) ;
45
56const validate = require ( './lib/validate' ) ;
67const compileTargetGroups = require ( './lib/targetGroups' ) ;
@@ -30,6 +31,18 @@ class AwsCompileAlbEvents {
3031
3132 // TODO: Complete schema, see https://github.com/serverless/serverless/issues/8020
3233 this . serverless . configSchemaHandler . defineFunctionEvent ( 'aws' , 'alb' , { type : 'object' } ) ;
34+
35+ if (
36+ this . serverless . service . provider . name === 'aws' &&
37+ _ . values ( _ . get ( this . serverless . service . provider . alb , 'authorizers' ) || { } ) . some (
38+ ( { allowUnauthenticated } ) => allowUnauthenticated != null
39+ )
40+ ) {
41+ this . serverless . _logDeprecation (
42+ 'AWS_ALB_ALLOW_UNAUTHENTICATED' ,
43+ 'allowUnauthenticated is deprecated, use onUnauthenticatedRequest instead'
44+ ) ;
45+ }
3346 }
3447}
3548
Original file line number Diff line number Diff line change @@ -209,13 +209,6 @@ module.exports = {
209209 const hasAllowUnauthenticated = auth . allowUnauthenticated != null ;
210210 const hasOnUnauthenticatedRequest = auth . onUnauthenticatedRequest != null ;
211211
212- if ( hasAllowUnauthenticated ) {
213- this . serverless . _logDeprecation (
214- 'AWS_ALB_ALLOW_UNAUTHENTICATED' ,
215- 'allowUnauthenticated is deprecated, use onUnauthenticatedRequest instead'
216- ) ;
217- }
218-
219212 if ( hasAllowUnauthenticated && ! hasOnUnauthenticatedRequest ) {
220213 auth . onUnauthenticatedRequest = auth . allowUnauthenticated ? 'allow' : 'deny' ;
221214 } else {
You can’t perform that action at this time.
0 commit comments