Age | Commit message (Collapse) | Author |
|
Collect values from the `HashMap` into a single string. Following the
example of the Aquatic Prime PHP and Ruby scripts.
Thanks to these Stack Overflow answers for explaining `into_iter()`:
https://stackoverflow.com/questions/32354947/type-issue-with-iterator-collect/32355408#32355408
https://stackoverflow.com/questions/32354947/type-issue-with-iterator-collect/32355169#32355169
Otherwise I was getting double string references (`(&&str, &&str)`) from
`iter()`.
In order to get the `&str` and `iter` references right, take an owned
`HashMap` argument instead of a reference as planned earlier. Makes it
simpler to manipulate the `&str`s inside.
|
|
The `sign()` method will take a `HashMap` and return a signed digest of
the map.
Replicated the test from the Ruby edition of Aquatic Prime:
https://github.com/bdrister/AquaticPrime/blob/ce892dc/Source/Ruby/lib/aquaticprime.rb
Copied the expected values in after running the script.
|
|
We'll use this new library crate to generate licenses in the Aquatic
Prime format. Planning on just porting the C code directly to Rust.
|
|
Building on the example from the 'fastcgi' crate:
https://docs.rs/fastcgi/1.0.0/fastcgi/index.html
prints all request parameters and the request `Stdin`. Post parameters
are included in the stdin buffer.
|
|
|
|
Generated with:
$ cargo new --bin license-generator
using
$ rustc --version
rustc 1.28.0 (9634041f0 2018-07-30)
This will be a FastCGI program to respond to a webhook from Paddle, and
respond with a generated license key file.
|