good morning!!!!

Skip to content
Snippets Groups Projects
Select Git revision
  • 2subs
  • master default protected
  • devel
  • copilot/fix-f4f37f1f-efcc-4cb4-9ff7-148964e37222
  • link-preview
  • twilio
  • fcm
  • cors
  • next
  • next-vc
  • vc
  • session-sub-race-dev
  • session-sub-race
  • etag
  • grpcfiles
  • postgres
  • sender
  • init-db-fix
  • fix/session-dispatch-msg-id
  • online
  • fix/encoded-string-quotes
  • v0.25.0-beta3
  • v0.24.7
  • v0.25.0-beta1
  • v0.24.6
  • v0.24.5
  • v0.24.4
  • v0.24.3
  • v0.24.2
  • v0.24.1
  • v0.24.0
  • v0.24.0-rc3
  • v0.24.0-rc2
  • v0.23.2
  • v0.23.1
  • v0.24.0-rc1
  • v0.23.0
  • v0.23.0-rc2
  • v0.23.0-rc1
  • v0.22.13
  • v0.22.12
41 results

keygen

  • Open with
  • Download source code
  • Download directory
  • Your workspaces

      A workspace is a virtual sandbox environment for your code in GitLab.

      No agents available to create workspaces. Please consult Workspaces documentation for troubleshooting.

  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Name Last commit Last update
    ..
    README.md
    keygen.go

    keygen: API key generator

    A command-line utility to generate an API key for Tinode server

    Parameters:

    • sequence: Sequential number of the API key. This value can be used to reject previously issued keys.
    • isroot: Currently unused. Intended to designate key of a system administrator.
    • validate: Key to validate: check previously issued key for validity.
    • salt: HMAC salt, 32 random bytes base64 standard encoded; must be present for key validation; optional when generating the key: if missing, a cryptographically-strong salt will be automatically generated.

    Usage

    The API key is used to provide some protection from automatic scraping of server API and for identification of client applications.

    • API key is used on the client side.
    • HMAC salt is used on the server side to verify the API key.

    Run the generator:

    ./keygen

    Sample output:

    API key v1 seq1 [ordinary]: AQAAAAABAACGOIyP2vh5avSff5oVvMpk
    HMAC salt: TC0Jzr8f28kAspXrb4UYccJUJ63b7CSA16n1qMxxGpw=

    Copy HMAC salt to api_key_salt parameter in your server config file. Copy API key to the client applications:

    Rebuild the clients after changing the API key.