GithubHelp home page GithubHelp logo

cv65kr / authorization-service Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 510 KB

Authorization service based on Spring

License: MIT License

Dockerfile 0.64% Shell 1.39% Makefile 2.24% Java 73.00% Gherkin 22.73%
spring docker mongodb redis oauth2-server microservice bdd tdd

authorization-service's Introduction

Authorization service

CI

Simple open source Authorization microservice. This service is used for user authorization as well as for secure machine-to-machine communication inside a perimeter. Uses Redis for token and MongoDB for user account data keeping. The highest quality of code, strong testing culture. Supported with Java 8, 12, 13.

Infrastructure schema

How use

Every make command have available env parameter.

Running

To run service in production mode, just use

make env=prod start

service will be available on 0.0.0.0:4000 address.

Developing

To start developing, just use

make start

then go to IntelliJ and follow the instructions below

  1. Go to Run/debug configurations and find AuthServiceApplication
  2. Set VM options -Dspring.profiles.active=dev
  3. Paste Enviroment variables from .env file
  4. Save and click play button

IntelliJ configuration

Create server client

To create client eg. for connect with another services, run:

make client='account-service' secret='$$2y$$12$$1Xf4lvYLDxYFfJTteebdAuRo4lxrQ1uj1tuhBdDeOPaQstYevfG8u' grants='client_credentials,refresh_token' scopes='server' client

Secret must be encoded in bcrypt and escaped.

Endpoints

Method Path Description
GET /users/current Get current user data
POST /users Create new user

Tests

To run all test just use

make test

Help

make help
start                          Clean current environment, recreate dependencies and spin up again
stop                           Stop environment
rebuild                        Same as start
erase                          Stop and delete containers, clean volumes.
build                          Build environment
up                             Spin up environment
ps                             Show containers list
package                        Maven package
test                           Run tests
logs                           Look for 's' service logs, make s=auth-service logs
client                         Create client, available arguments client,secret,grants,scopes
help                           Display this help message

Contributions are welcome!

Authorization service is open source, and would greatly appreciate your help. Feel free to suggest and implement improvements.

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.