Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/davicho01/hash-app-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/davicho01/hash-app-go

  • v0.0.0-20220531133915-bf15b09194a1
  • Source
  • Go
  • Socket score

Version published
Created
Source

hash-app-go

Small App to Hash Passwords Technical Exercise

Assumptions

The following assumptions are being made:

  • Since the exercise clearly states that only standard libraries should be used, I am not using a database connection since that will require the use of external driver libraries. Otherwise, I would have used a DB to manage the password hashes
  • I'm also assuming that not web framework can be used.
  • I'm also assuming that all unit tests for this service will run through a CI/CD pipeline before being built and deployed.

Requirements

Go Tools

Follow the Download and Install instructions to get Go installed in your machine.

Setting and Running Project

Checkout project from Github

git clone https://github.com/davicho01/hash-app-go

Go to app directory inside project cd hash-app-go/app directory

Run go run main.go

Docker build

This project already comes integrate it with dockerfile. To build docker please install docker on your machine

To build and run docker container:

Go to director hash-app-go

Build container docker build -t hash-app-go .

Run container docker run --rm -it -p 8080:8080 hash-app-go

Unit Testing

To run all Unit test:

Go to hash-app-go/app directory

Run go test ./tests/... -v

Testing API

Following is a list of endpoints that can be used to test this application.

Post password
curl --location --request POST 'http://localhost:8080/hash' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'password=angryMonkey'
Get Hash
curl --location --request GET 'http://localhost:8080/hash/1'
Get Stats
curl --location --request GET 'http://localhost:8080/stats'
Shutdown
curl --location --request GET 'http://localhost:8080/shutdown'

FAQs

Package last updated on 31 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc