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: HTTPS server skeleton #6

Merged
merged 19 commits into from
Apr 18, 2024
Merged

feat: HTTPS server skeleton #6

merged 19 commits into from
Apr 18, 2024

Conversation

kayra1
Copy link
Contributor

@kayra1 kayra1 commented Apr 4, 2024

Description

This change introduces some helper functions and initialization code to have a barebones https server up with external private key and certificates.

This PR is introducing:

  • The setup functionality for a net/http webserver,
  • The logic to load a user provided certificate to the webserver,
  • Tests to validate the behaviour of all of these features,
  • Command line options that will be useful in production.

The command line for GoCert accepts 1 mandatory argument:

  • --config receives the path for a YAML file that describes the following variables:
    • KeyPath is the path for a private key of a x.509 certificate,
    • CertPath is the path for a x.509 certificate,
    • DBPath is the path for a file for SQLite to use,
    • Port is an integer for which port the service will be deployed in,

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that validate the behaviour of the software
  • I validated that new and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@kayra1 kayra1 marked this pull request as ready for review April 5, 2024 11:47
@kayra1 kayra1 requested a review from a team as a code owner April 5, 2024 11:47
@kayra1
Copy link
Contributor Author

kayra1 commented Apr 5, 2024

I've tried to be consistent with capitalization in errors and specifying RSA private key instead of just private key, but I may have slipped somewhere. Please let me know if you see any inconsistencies.

cmd/gocert/main_test.go Outdated Show resolved Hide resolved
cmd/gocert/main.go Outdated Show resolved Hide resolved
api/server.go Outdated Show resolved Hide resolved
api/server.go Outdated Show resolved Hide resolved
api/server.go Outdated Show resolved Hide resolved
api/server.go Outdated Show resolved Hide resolved
api/server.go Outdated Show resolved Hide resolved
cmd/gocert/main.go Outdated Show resolved Hide resolved
internal/certificates/certificates.go Outdated Show resolved Hide resolved
internal/certificates/certificates.go Outdated Show resolved Hide resolved
internal/certificates/certificates.go Outdated Show resolved Hide resolved
internal/certificates/certificates.go Outdated Show resolved Hide resolved
internal/certificates/certificates.go Outdated Show resolved Hide resolved
api/server.go Show resolved Hide resolved
api/server.go Outdated Show resolved Hide resolved
@kayra1 kayra1 requested a review from gruyaume April 15, 2024 15:21
Copy link
Collaborator

@gruyaume gruyaume left a comment

Choose a reason for hiding this comment

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

looks good, make sure the pr description matches with its newer content. Here I'm referring to the fact we don't generate certs anymore.

api/server.go Outdated Show resolved Hide resolved
@kayra1 kayra1 merged commit bd0a096 into main Apr 18, 2024
9 checks passed
@kayra1 kayra1 deleted the api-starter branch April 18, 2024 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants