-
Notifications
You must be signed in to change notification settings - Fork 197
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
Validate Server Key (#248) and docs (#368) #619
Conversation
For #248... - Created ServerKey module and associated tests - Added validation on server key size to startup - Updated session docs to use this module in examples For #368... - Added English-language documentaion for every parameter in SuaveConfig - Added examples for most basic configuration changes - Added "If you're looking to get started quickly" section, with links to common configuration changes
src/Suave/Http.fsi
Outdated
module ServerKey = | ||
|
||
/// Ensure that a server key is the proper length | ||
val create : byte [] -> ServerKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be better called validate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up until I sat down this morning to wrap this up, it literally was. :) I can change it back; my thought was that a byte []
is unknown, but a ServerKey
is a verified key. I know that the alias definition means that there's technically no difference between byte []
and ServerKey
. It also seemed that most of the modules have a create
function.
Let me know if you want me to change it; it's an easy fix.
It looks like the AppVeyor build failed for lack of a definition of |
I changed |
docs/api.md
Outdated
|
||
#### Changing the server's cryptography key | ||
|
||
Suave encrypts state stored in (sessions)[sessions.html], and the key used for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be [sessions](sessions.html)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops - nice catch. The fix has been committed.
Looks good to me 👍 |
This creates a
ServerKey
module that will "create" (from a byte array) with validation, or create a key from a base64-encoded string. On startup, the server runs the configured key through thecreate
function to ensure it is well-formed.This also documents every item in
SuaveConfig
, with examples for some commonly-modified parameters. There is also verbiage for newer users, pointing them to the three most common "newbie" use cases (changing the port, choosing the home directory, setting a server key).