Logo designed by SAST, created by Maxtune Lee.
SAST Link is a comprehensive personnel management system and OAuth designed to provide a secure and efficient way to manage and authorize access to your applications and services.
Product design in Figma: SAST Link, designed by Maxtune Lee
This repository contains the backend code for SAST Link. If you're interested in the frontend, please visit SAST Link frontend.
SAST Link backend is built with Go and PostgreSQL, and use gin as the web framework.
Warning
This repo is under active development! Formats, schemas, and APIs are subject to rapid and backward incompatible changes!
- Go
- PostgreSQL
- Redis
- Email Account (SMTP)
- Tencent COS (For file storage)
- Oauth2.0 Provider (e.g. GitHub, Feishu)
Create PostgreSQL database and tables by running the SQL scripts in sql/
directory.
Clone the repository and navigate to the project directory:
git clone https://github.com/NJUPT-SAST/sast-link-backend.git && cd sast-link-backend
Create a configuration file based on src/config/example.toml
and provide appropriate configurations for your environment.
Start the services using Docker Compose:
docker-compose up --detach
[+] Running 3/3
✔ Container sast-link-backend-redis-1 Healthy 0.0s
✔ Container sast-link-backend-postgres-1 Heal... 0.0s
✔ Container sast-link-backend-sast-link-backend-1 Started 0.0s
These commands will build and start services listed in the compose file:
- configuration and start postgreSQL
- configuration and start redis
- start SAST Link
The PostgreSQL and Redis services are required for the SAST Link service to run.
The .env
file contains the environment variables for the SAST Link service:
POSTGRES_DB=sastlink
POSTGRES_USER=sastlink
POSTGRES_PASSWORD=sastlink
REDIS_PASSWORD=sastlink
CONFIG_FILE=dev-example
The CONFIG_FILE
environment variable is used to specify the configuration file for the SAST Link service.
The POSTGRES_DB
, POSTGRES_USER
, POSTGRES_PASSWORD
, and REDIS_PASSWORD
environment variables are used to initialize the postgreSQL and redis services.
The API documentation is available at wiki
The database schema is available at wiki
The code workflow is available at wiki
Goals and Vision for SAST Link (SAST OAuth and SAST Profile):
SAST OAuth:
SAST OAuth serves as a unified identity authentication system for SAST, facilitating login across multiple SAST applications.
Example:
- Simplifies login processes for SAST members across various projects, such as the FreshCup competition.
- Enables seamless login via SAST credentials without the need for separate accounts for each project.
- Allows SAST lecturers to access and manage the FreshCup competition system for tasks like grading via SAST login.
- Offers multiple login options including SAST Feishu, PassKey, QQ, Github, etc., providing users with convenience and flexibility.
- Implements additional security measures like F2A and security keys to enhance account security.
In login process, users can choose to log in in multiple ways: SAST Feishu, PassKey, QQ, Github, etc. As long as they have been bound in advance, they can use third-party login, which is convenient and fast. They can also use F2A, security keys, and other methods to enhance account security.
SAST Profile:
SAST Profile acts as a centralized user profile system for managing user information and settings within SAST applications.
Features:
- Records basic user information such as SAST membership status, current position, department, group affiliation, etc.
- Tracks user activities within SAST, including competition results, awards, and permissions across various applications.
- Provides users with the ability to customize and share their profile page, allowing them to control the visibility of their information.
Current status:
- User Management (Basic)
- SAST OAuth (Basic)
- File Storage (Tencent COS)
- SAST Profile (Basic)
- SAST Link management
- Third-party OAuth (Github and Feishu now can be used in backend, but not fully implemente)
- CI/CD, Docker, and Kubernetes support
Pull requests and any feedback are welcome. For major changes, please open an issue first to discuss what you would like to change.