Crate dynamic_token

source ·

Structs§

  • Authentication options Only the API key is mandatory. By default a uuid is not validated, the random split characters are %., and max age or tolerance is 5 minutes (or 300000 milliseconds) NB: The random split characters (rand_char_str) may not include alphanumeric characters or underscores, as these would break other validation
  • Return type for the from_dyaamic_key() method This is a simple tuple struct with getter methods for age() milliseconds since the decoded timestamp uuid embedded UUID if available has_user() indicates whether valid UUID-like string is embedded status() The outcome showing where or if validation failed status_key() a human-readable snake-case key indicating the status

Enums§

  • Defines authentication status based on the first rule that fails validation If the decoded string cannot be parsed at all, the status will be None

Constants§

Functions§

  • base-64-decode with standard options
  • base-64-encode with standard options
  • Validate the dynamic key based on a shared API key, random characters, a timestamp and optional userID
  • Generate a time-sensitive dynamic key from a shared API key as defined in the options the current millisecond timestamp (encoded, split and injected) some random characters and an optional uuid that can be decoded and used for additional authentication