diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2021-08-05 11:51:00 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2021-08-05 13:16:44 +0200 |
commit | 23df4c5b9e5b7fc6b1116dd74a6168419a54d658 (patch) | |
tree | 16781f269b39bebcc56fb14b445fdc9e0ac5319a | |
parent | d45e106bf219d6da94538e2816472ca8026500ba (diff) | |
download | askama-23df4c5b9e5b7fc6b1116dd74a6168419a54d658.tar.gz askama-23df4c5b9e5b7fc6b1116dd74a6168419a54d658.tar.bz2 askama-23df4c5b9e5b7fc6b1116dd74a6168419a54d658.zip |
Remove the askama_iron integration
This web framework seems not to have been updated for quite a while,
and its current version appears to depend on vulnerable crates.
Remove it for now. If someone wants to fix up Iron upstream and
reinstate this, I'd be happy to review your PR.
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/rust.yml | 13 | ||||
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | askama_iron/Cargo.toml | 18 | ||||
l--------- | askama_iron/LICENSE-APACHE | 1 | ||||
l--------- | askama_iron/LICENSE-MIT | 1 | ||||
-rw-r--r-- | askama_iron/README.md | 9 | ||||
-rw-r--r-- | askama_iron/src/lib.rs | 5 | ||||
-rw-r--r-- | askama_iron/templates/hello.html | 1 | ||||
-rw-r--r-- | askama_iron/templates/hello.txt | 1 | ||||
-rw-r--r-- | askama_iron/tests/basic.rs | 36 | ||||
-rw-r--r-- | book/src/integrations.md | 12 |
11 files changed, 0 insertions, 98 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4d83bac..398cb46 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -61,19 +61,6 @@ jobs: - run: cargo test --package askama_gotham --all-targets - run: cargo clippy --package askama_gotham --all-targets -- -D warnings - Iron: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: clippy - - run: cargo test --package askama_iron --all-targets - - run: cargo clippy --package askama_iron --all-targets -- -D warnings - Rocket: runs-on: ubuntu-latest steps: @@ -5,7 +5,6 @@ members = [ "askama_gotham", "askama_derive", "askama_escape", - "askama_iron", "askama_rocket", "askama_shared", "askama_tide", diff --git a/askama_iron/Cargo.toml b/askama_iron/Cargo.toml deleted file mode 100644 index 8fd124b..0000000 --- a/askama_iron/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "askama_iron" -version = "0.10.0" -authors = ["Dirkjan Ochtman <dirkjan@ochtman.nl>"] -description = "Iron integration for Askama templates" -documentation = "https://docs.rs/askama" -keywords = ["markup", "template", "jinja2", "html"] -categories = ["template-engine"] -homepage = "https://github.com/djc/askama" -repository = "https://github.com/djc/askama" -license = "MIT OR Apache-2.0" -workspace = ".." -readme = "README.md" -edition = "2018" - -[dependencies] -askama = { version = "0.10", path = "../askama", default-features = false, features = ["with-iron"] } -iron = { version = ">= 0.5, < 0.7" } diff --git a/askama_iron/LICENSE-APACHE b/askama_iron/LICENSE-APACHE deleted file mode 120000 index 965b606..0000000 --- a/askama_iron/LICENSE-APACHE +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-APACHE
\ No newline at end of file diff --git a/askama_iron/LICENSE-MIT b/askama_iron/LICENSE-MIT deleted file mode 120000 index 76219eb..0000000 --- a/askama_iron/LICENSE-MIT +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-MIT
\ No newline at end of file diff --git a/askama_iron/README.md b/askama_iron/README.md deleted file mode 100644 index 39406cd..0000000 --- a/askama_iron/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# askama_iron: Askama integration with Iron - -[![Documentation](https://docs.rs/askama_iron/badge.svg)](https://docs.rs/askama_iron/) -[![Latest version](https://img.shields.io/crates/v/askama_iron.svg)](https://crates.io/crates/askama_iron) -[![Build Status](https://github.com/djc/askama/workflows/CI/badge.svg)](https://github.com/djc/askama/actions?query=workflow%3ACI) -[![Chat](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/djc/askama) - -Integration of the [Askama](https://github.com/djc/askama) templating engine in -code building on the Iron web framework. diff --git a/askama_iron/src/lib.rs b/askama_iron/src/lib.rs deleted file mode 100644 index 07b96bd..0000000 --- a/askama_iron/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![deny(elided_lifetimes_in_paths)] - -pub use askama::*; - -pub use iron::{headers::ContentType, modifier::Modifier, Response}; diff --git a/askama_iron/templates/hello.html b/askama_iron/templates/hello.html deleted file mode 100644 index 8149be7..0000000 --- a/askama_iron/templates/hello.html +++ /dev/null @@ -1 +0,0 @@ -Hello, {{ name }}! diff --git a/askama_iron/templates/hello.txt b/askama_iron/templates/hello.txt deleted file mode 100644 index 8149be7..0000000 --- a/askama_iron/templates/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello, {{ name }}! diff --git a/askama_iron/tests/basic.rs b/askama_iron/tests/basic.rs deleted file mode 100644 index 32ca839..0000000 --- a/askama_iron/tests/basic.rs +++ /dev/null @@ -1,36 +0,0 @@ -use askama::Template; -use iron::{status, Response}; - -#[derive(Template)] -#[template(path = "hello.html")] -struct HelloTemplate<'a> { - name: &'a str, -} - -#[derive(Template)] -#[template(path = "hello.txt")] -struct HelloTextTemplate<'a> { - name: &'a str, -} - -#[test] -fn test_iron() { - let rsp = Response::with((status::Ok, HelloTemplate { name: "world" })); - let mut buf = Vec::new(); - let _ = rsp.body.unwrap().write_body(&mut buf); - assert_eq!(buf, b"Hello, world!"); - - let content_type = rsp.headers.get::<iron::headers::ContentType>().unwrap(); - assert_eq!(format!("{}", content_type), "text/html; charset=utf-8"); -} - -#[test] -fn test_iron_non_html() { - let rsp = Response::with((status::Ok, HelloTextTemplate { name: "world" })); - let mut buf = Vec::new(); - let _ = rsp.body.unwrap().write_body(&mut buf); - assert_eq!(buf, b"Hello, world!"); - - let content_type = rsp.headers.get::<iron::headers::ContentType>(); - assert_eq!(content_type, None); -} diff --git a/book/src/integrations.md b/book/src/integrations.md index f717fe0..a972e4d 100644 --- a/book/src/integrations.md +++ b/book/src/integrations.md @@ -12,18 +12,6 @@ In case a run-time error occurs during templating, a `500 Internal Server Error` `Status` value will be returned, so that this can be further handled by your error catcher. -## Iron integration - -Enabling the `with-iron` feature appends an implementation of Iron's -`Modifier<Response>` trait for each template type. This makes it easy to -trivially return a value of that type in an Iron handler. See -[the example](https://github.com/djc/askama/blob/main/askama_iron/tests/basic.rs) -from the Askama test suite for more on how to integrate. - -Note that Askama's generated `Modifier<Response>` implementation currently -unwraps any run-time errors from the template. If you have a better -suggestion, please [file an issue](https://github.com/djc/askama/issues/new). - ## Actix-web integration Enabling the `with-actix-web` feature appends an implementation of Actix-web's |