sast-link-backend

command module
v0.0.0-...-63192da Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

README

SAST Link Logo

Logo designed by SAST, created by Maxtune Lee.

Go Report Card License

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!

Getting Started

Pre-requisites
  • 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 and Run

To get started with SAST Link, follow these steps:

  1. Configuration: First, create a configuration file based on config/dev-example.toml. Ensure that you provide appropriate configurations for your environment.
  2. Environment Setup: Set up the environment variable CONFIG_FILE to specify the configuration file you've created.
  3. Installation and Execution:
git clone https://github.com/NJUPT-SAST/sast-link-backend.git && cd sast-link-backend
CONFIG_FILE=dev-example go run .

The server will listen port 8080, you can change it by add a PORT environment variable.

Development

API Documentation

The API documentation is available at wiki

Database Schema

The database schema is available at wiki

Code Workflow Explanation

The code workflow is available at wiki

Roadmap

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)

Contributing

Pull requests and any feedback are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

AGPLv3

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
Package config supply a global variable `Config` to get configuration message.
Package config supply a global variable `Config` to get configuration message.

Jump to

Keyboard shortcuts

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