Skip to content

Mairon1206/sast-link-cxx-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAST Link C++ SDK

English | 简体中文

Brief

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.

This project is the cross-platform SDK for SAST Link which written in C++. If you're interested in the frontend, please visit SAST Link frontend.

Warning

The project is still under development and may not be stable. Please use it with caution.

Features

  • C++20 coroutine support
  • Cross platform

Start

Prerequisites

Compiler & Build Tools

  • A compiler that supports C++20 or later
  • CMake 3.15 or later

Dependencies

Clone & Build

Clone the repository:

git clone https://github.com/NJUPT-SAST/sast-evento-desktop.git

Build the project:

cmake -B build
cmake --build build

Note

if you want to build the example, you can use the following command:

cmake -B build -DBUILD_EXAMPLE=ON
cmake --build build

Usage

CMakeLists.txt

cmake_minimum_required(VERSION 3.14)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

project(example VERSION 0.1.0 LANGUAGES CXX)

add_subdirectory(sast-link-cxx-sdk)

add_executable(example main.cc)

target_link_libraries(example PRIVATE
    sast-link
)

main.cc

#include <Controller/LoginController.h>
#include <boost/asio/co_spawn.hpp>
#include <boost/asio/detached.hpp>

namespace beast = boost::beast;
namespace net = boost::asio;

int main() {
  net::io_context ioc;
  LoginController controller(ioc);
  net::co_spawn(ioc, controller.begin_login_via_sast_link(), net::detached);
  ioc.run();
}

TODO List

  • async get code from sast link
  • add more reliable error handling
  • add unit tests
  • add more api support

About

SAST Link SDK for C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 77.9%
  • HTML 13.7%
  • CMake 8.4%