Skip to content

Commit 6eb4940

Browse files
committed
Finilize authorizers enablement
1 parent ebaf2fd commit 6eb4940

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

lib/deploy/events/apiGateway/authorizers.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ const awsArnRegExs = require('../../../utils/arnRegularExpressions');
66

77
module.exports = {
88
compileAuthorizers() {
9-
console.log("*** compileAuthorizers")
109
this.pluginhttpValidated.events.forEach((event) => {
11-
console.log(event)
12-
13-
1410
if (event.http.authorizer && event.http.authorizer.arn) {
1511
const authorizer = event.http.authorizer;
1612
const authorizerProperties = {

lib/deploy/events/apiGateway/methods.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const BbPromise = require('bluebird');
44
const _ = require('lodash');
55
const awsArnRegExs = require('../../../utils/arnRegularExpressions');
66

7-
87
module.exports = {
98

109
compileMethods() {
@@ -19,7 +18,7 @@ module.exports = {
1918
Properties: {
2019
HttpMethod: event.http.method.toUpperCase(),
2120
RequestParameters: {},
22-
AuthorizationType: 'CUSTOM',
21+
AuthorizationType: 'NONE',
2322
ApiKeyRequired: Boolean(event.http.private),
2423
ResourceId: resourceId,
2524
RestApiId: this.provider.getApiGatewayRestApiId(),
@@ -184,8 +183,6 @@ module.exports = {
184183
},
185184

186185
getMethodAuthorization(http) {
187-
console.log('*** http')
188-
console.log(http)
189186
if (_.get(http, 'authorizer.type') === 'AWS_IAM') {
190187
return {
191188
Properties: {
@@ -203,17 +200,6 @@ module.exports = {
203200
},
204201
};
205202
}
206-
// if (http.authorizer && awsArnRegExs.lambdaArnExpr.test(http.authorizer)) {
207-
if (http.authorizer && typeof(http.authorizer) === 'string') {
208-
return {
209-
Properties: {
210-
AuthorizationType: 'CUSTOM',
211-
AuthorizerId: http.authorizer,
212-
ApiKeyRequired: true,
213-
// AuthorizerId: { Ref: http.authorizer } ,
214-
},
215-
};
216-
}
217203

218204
const authorizerLogicalId = this.provider.naming
219205
.getAuthorizerLogicalId(http.authorizer.name);

lib/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const compileIamRole = require('./deploy/stepFunctions/compileIamRole');
77
const httpValidate = require('./deploy/events/apiGateway/validate');
88
const httpResources = require('./deploy/events/apiGateway/resources');
99
const httpMethods = require('./deploy/events/apiGateway/methods');
10+
11+
// eslint-disable-next-line max-len
1012
const httpAuthorizers = require('serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/authorizers');
1113
const httpCors = require('./deploy/events/apiGateway/cors');
1214
const httpApiKeys = require('./deploy/events/apiGateway/apiKeys');
@@ -144,6 +146,7 @@ class ServerlessStepFunctions {
144146
process.exitCode = 1;
145147
});
146148
}
149+
147150
this.serverless.cli.consoleLog(result);
148151
return BbPromise.resolve();
149152
});

0 commit comments

Comments
 (0)