Skip to main content

Crate webgates_secrets

Crate webgates_secrets 

Source
Expand description

§webgates-secrets

Secret and hashing primitives for webgates applications.

This crate provides the building blocks used to hash secrets, verify them, and bind stored hashed values to account identifiers.

§When to use this crate

Use webgates-secrets when you want:

  • the Secret value object for stored hashed credentials
  • the hashing module for hashing and verification primitives
  • the hashing::argon2::Argon2Hasher implementation with secure presets
  • structured secret and hashing error types

The crate is intentionally focused on the secret and hashing boundary. Storage and repository concerns live in sibling crates.

§Quick start

use webgates_core::verification_result::VerificationResult;
use webgates_secrets::hashing::argon2::Argon2Hasher;
use webgates_secrets::hashing::hashing_service::HashingService;

let hasher = Argon2Hasher::new_recommended().unwrap();
let hashed = hasher.hash_value("user_password").unwrap();
let result = hasher.verify_value("user_password", &hashed).unwrap();

assert_eq!(result, VerificationResult::Ok);

§Getting started on docs.rs

A good reading order is:

  1. hashing::hashing_service::HashingService
  2. hashing::argon2::Argon2Hasher
  3. hashing::HashedValue
  4. Secret
  5. errors and hashing::errors

Modules§

errors
Error types for secret-related operations.
hashing
Password hashing and verification APIs.

Structs§

Secret
A hashed secret bound to a single account identifier.

Type Aliases§

Result
Convenience result alias for secrets and hashing operations.