Skip to content

v1.0.0

Choose a tag to compare

@thewizardplusplus thewizardplusplus released this 10 May 11:52
· 31 commits to master since this release

The major version.

Features

  • use of patterns:
    • implementation based on Clean Architecture principles with separate use case layers for server and client;
    • input parsing and validation handled internally in the use cases (inputs are passed as raw DTOs);
    • relies on the library github.com/thewizardplusplus/go-pow for PoW algorithm implementation;
  • use cases:
    • server-side:
      • SignChallenge(): generate a message authentication code (MAC) signature for a challenge:
        • MAC signature generation uses a secret key and configurable hashing algorithm;
      • GenerateChallenge(): generate a challenge with specified parameters:
        • number of leading zero bits (hash difficulty);
        • current timestamp rounded to a configurable precision;
        • time to live (TTL);
        • target resource URI;
        • payload consisting of static and random parts;
        • hashing algorithm;
      • GenerateSignedChallenge(): generate a challenge and sign it;
      • VerifySolution(): verify the correctness of a PoW solution;
      • VerifySolutionAndChallengeSignature(): verify both PoW solution and challenge MAC signature;
    • client-side:
      • SolveChallenge(): solve a challenge using the PoW algorithm;
  • providers:
    • extensible provider interfaces for:
      • hash difficulty;
      • target resource URI;
      • static payload part;
    • built-in provider implementations:
      • constant value providers;
      • dynamic providers:
        • hash difficulty based on current server load (active request count);
        • target resource URI and static payload extracted from a context.