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

feature: allow preloaded certs with prefork #2351

Merged
merged 10 commits into from
Mar 6, 2023
Merged

Conversation

lublak
Copy link
Contributor

@lublak lublak commented Mar 1, 2023

Description

Currently I have a function that generates or loads these keys according to different conditions.
Now I would have to save them temporarily as a file to be able to use the full functions of fiber.
The added functions allow me to specify the already loaded keys.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • For new functionalities I follow the inspiration of the express js framework and built them similar in usage
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation - /docs/ directory for https://docs.gofiber.io/
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • If new dependencies exist, I have checked that they are really necessary and agreed with the maintainers/community (we want to have as few dependencies as possible)
  • I tried to make my code as fast as possible with as few allocations as possible
  • For new code I have written benchmarks so that they can be analyzed and improved

Commit formatting:

Oh! Its too late :c should i recreate my pull request?

@welcome
Copy link

welcome bot commented Mar 1, 2023

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@ReneWerner87 ReneWerner87 changed the title allow preloaded certs with prefork feature: allow preloaded certs with prefork Mar 1, 2023
Copy link
Member

@gaby gaby left a comment

Choose a reason for hiding this comment

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

Can you add unit-tests to the new exported functions?

listen.go Show resolved Hide resolved
@lublak
Copy link
Contributor Author

lublak commented Mar 1, 2023

Can you add unit-tests to the new exported functions?

does it make sense? I mean there are already unit tests for ListenMutualTLS and ListenTLS. And ListenMutualTLS/ListenTLS calls ListenMutualTLSWithCertificate/ListenTLSWithCertificate with already loaded file. If i create a unit test for ListenMutualTLSWithCertificate i just copy the content from ListenMutual to a unit test.

@lublak lublak requested a review from gaby March 1, 2023 15:08
@gaby
Copy link
Member

gaby commented Mar 1, 2023

I think having an exported function without tests will lower the coverage % 🤔

@lublak
Copy link
Contributor Author

lublak commented Mar 2, 2023

@gaby i created tests for it.
and true. Unit tests unfortunately do not know that it was actually already tested with other function.

Copy link
Member

@gaby gaby left a comment

Choose a reason for hiding this comment

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

LGTM

@ReneWerner87 ReneWerner87 merged commit 2e7e879 into gofiber:master Mar 6, 2023
@welcome
Copy link

welcome bot commented Mar 6, 2023

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

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.

3 participants