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

feat(event_handler): mutualTLS Security Scheme for OpenAPI #5484

Merged

Conversation

Sector95
Copy link
Contributor

Issue number: #5483

Summary

Changes

The OpenAPI 3.1 spec supports mutualTLS as an additional security scheme, this PR adds the relevant models and documentation to enable support of that scheme in the framework.

User experience

Currently there is no easy way to specify an mTLS security scheme using the framework. This change would enable a user to specify it in the same as other schemes, like OAuth2 and HTTPBearer types.

app = APIGatewayRestResolver(enable_validation=True)
app.enable_swagger(
    security_schemes={
        'mTLS': MutualTLS(description='mTLS Authentication')
    }
)

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@Sector95 Sector95 requested a review from a team as a code owner October 31, 2024 20:19
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation event_handlers labels Oct 31, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 31, 2024
Copy link

boring-cyborg bot commented Oct 31, 2024

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@github-actions github-actions bot added feature New feature or functionality and removed documentation Improvements or additions to documentation labels Nov 1, 2024
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.16%. Comparing base (3988469) to head (13edad9).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5484   +/-   ##
========================================
  Coverage    96.15%   96.16%           
========================================
  Files          229      229           
  Lines        10807    10810    +3     
  Branches      2007     2007           
========================================
+ Hits         10392    10395    +3     
  Misses         327      327           
  Partials        88       88           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Nov 1, 2024
@leandrodamascena leandrodamascena linked an issue Nov 6, 2024 that may be closed by this pull request
2 tasks
@leandrodamascena leandrodamascena changed the title feat: mutualTLS Security Scheme for OpenAPI feat(event_handler): mutualTLS Security Scheme for OpenAPI Nov 6, 2024
@boring-cyborg boring-cyborg bot added the tests label Nov 6, 2024
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 6, 2024
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Nov 6, 2024
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Nov 6, 2024
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 6, 2024
Copy link

sonarqubecloud bot commented Nov 6, 2024

@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Nov 6, 2024
@leandrodamascena
Copy link
Contributor

Thanks a lot @Sector95! Approved!

@Sector95
Copy link
Contributor Author

Sector95 commented Nov 6, 2024

Thanks a lot @Sector95! Approved!

No problem! Looks like it needs another reviewer since you committed to the branch though.

@leandrodamascena
Copy link
Contributor

Thanks a lot @Sector95! Approved!

No problem! Looks like it needs another reviewer since you committed to the branch though.

Yeah! @anafalcao will approve this soon!

Just to explain: I just added a new test to increase code coverage and make sure we're not missing anything. To be honest, it was just to control my OCD with tests lol.

@anafalcao anafalcao merged commit 5f6b0c8 into aws-powertools:develop Nov 6, 2024
16 checks passed
Copy link

boring-cyborg bot commented Nov 6, 2024

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event_handlers feature New feature or functionality size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: MutualTLS Security Scheme for OpenAPI
3 participants