Skip to content

Commit 01bd37f

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

File tree

8 files changed

+62
-22
lines changed

8 files changed

+62
-22
lines changed

.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: 2 additions & 2 deletions
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
@@ -31,7 +31,7 @@ jobs:
3131
id: create_release
3232
uses: actions/create-release@v1
3333
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
34+
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} # This token is provided by Actions, you do not need to create your own token
3535
with:
3636
tag_name: ${{ github.ref }}
3737
release_name: Release ${{ github.ref }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
jobs:
11+
security_audit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: rustsec/[email protected]
16+
with:
17+
token: ${{ secrets.GIT_TOKEN }}

.github/workflows/unit.yml

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

@@ -11,23 +22,21 @@ A [Casdoor](https://github.com/casdoor/casdoor) SDK (contain APIs) with more com
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)