Shorten invitation codes.

[?]
Feb 9, 2021, 1:42 PM
UO66QO7K6PZ6M6T4WZYRAUOEQMJLHB6GURC2LI4VABZOUWGCOSWAC

Dependencies

  • [2] OVU272MT Create zcash account with recovery zaddr
  • [3] IR75ZMX3 Return actual events for interval ends, not just timestamps.
  • [4] XXJFUZOV Add first revenue date to project payout computation.
  • [5] NAS4BFL4 Trivial stylish-haskell reformat.
  • [6] HMDM3B55 Implement core of payments/billing infrastructure.
  • [7] M4PWY5RU Preliminary work to add support for Zcash payments.
  • [8] U7YAT2ZK Add error reporting to signup form.
  • [9] X3ES7NUA Fine. I'll use ormolu. At least it doesn't break the code.
  • [10] 4354Y4PE Add endpoint to list project contributors.
  • [11] 4R7XIYK3 Switch from ClassyPrelude to Relude
  • [12] HALRDT2F Added initial auction create route.

Change contents

  • replacement in client/Dockerfile at line 11
    [3.788][3.788:821]()
    libtinfo5 nodejs npm netbase
    [3.788]
    [3.821]
    libtinfo5 nodejs npm netbase git
  • replacement in lib/Aftok/Database/PostgreSQL/Projects.hs at line 32
    [3.48001][3.48001:48026]()
    InvitationCode (..),
    [3.48001]
    [3.48026]
    InvitationCode,
  • edit in lib/Aftok/Database/PostgreSQL/Users.hs at line 25
    [3.57723]
    [3.57723]
    pexec,
  • edit in lib/Aftok/Database/PostgreSQL/Users.hs at line 28
    [3.57748][2.6:17]()
    pexec,
  • replacement in lib/Aftok/Database/PostgreSQL/Users.hs at line 52
    [3.58313][2.18:35](),[2.35][3.58323:58403](),[3.58323][3.58323:58403]()
    uid <- pinsert
    UserId
    [sql| INSERT INTO users (handle, recovery_email, recovery_zaddr)
    [3.58313]
    [3.58403]
    uid <-
    pinsert
    UserId
    [sql| INSERT INTO users (handle, recovery_email, recovery_zaddr)
  • replacement in lib/Aftok/Database/PostgreSQL/Users.hs at line 57
    [3.58446][3.58446:58618](),[3.58618][2.36:42]()
    ( user' ^. (username . _UserName),
    user' ^? userAccountRecovery . _RecoverByEmail . _Email,
    user' ^? userAccountRecovery . _RecoverByZAddr . Zcash._Address
    )
    [3.58446]
    [2.42]
    ( user' ^. (username . _UserName),
    user' ^? userAccountRecovery . _RecoverByEmail . _Email,
    user' ^? userAccountRecovery . _RecoverByZAddr . Zcash._Address
    )
  • replacement in lib/Aftok/Database/PostgreSQL/Users.hs at line 68
    [2.260][2.260:355]()
    void $ pexec
    [sql| INSERT INTO cryptocurrency_accounts (user_id, is_primary, zcash_addr)
    [2.260]
    [2.355]
    void $
    pexec
    [sql| INSERT INTO cryptocurrency_accounts (user_id, is_primary, zcash_addr)
  • replacement in lib/Aftok/Database/PostgreSQL/Users.hs at line 72
    [2.385][2.385:448](),[2.448][3.58618:58624](),[3.58618][3.58618:58624]()
    ( uid ^. _UserId,
    True,
    addr ^. Zcash._Address
    )
    [2.385]
    [3.58624]
    ( uid ^. _UserId,
    True,
    addr ^. Zcash._Address
    )
  • edit in lib/Aftok/Database/PostgreSQL/Users.hs at line 77
    [3.58625][2.449:450]()
  • replacement in lib/Aftok/Project.hs at line 3
    [3.1069][3.1069:1096]()
    module Aftok.Project where
    [3.1069]
    [3.1096]
    module Aftok.Project
    ( Project (..),
    ProjectName,
    projectName,
    inceptionDate,
    initiator,
    depRules,
    InvitationCode,
    randomInvCode,
    parseInvCode,
    renderInvCode,
    Invitation (..),
    projectId,
    invitingUser,
    invitedEmail,
    invitationTime,
    acceptanceTime,
    )
    where
  • edit in lib/Aftok/Project.hs at line 32
    [3.49310][3.49310:49349]()
    import qualified Data.ByteString as BS
  • replacement in lib/Aftok/Project.hs at line 52
    [3.16114][3.16114:16167]()
    randomInvCode = InvitationCode <$> getRandomBytes 32
    [3.16114]
    [3.1849]
    randomInvCode = InvitationCode <$> getRandomBytes 12
  • replacement in lib/Aftok/Project.hs at line 55
    [3.90086][3.1903:1923](),[3.1903][3.1903:1923](),[3.1923][3.90087:90131](),[3.90131][3.3938:3964](),[3.1961][3.3938:3964](),[3.3964][3.1984:2076](),[3.1984][3.1984:2076]()
    parseInvCode t = do
    code <- B64.decodeBase64 . encodeUtf8 $ t
    if BS.length code == 32
    then Right $ InvitationCode code
    else Left "Invitation code appears to be invalid."
    [3.90086]
    [3.2076]
    parseInvCode t =
    InvitationCode <$> (B64.decodeBase64 . encodeUtf8 $ t)
  • replacement in lib/Aftok/Project.hs at line 59
    [3.2117][3.90132:90188]()
    renderInvCode (InvitationCode bs) = B64.encodeBase64 bs
    [3.2117]
    [3.2180]
    renderInvCode (InvitationCode bs) = B64.encodeBase64Unpadded bs