Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(AWS API Gateway): Fix schema for apiKeys and permissionsBoundary #9489

Merged

Conversation

lyndoh
Copy link
Contributor

@lyndoh lyndoh commented May 17, 2021

Updates schema to match existing implementation.
There was an existing test that already covered the apiKeys implementation which I refactored to use runServerless so that the schema is checked as well. I also added an extra test case to this for the case where neither name or value is provided, which were previously required fields in the schema (but not in the implementation).

Closes: #9080

@codecov
Copy link

codecov bot commented May 17, 2021

Codecov Report

Merging #9489 (973f888) into master (2aaf7e6) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #9489   +/-   ##
=======================================
  Coverage   86.81%   86.81%           
=======================================
  Files         328      328           
  Lines       12029    12029           
=======================================
  Hits        10443    10443           
  Misses       1586     1586           
Impacted Files Coverage Δ
lib/plugins/aws/provider.js 93.75% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2aaf7e6...973f888. Read the comment docs.

Copy link
Contributor

@pgrzesik pgrzesik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @lyndoh 👏 I only have one minor suggestion and we should be good to go 👍

@@ -135,101 +136,79 @@ describe('#compileApiKeys()', () => {
).to.equal('ApiGatewayDeploymentTest');
});
});
});

describe('lib/plugins/aws/package/compile/events/apiGateway/lib/apiKeys.test.js', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this out to a separate top-level describe block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pgrzesik

I'm a bit confused, I think the describe('lib/plugins/aws/package/compile/events/apiGateway/lib/apiKeys.test.js' ... is already at the top-level. Am I misunderstanding what you mean?

Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - when reviewing I somehow saw it as nested in the #compileApiKeys describe, it's all good 👍

@iPherian
Copy link

Closes #9440

Copy link
Contributor

@pgrzesik pgrzesik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done 👍

@pgrzesik pgrzesik changed the title Update config schema for apiKeys and permissionsBoundary fix(AWS API Gateway): Fix schema for apiKeys and permissionsBoundary May 18, 2021
@pgrzesik pgrzesik merged commit 5601025 into serverless:master May 18, 2021
@lyndoh lyndoh deleted the fix/9080-incorrect-configuration-warnings branch May 20, 2021 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect configuration warning for apiKeys object
3 participants