Skip to content

Commit

Permalink
more doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-johnson committed Mar 2, 2022
1 parent 8d2e603 commit f40fe5d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "restapi"
description = "A secure-by-default rest api stack implemented with hyper, tokio, bb8 and postgres. This project is focused on providing end-to-end encryption by default for 12-factor applications looking to customize functionality using environment variables as needed. Includes a working user management and authentication backend written in postgresql with async S3 uploading for POST-ed data files."
version = "1.0.8"
version = "1.0.9"
edition = "2021"
license = "MIT"
authors = [
Expand Down
23 changes: 16 additions & 7 deletions src/jwt/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// export TOKEN_EXPIRATION_SECONDS_INTO_FUTURE=86400;
/// ```
///
/// ### Token Encryption Keys
/// ### JWT Signing Keys
///
/// ```bash
/// export TOKEN_ALGO_KEY_DIR="./jwt"
Expand Down Expand Up @@ -60,7 +60,7 @@ use jsonwebtoken::Validation;

/// TokenClaim
///
/// custom claim contained in the encrypted jwt
/// custom claim contained in the signed jwt
///
/// example:
/// <https://github.com/Keats/jsonwebtoken/blob/master/examples/validation.rs#L6-L11>
Expand Down Expand Up @@ -94,6 +94,14 @@ pub struct TokenClaim {
///
/// Ok([`TokenData`](jsonwebtoken::TokenData))
///
/// # Arguments
///
/// * `tracking_label` - `&str` - custom, unique identifier
/// * `token` - `&str` - custom, unique org identifier
/// * `uid` - `&str` - epoch time when the token expires
/// * `decoding_key_bytes` - `&[u8]` - jwt key
/// contents in bytes
///
/// # Errors
///
/// ## validate_token on Failure Returns
Expand Down Expand Up @@ -190,7 +198,7 @@ pub fn get_expiration_epoch_time(
/// get_token_org
///
/// wrapper for returning an env var `TOKEN_ORG`
/// that can change the encrypted jwt contents for a
/// that can change the signed jwt contents for a
/// custom organization name
///
/// v2 this should move into the server statics:
Expand Down Expand Up @@ -226,14 +234,15 @@ pub fn get_token_expiration_in_seconds()
/// create_token
///
/// create a [`TokenClaim`](crate::jwt::api::TokenClaim), and
/// encrypt the `TokenClaim` using the algorithm:
/// sign the it using the algorithm:
/// [`ES256`](jsonwebtoken::Algorithm)
///
/// # Arguments
///
/// * `tracking_label` - &str - logging label for the caller
/// * `uid` - &str - unique identifier for this application
/// * `encoding_key_bytes` - &[u8] - static jwt encryption key
/// * `tracking_label` - `&str` - logging label for the caller
/// * `uid` - `&str` - unique identifier for this application
/// * `encoding_key_bytes` - `&[u8]` - jwt key
/// contents in bytes
///
/// # Returns
///
Expand Down
2 changes: 1 addition & 1 deletion tests/integration-using-curl.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export TOKEN_EXPIRATION_SECONDS_INTO_FUTURE=604800;
export TOKEN_EXPIRATION_SECONDS_INTO_FUTURE=86400;
```

#### Token Encryption Keys
#### JWT Signing Keys

```bash
export TOKEN_ALGO_KEY_DIR="./jwt"
Expand Down

0 comments on commit f40fe5d

Please sign in to comment.