Skip to content

Commit ffe271a

Browse files
committed
chore: update docs
1 parent 06efe85 commit ffe271a

File tree

9 files changed

+71
-75
lines changed

9 files changed

+71
-75
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/coverage.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,3 @@ jobs:
2727
run: |
2828
cargo install cargo-tarpaulin
2929
cargo tarpaulin --out xml
30-
31-
- name: Upload to codecov.io
32-
uses: codecov/codecov-action@v4
33-
with:
34-
token: ${{secrets.CODECOV_TOKEN}}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
rustup default stable
2323
2424
- name: Cargo Login
25-
run: cargo login ${{ secrets.CARGO_TOKEN }}
25+
run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }}
2626

2727
- name: Cargo Publish
2828
run: cargo publish
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Security audit
2+
on:
3+
pull_request:
4+
branches: [ "main" ]
5+
merge_group:
6+
types: [checks_requested]
7+
paths:
8+
- '**/Cargo.toml'
9+
- '**/Cargo.lock'
10+
workflow_dispatch:
11+
12+
jobs:
13+
security_audit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: rustsec/[email protected]
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/unit.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: UNIT
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
merge_group:
7+
types: [checks_requested]
8+
workflow_dispatch:
9+
10+
jobs:
11+
unit:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: dtolnay/rust-toolchain@stable
20+
- uses: Swatinem/rust-cache@v2
21+
- name: install openssl
22+
if: matrix.os == 'windows-latest'
23+
run: vcpkg install openssl
24+
- name: Cargo test
25+
run: cargo test

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[package]
2-
name = "casdoor-rs-sdk"
3-
version = "2.5.5"
2+
name = "casdoor-sdk-rust"
3+
version = "1.0.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
description = "A Casdoor SDK (contain APIs) with more complete interfaces and better usability."
7-
repository = "https://github.com/andeya/casdoor-rs-sdk"
8-
documentation = "https://docs.rs/casdoor-rs-sdk"
7+
repository = "https://github.com/andeya/casdoor-sdk-rust"
8+
documentation = "https://docs.rs/casdoor-sdk-rust"
99
readme = "README.md"
1010
homepage = "https://casdoor.org"
1111
keywords = ["iam", "auth", "sso", "oidc", "casdoor"]
12-
authors = ["Andeya Lee <andeyalee@outlook.com>"]
12+
authors = ["Dmitrii Mastitckii <dimulgator@outlook.com>"]
1313

1414
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1515

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,42 @@
1-
# casdoor-rs-sdk
1+
Features:
2+
* Add openssl for parsing certificate and getting Public Key from it;
3+
* Delete cubix and salvio;
4+
* Delete getters;
5+
* Support decoding multiple jsonwebtoken algos;
6+
7+
This lib is not production ready, cause it use [OAuth2 Release candidate](https://github.com/ramosbugs/oauth2-rs/tree/5.0.0-rc.1) with big API update.
8+
Read more [here](https://github.com/ramosbugs/oauth2-rs/blob/main/UPGRADE.md).
9+
10+
Also, I started it for closing [RUSTSEC-2024-0421](https://rustsec.org/advisories/RUSTSEC-2024-0421.html).
11+
12+
# casdoor-sdk-rust
213

314
A [Casdoor](https://github.com/casdoor/casdoor) SDK (contain APIs) with more complete interfaces and better usability.
415

5-
[![GitHub last commit](https://img.shields.io/github/last-commit/andeya/casdoor-rs-sdk)](https://github.com/andeya/casdoor-rs-sdk/commits/main)
6-
[![Crates.io](https://img.shields.io/crates/v/casdoor-rs-sdk.svg)](https://crates.io/crates/casdoor-rs-sdk)
7-
[![Docs](https://docs.rs/casdoor-rs-sdk/badge.svg)](https://docs.rs/casdoor-rs-sdk)
16+
[![GitHub last commit](https://img.shields.io/github/last-commit/andeya/casdoor-rs-sdk)](https://github.com/DMoscicki/casdoor-sdk-rust/commits/main/)
17+
[![Crates.io](https://img.shields.io/crates/v/casdoor-rs-sdk.svg)](https://crates.io/crates/casdoor-sdk-rust)
18+
[![Docs](https://docs.rs/casdoor-rs-sdk/badge.svg)](https://docs.rs/casdoor-sdk-rust)
819

920
## Install
1021

1122
Run the following Cargo command in your project directory:
1223

1324
```sh
14-
cargo add casdoor-rs-sdk
25+
cargo add casdoor-sdk-rust
1526
```
1627

1728
Or add the following line to your Cargo.toml:
1829

1930
```toml
20-
casdoor-rs-sdk = "2"
31+
casdoor-sdk-rust = "1"
2132
```
2233

23-
Also, `openssl` must be installed on your system.
24-
2534
## Example
2635

2736
```rust
2837
#[cfg(test)]
2938
mod tests {
30-
use casdoor_rs_sdk::*;
39+
use casdoor-sdk-rust::*;
3140

3241
#[test]
3342
fn example() {

src/authn/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ use jsonwebtoken::{
77
Algorithm, DecodingKey, TokenData, Validation,
88
};
99
pub use models::*;
10-
use oauth2::{AccessToken, AuthUrl, AuthorizationCode, ClientId, ClientSecret, IntrospectionUrl, RedirectUrl, RefreshToken, TokenUrl};
10+
use oauth2::{AccessToken, url, AuthUrl, AuthorizationCode, ClientId, ClientSecret, IntrospectionUrl, RedirectUrl, RefreshToken, TokenUrl};
1111
use openssl::{
1212
base64,
1313
pkey::{PKey, Public},
1414
sha::sha256,
1515
};
1616
use rand::Rng;
1717
use std::{fmt::Write, iter};
18-
pub use oauth2::{basic::BasicTokenIntrospectionResponse, TokenIntrospectionResponse};
19-
use oauth2::url;
18+
pub use oauth2::{basic::{BasicTokenIntrospectionResponse, BasicTokenType}, TokenIntrospectionResponse, TokenResponse};
2019
use uuid::Uuid;
2120

2221
impl Sdk {

src/authn/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use std::time::Duration;
22

33
use crate::{Model, User};
44
use anyhow::{Ok, Result};
5-
pub use oauth2::TokenResponse;
65
use oauth2::{
76
basic::{BasicErrorResponse, BasicRevocationErrorResponse, BasicTokenIntrospectionResponse, BasicTokenType},
87
AccessToken, AuthType, AuthUrl, AuthorizationCode, Client, ClientId, ClientSecret, EndpointNotSet, EndpointSet, ExtraTokenFields,
98
IntrospectionUrl, RedirectUrl, RefreshToken, Scope, StandardRevocableToken, StandardTokenResponse, TokenUrl,
9+
TokenResponse
1010
};
1111
use reqwest::{redirect, ClientBuilder};
1212
use serde::{Deserialize, Serialize};

0 commit comments

Comments
 (0)