Ross Coundon
04/19/2021, 8:08 PMAuthorization type is set to NONE which is different from what is required by the authorizer [CUSTOM]
My definition looks like this:
const api = new ApiGatewayV1Api(this, 'CustFeedbackApi', {
defaultAuthorizer: authorizer,
routes: {
'POST /save': {
function: 'src/handler/saveFeedbackHandler.handleSaveFeedback',
methodOptions: {
authorizationType: AuthorizationType.NONE,
},
},
'GET /retrieve': {
function:
'src/handler/retrieveFeedbackHandler.handleRetrieveFeedback',
methodOptions: {
authorizationType: AuthorizationType.CUSTOM,
},
},
},
});
So, how do I set auth for one route but not another?Frank
Ross Coundon
04/19/2021, 8:10 PMFrank
Frank
Ross Coundon
04/19/2021, 8:15 PMRoss Coundon
04/19/2021, 8:15 PMFrank
const api = new ApiGatewayV1Api(this, 'CustFeedbackApi', {
routes: {
'POST /save': {
function: 'src/handler/saveFeedbackHandler.handleSaveFeedback',
methodOptions: {
authorizationType: AuthorizationType.NONE,
},
},
'GET /retrieve': {
function:
'src/handler/retrieveFeedbackHandler.handleRetrieveFeedback',
methodOptions: {
authorizer: authorizer,
authorizationType: AuthorizationType.CUSTOM,
},
},
},
});
Frank
defaultAuthorizer
into the methodOptions
of the route that needs it, u can workaround it for nowFrank
Ross Coundon
04/19/2021, 8:19 PMError: There is already a Construct with name 'GET' in Resource [retrieve]
Ross Coundon
04/19/2021, 8:19 PMRoss Coundon
04/19/2021, 8:20 PMFrank