rainbow-oauth-api

module
v0.0.0-...-ee8eda9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2020 License: MIT

README

Rainbow OAuth API

Summary

I'm developing this project to learn GO and I'm new to GO.

I'm open to comments on how to make this code better. If you feel like helping and see something you believe I should change please open a new ISSUE, so we can discuss it :D

Rainbow OAuth API is a simple API Service to create, validate and refresh JWT tokens.

Features

  • Generate/Refresh/Validate Json Web Tokens
  • Health check endpoint
  • Policy-based control for cloud native environments made by Opa <3
  • API documented using 'openapi'

API

OpenAPI specification

OPA

Learn more about The Open Policy Agent

Infra to run this service

Service/Instance Container name Ports (dev mode) What for
Postgres postgres 5432 Save account
pgweb pgweb 8080 Postgres Web client
Opa opa 8181 Policy-based control

You can get more information on usernames and passwords on the docker-compose.yml file

Extra files

  • Policy-Base control made by 'deployments/opa/authz.rego'
  • The 'docs' folder contains the 'openapi' specification to Rainbow
  • The 'docs' folder contains a Postman collection to play with Rainbow's API

More

Clone Rainbow API git repository:

go get gitlab.com/rainbowproject/rainbow-oauth-api

Spin up the docker containers

make docker-compose-up

Build Rainbow API

make

Run Rainbow API

./bin/rainbow

Update 'openapi' specification

make openapi-update

Run swagger web-server

make openapi-run-server

Dependencies

Dependence Reason
jwt-go Generate and Verify JWTTokens
crypto Salting passwords
validator Validate JSON inputs
pg Interface to PostgreSQL Server
gorilla mux Gorilla Mux for routes
zerolog Logging system
godotenv Load .env files

Directories

Path Synopsis
cmd
internal
classification
Package classification Rainbow AUTH API RAINBOW-OAUTH-API the purpose of this microservice is to provide endpoints to create/validate and refresh json web tokens Host: localhost:3001 basePath: / Schemes: http, https Version: 0.0.1 License: MIT http://opensource.org/licenses/MIT Contact: Thiago Mendes<tzig@tutanota.de> https://gitlab.com/rainbowproject/ Consumes: - application/json Produces: - application/json SecurityDefinitions: Bearer: type: apiKey name: Authorization in: header description: | For accessing the API a valid JWT token must be passed in all the queries in the 'Authorization' header.
Package classification Rainbow AUTH API RAINBOW-OAUTH-API the purpose of this microservice is to provide endpoints to create/validate and refresh json web tokens Host: localhost:3001 basePath: / Schemes: http, https Version: 0.0.1 License: MIT http://opensource.org/licenses/MIT Contact: Thiago Mendes<tzig@tutanota.de> https://gitlab.com/rainbowproject/ Consumes: - application/json Produces: - application/json SecurityDefinitions: Bearer: type: apiKey name: Authorization in: header description: | For accessing the API a valid JWT token must be passed in all the queries in the 'Authorization' header.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL