Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/torniker/secret-server
https://github.com/torniker/secret-server
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/torniker/secret-server
- Owner: torniker
- Created: 2019-06-19T14:04:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-21T08:37:11.000Z (over 5 years ago)
- Last Synced: 2024-06-21T00:06:42.849Z (5 months ago)
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Secret Server Coding Task
## Introduction
Your task is to implement a secret server. The secret server can be used to store and share secrets
using the random generated URL. But the secret can be read only a limited number of times after that
it will expire and won’t be available. The secret may have TTL. After the expiration time the secret
won’t be available anymore. You can find the detailed API documentation in the swagger.yaml file.
We recommend to use [Swagger](https://editor.swagger.io/) or any other OpenAPI implementation to
read the documentation.## Task
**Implementation**: You have to implement the whole Secret Server API. If it is not specified you can choose the technology
you want to use (database, programming language, framework, etc). However it would be wise to store the data using encryption now this is not part of the task. You can use plain text to store your secrets.**Response types**
The API must be able to response with XML or JSON too, based on the [Accept header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept). Other response types (such as YAML) might be added later so prepare your code to be extandable.**Hosting**: You also have to deploy and host the service. There are plenty of free solutions to do this. So this shouldn't
be an issue. If this API was used in production, then HTTPS would be a must but this is not the case now. It is allowed to use HTTP too.**Share the code**: Upload the code to your GitHub account and share with us.
## Questions
It is totaly OK to ask if something is not clear.# Solution
## Setup
* Clone the repo
* cd into the dir
* Run: `export GOPATH=${pwd}`
* Run: `go get github.com/prometheus/client_golang/prometheus`
* Run: `go get github.com/prometheus/client_golang/prometheus/promauto`
* Run: `go get github.com/prometheus/client_golang/prometheus/promhttp`
* Run: `cd src/secret`
* Run: `go get ./...`
* Run: `cd ../../`
* Run: `go install secret`
* Run: `./bin/secret`