Giter VIP home page Giter VIP logo

jcpassword's Introduction

Password hashing and encoding

Service to support requesting a password hash that can be retrieved on a separate http call.

Getting Started

  • Get the source with go get github.com/jakepearson/jcpassword
  • Run the service with go build main.go && main or go run main.go
    • The service should now be running on your machine. The endpoints are defined below.
  • To override the default port of 8080, set the PORT environment variable
  • All commits trigger a build job on CircleCI
  • If all tests pass, the source is pushed to Heroku for deployment to the production instance (https://jakepearson-password.herokuapp.com/)
  • Run the tests with go test ./...

Routes

  • /hash (POST): Request that a string is hashed with SHA512 and base64 encoded. To use, call to the endpoint with a body of the format password=<your-password>A HashID is returned that can be used to lookup the final result.
  • /hash/<HashID> (GET): Request for the final result of the hash and encode operation. If the operation is complete, a status code of 200 will be returned with the hashed and encoded string in the body of the response. If the operation is not yet complete, a status code of 400 (Bad request) will return with a message.
  • /shutdown (GET): Request for the service to shutdown. The service will stop accepting requests, complete any open requests, and finally shutdown the process after 5 seconds.
  • /metrics (GET): Request for simple metrics about the service. Returns a json string with fields for total and average in milliseconds.

Future upgrades

  • Change /hash endpoint to return the full url or uri to get the hash instead of just an id
  • Replace in memory hash database with a DB that can survive restarts. We could then run multiple service instances and do rolling deploys
  • Replace homegrown metrics system with something like Prometheus
  • Switch from Heroku logging to a different SaaS service with better performance and search capabilities
  • Render output into JUnit format in CircleCI
  • Implement a Swagger document and UI to make the service easier to discover and understand

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.