Code Monkey home page Code Monkey logo

go-aipetto-oauth-api's Introduction

AIPetto OAuth

Service responsible for handling OAuthentication.

User API

{
    "email": "[email protected]",
    "password": "123abc"
}

OAuth API:
{
    "grant_type": "password",
    "username": "[email protected]",
    "password": "123abc"
}

{
    "grant_type": "client_credentials",
    "client_id": "id-123",
    "client_secret": "secret-123"
}

Run using Docker and docker-compose

sudo docker-compose up --build
sudo docker-compose up -d (daemon mode)
sudo docker-compose up --remove-orphans

Running tests

cd src/domain/access_token
go test 
go test --cover

Cassandra DB

The docker exec command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your cassandra container:

docker exec -it go-oauth-cassandra-db bash
cqlsh

The Cassandra Server log is available through Docker's container log:

docker logs go-oauth-cassandra-db

Inside Cassandra:

describe keyspaces;
CREATE KEYSPACE oauth WITH REPLICATION = {'class':'SimpleStrategy','replication_factor':1}
describe keyspaces;
USE oauth;
CREATE TABLE access_token(access_token varchar PRIMARY KEY, user_id bigint, client_id bigint, expires bigint);
SELECT * FROM access_token where access_token='example';

Troubleshoot & useful commands

go mod tidy ---> https://blog.golang.org/using-go-modules
The go mod tidy command cleans up these unused dependencies:

go mod init github.com/aipetto/go-aipetto-users-api
go clean -modcache

TODO

-[ ] Check Cassandra settings, message on local logs:

go-oauth-cassandra-db | WARN  [main] 2021-01-31 02:54:59,864 StartupChecks.java:311 - Maximum number of memory map areas per process (vm.max_map_count) 65530 is too low, recommended value: 1048575, you can change it with sysctl.
go-oauth-api exited with code 2

go-aipetto-oauth-api's People

Contributors

mrjhonyvidal avatar

Watchers

 avatar

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.