Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • Keel - LDH Middleware Keel - LDH Middleware
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 26
    • Issues 26
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libertyliberty
  • hosthost
  • Keel - LDH MiddlewareKeel - LDH Middleware
  • Issues
  • #67
Closed
Open
Issue created Feb 28, 2019 by David Seaward@david.seawardOwner

Generic user hash

Sometimes we need to generate our own hash value for a user. To implement this:

  • Add PEPPER as a system config value
  • Add salt as an attribute on the User model (populated when User object is created)
  • Add hash as a function on the User model:
def hash(input, hash_function="bcrypt"):
    if hash_function == "bcrypt":
        return bcrypt.hashpw(input, user.salt + system.PEPPER)
    else:
        throw UnknownFunctionError
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking