# README
Single Sign-On (SSO)
langs
Stack: Go, gRPC, SQLite, Docker
Project Structure:
├───cmd
├───config // Configurations
├───internal
│ ├───app // Application components integration
│ │ └───grpc // gRPC server application code
│ ├───config // Application config structure
│ ├───domain
│ │ └───models // Shared structures
│ ├───service // Service layer
│ │ ├───acs
│ ├───storage // Data storage layer
│ │ └───postgres
│ ├───transport // Data transport layer
│ │ └───grpc
│ │ ├───acs // Files for working with roles/permissions
├───migrations // Migration files
└───tests // Tests
Installation, Building, and Running:
Prerequisites:
- go compiler 1.21.5
- git
- Docker
- make
- Postman
Steps:
- Clone the repository:
git clone https://github.com/puregrade-group/sso ./my/favorite/dir
- Install dependencies:
go mod download
- Create the database and populate tables:
make mgrs-up
orgo run ./cmd/migrator/main.go --storage-path=storage/sso.db --migrations-path=migrations
- For testing, populate the necessary test data:
make test-mgrs-up
orgo run ./cmd/migrator/main.go --storage-path="./storage/sso.db" --migrations-path="./tests/migrations" --migrations-table="test"
- Run the application:
make run
orgo run ./cmd/main.go --config=./config/config.yaml
- To test the functionality, you can run the tests using
go test
, send requests through Postman, or write your own client for this application. To do this, you will need to refer to https://github.com/puregrade-group/protos and find the .proto files there for Postman or import the latest version of the generated files from this repository for your own client.
or
- Build the Docker image:
docker build --tag image-name .
- Run the container:
docker run -p 50051:50051/tcp --name container-name <image_id>
- Test the functionality.
Examples:
Application logs upon startup:
Output from Postman:
Output from tests: