Skip to content

Commit e6b2517

Browse files
committed
Update hashavatar API to 0.11.0
1 parent 83ec137 commit e6b2517

6 files changed

Lines changed: 15 additions & 29 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hashavatar-api"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
edition = "2024"
55
rust-version = "1.95"
66
description = "Public avatar API and landing page for hashavatar"
@@ -12,7 +12,7 @@ documentation = "https://github.com/valkyoth/hashavatar-api"
1212
[dependencies]
1313
aws-config = { version = "1.8.16", default-features = false, features = ["rt-tokio"] }
1414
aws-sdk-s3 = { version = "1.131.0", default-features = false, features = ["rt-tokio", "sigv4a"] }
15-
hashavatar = { version = "0.10.0", features = ["blake3", "xxh3"] }
15+
hashavatar = { version = "0.11.0", features = ["blake3", "xxh3"] }
1616
image = { version = "0.25.10", default-features = false, features = ["png"] }
1717
axum = { version = "0.8.9", default-features = false, features = ["http1", "tokio", "query", "json"] }
1818
getrandom = { version = "0.4.2", default-features = false }

Cargo.toml.split-template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hashavatar-api"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
edition = "2024"
55
rust-version = "1.95"
66
description = "Public avatar API and landing page for hashavatar"
@@ -10,7 +10,7 @@ homepage = "https://github.com/valkyoth/hashavatar-api"
1010
documentation = "https://github.com/valkyoth/hashavatar-api"
1111

1212
[dependencies]
13-
hashavatar = { version = "0.10.0", features = ["blake3", "xxh3"] }
13+
hashavatar = { version = "0.11.0", features = ["blake3", "xxh3"] }
1414
axum = { version = "0.8.9", default-features = false, features = ["http1", "tokio", "query", "json"] }
1515
getrandom = { version = "0.4.2", default-features = false }
1616
ipnet = { version = "2.12.0", default-features = false }

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ audit, SBOM, reproducibility, smoke, and GitHub CodeQL default setup checks.
1111

1212
## Current Status
1313

14-
The current service version is `0.10.0`.
14+
The current service version is `0.11.0`.
1515

1616
Implemented now:
1717

@@ -25,7 +25,7 @@ Implemented now:
2525
- Namespace-aware tenant and style-version parameters.
2626
- Selectable identity hash algorithms: `SHA-512`, `BLAKE3`, and `XXH3`.
2727
- `WebP`, `PNG`, `JPEG`, `GIF`, and `SVG` responses.
28-
- Avatar families from `hashavatar 0.10.0`: `cat`, `dog`, `robot`, `fox`,
28+
- Avatar families from `hashavatar 0.11.0`: `cat`, `dog`, `robot`, `fox`,
2929
`alien`, `monster`, `ghost`, `slime`, `bird`, `wizard`, `skull`, `paws`,
3030
`planet`, `rocket`, `mushroom`, `cactus`, `frog`, `panda`, `cupcake`,
3131
`pizza`, `icecream`, `octopus`, and `knight`.
@@ -55,7 +55,7 @@ Intentionally external:
5555
| Area | Status |
5656
| --- | --- |
5757
| Service license | `EUPL-1.2` |
58-
| Renderer crate | `hashavatar 0.10.0` |
58+
| Renderer crate | `hashavatar 0.11.0` |
5959
| MSRV | Rust `1.95.0` |
6060
| Runtime container | Wolfi |
6161
| HTTP framework | `axum` |

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Supported Versions
44

5-
Security fixes are expected for the latest published `0.10.x` release.
5+
Security fixes are expected for the latest published `0.11.x` release.
66

77
## Reporting a Vulnerability
88

src/main.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,7 @@ fn kind_options_html(selected: AvatarKind) -> String {
14981498
r#"<option value="{value}" data-identity="{value}@hashavatar.app" data-supports-layers="{supports_layers}"{selected}>{label}</option>"#,
14991499
value = kind.as_str(),
15001500
label = avatar_kind_label(kind),
1501-
supports_layers = avatar_kind_supports_style_layers(kind),
1501+
supports_layers = kind.supports_face_layers(),
15021502
selected = selected_attr(kind == selected),
15031503
)
15041504
})
@@ -1586,20 +1586,6 @@ fn shape_options_html(selected: AvatarShape) -> String {
15861586
.join("\n")
15871587
}
15881588

1589-
fn avatar_kind_supports_style_layers(kind: AvatarKind) -> bool {
1590-
!matches!(
1591-
kind,
1592-
AvatarKind::Paws
1593-
| AvatarKind::Planet
1594-
| AvatarKind::Rocket
1595-
| AvatarKind::Mushroom
1596-
| AvatarKind::Cactus
1597-
| AvatarKind::Cupcake
1598-
| AvatarKind::Pizza
1599-
| AvatarKind::Icecream
1600-
)
1601-
}
1602-
16031589
fn format_options_html(selected: AvatarRequestFormat) -> String {
16041590
[
16051591
(AvatarRequestFormat::Webp, "WebP"),
@@ -2972,15 +2958,15 @@ impl AvatarRequest {
29722958
}
29732959

29742960
fn effective_accessory(&self) -> AvatarAccessory {
2975-
if avatar_kind_supports_style_layers(self.kind) {
2961+
if self.kind.supports_face_layers() {
29762962
self.accessory
29772963
} else {
29782964
DEFAULT_ACCESSORY
29792965
}
29802966
}
29812967

29822968
fn effective_expression(&self) -> AvatarExpression {
2983-
if avatar_kind_supports_style_layers(self.kind) {
2969+
if self.kind.supports_face_layers() {
29842970
self.expression
29852971
} else {
29862972
DEFAULT_EXPRESSION
@@ -3406,7 +3392,7 @@ mod tests {
34063392
}
34073393

34083394
#[test]
3409-
fn build_avatar_asset_renders_svg_with_hashavatar_0_10() {
3395+
fn build_avatar_asset_renders_svg_with_hashavatar_0_11() {
34103396
let request = test_avatar_request(AvatarRequestFormat::Svg);
34113397
let asset = build_avatar_asset(&request).expect("svg avatar should render");
34123398
let body = std::str::from_utf8(&asset.body).expect("svg should be utf8");

0 commit comments

Comments
 (0)