Compare commits
No commits in common. "4ce55e73f06a758d5ee31fb15b1bb8d39077f45e" and "ae832194e7f736577e4758ea985123fbb8a26311" have entirely different histories.
4ce55e73f0
...
ae832194e7
5 changed files with 7 additions and 14 deletions
|
@ -18,7 +18,7 @@ jobs:
|
||||||
- name: Build the source code
|
- name: Build the source code
|
||||||
run: cargo build
|
run: cargo build
|
||||||
- name: Build examples
|
- name: Build examples
|
||||||
run: cargo build -F 'simple-generator' --example simple_login
|
run: cargo build -F 'cacache-storage' --example simple_login
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --tests --all-features
|
run: cargo test --tests --all-features
|
||||||
- name: Check the code format
|
- name: Check the code format
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "salvo-captcha"
|
name = "salvo-captcha"
|
||||||
version = "0.3.0"
|
version = "0.2.0"
|
||||||
rust-version = "1.75.0"
|
rust-version = "1.75.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Awiteb <a@4rs.nl>"]
|
authors = ["Awiteb <a@4rs.nl>"]
|
||||||
|
@ -35,4 +35,4 @@ rstest = "0.22.0"
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "simple_login"
|
name = "simple_login"
|
||||||
required-features = ["simple-generator"]
|
required-features = ["simple_generator"]
|
||||||
|
|
2
Justfile
2
Justfile
|
@ -19,7 +19,7 @@ _default:
|
||||||
# Run the CI (Local use only)
|
# Run the CI (Local use only)
|
||||||
@ci:
|
@ci:
|
||||||
cargo fmt --all --check
|
cargo fmt --all --check
|
||||||
cargo build -F 'simple-generator' --example simple_login
|
cargo build -F 'simple_generator' --example simple_login
|
||||||
cargo clippy --workspace --all-targets --examples --tests --all-features -- -D warnings
|
cargo clippy --workspace --all-targets --examples --tests --all-features -- -D warnings
|
||||||
cargo nextest run --workspace --all-targets --all-features
|
cargo nextest run --workspace --all-targets --all-features
|
||||||
@{{JUST_EXECUTABLE}} msrv
|
@{{JUST_EXECUTABLE}} msrv
|
||||||
|
|
|
@ -46,14 +46,7 @@ We provide fully customizable query parameters, form fields, and headers to find
|
||||||
|
|
||||||
## Captcha Generator
|
## Captcha Generator
|
||||||
|
|
||||||
We provide [`SimpleCaptchaGenerator`] which is a simple captcha generator based on the [`captcha`] crate, you can enable it by enabling the `simple-generator` feature.
|
We provide [`SimpleCaptchaGenerator`] which is a simple captcha generator based on the [`captcha`] crate. You can implement your own captcha generator by implementing the [`CaptchaGenerator`] trait.
|
||||||
|
|
||||||
```toml
|
|
||||||
[dependencies]
|
|
||||||
salvo-captcha = { version = "0.2", features = ["simple-generator"] }
|
|
||||||
```
|
|
||||||
|
|
||||||
You can implement your own generator by implementing the [`CaptchaGenerator`] trait.
|
|
||||||
|
|
||||||
### Captcha name and difficulty
|
### Captcha name and difficulty
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
#[cfg(feature = "simple-generator")]
|
#[cfg(feature = "simple_generator")]
|
||||||
mod simple_generator;
|
mod simple_generator;
|
||||||
|
|
||||||
#[cfg(feature = "simple-generator")]
|
#[cfg(feature = "simple_generator")]
|
||||||
pub use simple_generator::*;
|
pub use simple_generator::*;
|
||||||
|
|
||||||
/// Captcha generator, used to generate a new captcha image and answer.
|
/// Captcha generator, used to generate a new captcha image and answer.
|
||||||
|
|
Loading…
Reference in a new issue