Skip to content

Commit 0bf2e9a

Browse files
committed
Add initial Casdoor adapter implementation
This commit introduces the Casdoor adapter with the following key components: - **Configuration**: Added `AdapterConfig` struct to manage environment variables and configuration settings. - **Crypto Functions**: Implemented RSA encryption and token generation functions in `crypto.rs`. - **Handlers**: Created HTTP handlers for OAuth sign-in, callback processing, and user information retrieval in `handlers.rs`. - **State Management**: Established `AppState` to manage application state, including pending sessions and user tokens. - **Environment Setup**: Added `.env.example` for environment variable configuration and `Cargo.toml` for dependency management. - **Main Entry Point**: Implemented the main function to initialize the application and set up routing. This foundational setup enables integration with Casdoor for authentication and user management, laying the groundwork for further development. Release Notes: - Initial implementation of Casdoor adapter with OAuth support and user management features.
1 parent 5611cc2 commit 0bf2e9a

10 files changed

Lines changed: 2825 additions & 3 deletions

File tree

casdoor/.env.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
LISTEN_ADDR=0.0.0.0:3001
2+
3+
# Casdoor configuration
4+
CASDOOR_ENDPOINT=https://your-casdoor.example.com
5+
CASDOOR_CLIENT_ID=your-client-id
6+
CASDOOR_CLIENT_SECRET=your-client-secret
7+
CASDOOR_ORG_NAME=your-org
8+
CASDOOR_APP_NAME=your-app
9+
10+
# The public URL of this adapter (used for OAuth callback)
11+
ADAPTER_PUBLIC_URL=http://localhost:3001
12+
13+
# The collab server's WebSocket URL for /rpc redirect
14+
COLLAB_RPC_URL=ws://localhost:8080/rpc

0 commit comments

Comments
 (0)