Go JavaScript CSS HTML Python Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Godeps
acceptance
api
bin
config
datastore
docs
feature
hooks
manager
memstore
models
oauth
policy
security
services
tasks
utils
web
.deployment.json
.dockerignore
.editorconfig
.gitignore
.goreman
.sample.env
Dockerfile
LICENSE
Procfile
README.md
main.go

README.md

Space

A user management microservice; OAuth 2 provider

Space (formely known as Jupiter) is an user authentication and authorisation microservice intended to be used across multiple client applications. Currently, I'm using it to provide OAuth 2 authorisation for the earaujoassis/wallet and earaujoassis/postal projects. Though it is not intended to be used widely, it can be used as a reference implementation of a Go-based OAuth 2 provider.

I'm using Gin as the Web Framework and GORM for Go's structures–relational design mapping. Redis is used as a memory store to keep track of users' atomic and ephemeral actions (like the whole authorisation process under the "Authorization Code Grant" method, described in RFC 6749, section 4.1). For the authentication process, it is mandatory to use Two-factor authentication (Time-based One-time Password).

It is not planned to implement all authorisation methods described in RFC 6749 but sections 4.1 and 4.3, the "Resource Owner Password Credentials Grant".

Setup and running

Please make sure to place this project inside the $GOPATH. Once that is done:

$ bin/dev-setup
$ goreman start
$ open http://localhost:8080

Testing

$ ENV=testing go test ./...

Deployment through a docker container

$ docker build -t earaujoassis/space .
$ docker run -d -p 8080:8080 earaujoassis/space
$ docker images --quiet --filter=dangling=true | xargs docker rmi

Issues

Please take a look at /issues

License

MIT License © Ewerton Assis