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

Validate Server Key (#248) and docs (#368) #619

Merged
merged 5 commits into from
May 31, 2017
Merged

Validate Server Key (#248) and docs (#368) #619

merged 5 commits into from
May 31, 2017

Conversation

danieljsummers
Copy link
Contributor

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 the create 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).

Henrik Feldt and others added 3 commits May 29, 2017 11:15
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
module ServerKey =

/// Ensure that a server key is the proper length
val create : byte [] -> ServerKey
Copy link
Member

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 ?

Copy link
Contributor Author

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.

@danieljsummers
Copy link
Contributor Author

It looks like the AppVeyor build failed for lack of a definition of ApplicationException - is there something else I should be using? (of course it built and tested fine on "my machine"...)

@danieljsummers
Copy link
Contributor Author

I changed create to validate; I also update the docs and tests for that. I changed the ApplicationException raising to just use failwithf. Finally, I tweaked verbiage in the docs that was inaccurate given the eventual state of my prior PR.

docs/api.md Outdated

#### Changing the server's cryptography key

Suave encrypts state stored in (sessions)[sessions.html], and the key used for
Copy link
Contributor

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).

Copy link
Contributor Author

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.

@ademar
Copy link
Member

ademar commented May 31, 2017

Looks good to me 👍

@haf haf merged commit 24ebe0b into SuaveIO:master May 31, 2017
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.

4 participants