Skip to content

Commit b3a0112

Browse files
committed
Remove optional features from mas-iana & regenerate
1 parent 7784df0 commit b3a0112

File tree

9 files changed

+28
-81
lines changed

9 files changed

+28
-81
lines changed

crates/iana-codegen/src/generation.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ pub fn json_schema_impl(
164164
) -> std::fmt::Result {
165165
write!(
166166
f,
167-
r#"#[cfg(feature = "schemars")]
168-
impl schemars::JsonSchema for {} {{
167+
r#"impl schemars::JsonSchema for {} {{
169168
fn schema_name() -> String {{
170169
"{}".to_owned()
171170
}}
@@ -237,8 +236,7 @@ impl schemars::JsonSchema for {} {{
237236
pub fn serde_impl(f: &mut std::fmt::Formatter<'_>, section: &Section) -> std::fmt::Result {
238237
writeln!(
239238
f,
240-
r#"#[cfg(feature = "serde")]
241-
impl<'de> serde::Deserialize<'de> for {} {{
239+
r"impl<'de> serde::Deserialize<'de> for {} {{
242240
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
243241
where
244242
D: serde::de::Deserializer<'de>,
@@ -248,15 +246,14 @@ impl<'de> serde::Deserialize<'de> for {} {{
248246
}}
249247
}}
250248
251-
#[cfg(feature = "serde")]
252249
impl serde::Serialize for {} {{
253250
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
254251
where
255252
S: serde::ser::Serializer,
256253
{{
257254
serializer.serialize_str(&self.to_string())
258255
}}
259-
}}"#,
256+
}}",
260257
section.key, section.key,
261258
)
262259
}

crates/iana-codegen/src/jose.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ enum Requirements {
3131
RecommendedMinus,
3232
Optional,
3333
Prohibited,
34+
Deprecated,
3435
}
3536

3637
#[allow(dead_code)]

crates/iana/Cargo.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,5 @@ publish.workspace = true
1313
workspace = true
1414

1515
[dependencies]
16-
serde = { workspace = true, optional = true }
17-
schemars = { workspace = true, optional = true }
18-
19-
[features]
20-
default = ["serde", "schemars"]
21-
serde = ["dep:serde"]
22-
schemars = ["dep:schemars"]
16+
serde.workspace = true
17+
schemars.workspace = true

crates/iana/src/jose.rs

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ pub enum JsonWebSignatureAlg {
5656
/// No digital signature or MAC performed
5757
None,
5858

59-
/// EdDSA signature algorithms
60-
EdDsa,
61-
6259
/// ECDSA using secp256k1 curve and SHA-256
6360
Es256K,
6461

@@ -82,7 +79,6 @@ impl core::fmt::Display for JsonWebSignatureAlg {
8279
Self::Ps384 => write!(f, "PS384"),
8380
Self::Ps512 => write!(f, "PS512"),
8481
Self::None => write!(f, "none"),
85-
Self::EdDsa => write!(f, "EdDSA"),
8682
Self::Es256K => write!(f, "ES256K"),
8783
Self::Unknown(value) => write!(f, "{value}"),
8884
}
@@ -107,14 +103,12 @@ impl core::str::FromStr for JsonWebSignatureAlg {
107103
"PS384" => Ok(Self::Ps384),
108104
"PS512" => Ok(Self::Ps512),
109105
"none" => Ok(Self::None),
110-
"EdDSA" => Ok(Self::EdDsa),
111106
"ES256K" => Ok(Self::Es256K),
112107
value => Ok(Self::Unknown(value.to_owned())),
113108
}
114109
}
115110
}
116111

117-
#[cfg(feature = "serde")]
118112
impl<'de> serde::Deserialize<'de> for JsonWebSignatureAlg {
119113
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
120114
where
@@ -125,7 +119,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebSignatureAlg {
125119
}
126120
}
127121

128-
#[cfg(feature = "serde")]
129122
impl serde::Serialize for JsonWebSignatureAlg {
130123
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
131124
where
@@ -135,7 +128,6 @@ impl serde::Serialize for JsonWebSignatureAlg {
135128
}
136129
}
137130

138-
#[cfg(feature = "schemars")]
139131
impl schemars::JsonSchema for JsonWebSignatureAlg {
140132
fn schema_name() -> String {
141133
"JsonWebSignatureAlg".to_owned()
@@ -314,19 +306,6 @@ impl schemars::JsonSchema for JsonWebSignatureAlg {
314306
}
315307
.into(),
316308
// ---
317-
schemars::schema::SchemaObject {
318-
metadata: Some(Box::new(schemars::schema::Metadata {
319-
description: Some(
320-
// ---
321-
r"EdDSA signature algorithms".to_owned(),
322-
),
323-
..Default::default()
324-
})),
325-
const_value: Some("EdDSA".into()),
326-
..Default::default()
327-
}
328-
.into(),
329-
// ---
330309
schemars::schema::SchemaObject {
331310
metadata: Some(Box::new(schemars::schema::Metadata {
332311
description: Some(
@@ -480,7 +459,6 @@ impl core::str::FromStr for JsonWebEncryptionAlg {
480459
}
481460
}
482461

483-
#[cfg(feature = "serde")]
484462
impl<'de> serde::Deserialize<'de> for JsonWebEncryptionAlg {
485463
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
486464
where
@@ -491,7 +469,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebEncryptionAlg {
491469
}
492470
}
493471

494-
#[cfg(feature = "serde")]
495472
impl serde::Serialize for JsonWebEncryptionAlg {
496473
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
497474
where
@@ -501,7 +478,6 @@ impl serde::Serialize for JsonWebEncryptionAlg {
501478
}
502479
}
503480

504-
#[cfg(feature = "schemars")]
505481
impl schemars::JsonSchema for JsonWebEncryptionAlg {
506482
fn schema_name() -> String {
507483
"JsonWebEncryptionAlg".to_owned()
@@ -833,7 +809,6 @@ impl core::str::FromStr for JsonWebEncryptionEnc {
833809
}
834810
}
835811

836-
#[cfg(feature = "serde")]
837812
impl<'de> serde::Deserialize<'de> for JsonWebEncryptionEnc {
838813
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
839814
where
@@ -844,7 +819,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebEncryptionEnc {
844819
}
845820
}
846821

847-
#[cfg(feature = "serde")]
848822
impl serde::Serialize for JsonWebEncryptionEnc {
849823
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
850824
where
@@ -854,7 +828,6 @@ impl serde::Serialize for JsonWebEncryptionEnc {
854828
}
855829
}
856830

857-
#[cfg(feature = "schemars")]
858831
impl schemars::JsonSchema for JsonWebEncryptionEnc {
859832
fn schema_name() -> String {
860833
"JsonWebEncryptionEnc".to_owned()
@@ -992,7 +965,6 @@ impl core::str::FromStr for JsonWebEncryptionCompressionAlgorithm {
992965
}
993966
}
994967

995-
#[cfg(feature = "serde")]
996968
impl<'de> serde::Deserialize<'de> for JsonWebEncryptionCompressionAlgorithm {
997969
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
998970
where
@@ -1003,7 +975,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebEncryptionCompressionAlgorithm {
1003975
}
1004976
}
1005977

1006-
#[cfg(feature = "serde")]
1007978
impl serde::Serialize for JsonWebEncryptionCompressionAlgorithm {
1008979
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1009980
where
@@ -1013,7 +984,6 @@ impl serde::Serialize for JsonWebEncryptionCompressionAlgorithm {
1013984
}
1014985
}
1015986

1016-
#[cfg(feature = "schemars")]
1017987
impl schemars::JsonSchema for JsonWebEncryptionCompressionAlgorithm {
1018988
fn schema_name() -> String {
1019989
"JsonWebEncryptionCompressionAlgorithm".to_owned()
@@ -1071,6 +1041,9 @@ pub enum JsonWebKeyType {
10711041
/// Octet string key pairs
10721042
Okp,
10731043

1044+
/// Algorithm Key Pair (TEMPORARY - registered 2025-04-24, expires 2026-04-24)
1045+
Akp,
1046+
10741047
/// An unknown value.
10751048
Unknown(String),
10761049
}
@@ -1082,6 +1055,7 @@ impl core::fmt::Display for JsonWebKeyType {
10821055
Self::Rsa => write!(f, "RSA"),
10831056
Self::Oct => write!(f, "oct"),
10841057
Self::Okp => write!(f, "OKP"),
1058+
Self::Akp => write!(f, "AKP"),
10851059
Self::Unknown(value) => write!(f, "{value}"),
10861060
}
10871061
}
@@ -1096,12 +1070,12 @@ impl core::str::FromStr for JsonWebKeyType {
10961070
"RSA" => Ok(Self::Rsa),
10971071
"oct" => Ok(Self::Oct),
10981072
"OKP" => Ok(Self::Okp),
1073+
"AKP" => Ok(Self::Akp),
10991074
value => Ok(Self::Unknown(value.to_owned())),
11001075
}
11011076
}
11021077
}
11031078

1104-
#[cfg(feature = "serde")]
11051079
impl<'de> serde::Deserialize<'de> for JsonWebKeyType {
11061080
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
11071081
where
@@ -1112,7 +1086,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyType {
11121086
}
11131087
}
11141088

1115-
#[cfg(feature = "serde")]
11161089
impl serde::Serialize for JsonWebKeyType {
11171090
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11181091
where
@@ -1122,7 +1095,6 @@ impl serde::Serialize for JsonWebKeyType {
11221095
}
11231096
}
11241097

1125-
#[cfg(feature = "schemars")]
11261098
impl schemars::JsonSchema for JsonWebKeyType {
11271099
fn schema_name() -> String {
11281100
"JsonWebKeyType".to_owned()
@@ -1183,6 +1155,19 @@ impl schemars::JsonSchema for JsonWebKeyType {
11831155
..Default::default()
11841156
}
11851157
.into(),
1158+
// ---
1159+
schemars::schema::SchemaObject {
1160+
metadata: Some(Box::new(schemars::schema::Metadata {
1161+
description: Some(
1162+
// ---
1163+
r"Algorithm Key Pair (TEMPORARY - registered 2025-04-24, expires 2026-04-24)".to_owned(),
1164+
),
1165+
..Default::default()
1166+
})),
1167+
const_value: Some("AKP".into()),
1168+
..Default::default()
1169+
}
1170+
.into(),
11861171
];
11871172

11881173
let description = r"JSON Web Key Type";
@@ -1249,7 +1234,6 @@ impl core::str::FromStr for JsonWebKeyEcEllipticCurve {
12491234
}
12501235
}
12511236

1252-
#[cfg(feature = "serde")]
12531237
impl<'de> serde::Deserialize<'de> for JsonWebKeyEcEllipticCurve {
12541238
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
12551239
where
@@ -1260,7 +1244,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyEcEllipticCurve {
12601244
}
12611245
}
12621246

1263-
#[cfg(feature = "serde")]
12641247
impl serde::Serialize for JsonWebKeyEcEllipticCurve {
12651248
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12661249
where
@@ -1270,7 +1253,6 @@ impl serde::Serialize for JsonWebKeyEcEllipticCurve {
12701253
}
12711254
}
12721255

1273-
#[cfg(feature = "schemars")]
12741256
impl schemars::JsonSchema for JsonWebKeyEcEllipticCurve {
12751257
fn schema_name() -> String {
12761258
"JsonWebKeyEcEllipticCurve".to_owned()
@@ -1397,7 +1379,6 @@ impl core::str::FromStr for JsonWebKeyOkpEllipticCurve {
13971379
}
13981380
}
13991381

1400-
#[cfg(feature = "serde")]
14011382
impl<'de> serde::Deserialize<'de> for JsonWebKeyOkpEllipticCurve {
14021383
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
14031384
where
@@ -1408,7 +1389,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyOkpEllipticCurve {
14081389
}
14091390
}
14101391

1411-
#[cfg(feature = "serde")]
14121392
impl serde::Serialize for JsonWebKeyOkpEllipticCurve {
14131393
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14141394
where
@@ -1418,7 +1398,6 @@ impl serde::Serialize for JsonWebKeyOkpEllipticCurve {
14181398
}
14191399
}
14201400

1421-
#[cfg(feature = "schemars")]
14221401
impl schemars::JsonSchema for JsonWebKeyOkpEllipticCurve {
14231402
fn schema_name() -> String {
14241403
"JsonWebKeyOkpEllipticCurve".to_owned()
@@ -1535,7 +1514,6 @@ impl core::str::FromStr for JsonWebKeyUse {
15351514
}
15361515
}
15371516

1538-
#[cfg(feature = "serde")]
15391517
impl<'de> serde::Deserialize<'de> for JsonWebKeyUse {
15401518
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
15411519
where
@@ -1546,7 +1524,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyUse {
15461524
}
15471525
}
15481526

1549-
#[cfg(feature = "serde")]
15501527
impl serde::Serialize for JsonWebKeyUse {
15511528
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15521529
where
@@ -1556,7 +1533,6 @@ impl serde::Serialize for JsonWebKeyUse {
15561533
}
15571534
}
15581535

1559-
#[cfg(feature = "schemars")]
15601536
impl schemars::JsonSchema for JsonWebKeyUse {
15611537
fn schema_name() -> String {
15621538
"JsonWebKeyUse".to_owned()
@@ -1677,7 +1653,6 @@ impl core::str::FromStr for JsonWebKeyOperation {
16771653
}
16781654
}
16791655

1680-
#[cfg(feature = "serde")]
16811656
impl<'de> serde::Deserialize<'de> for JsonWebKeyOperation {
16821657
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
16831658
where
@@ -1688,7 +1663,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyOperation {
16881663
}
16891664
}
16901665

1691-
#[cfg(feature = "serde")]
16921666
impl serde::Serialize for JsonWebKeyOperation {
16931667
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16941668
where
@@ -1698,7 +1672,6 @@ impl serde::Serialize for JsonWebKeyOperation {
16981672
}
16991673
}
17001674

1701-
#[cfg(feature = "schemars")]
17021675
impl schemars::JsonSchema for JsonWebKeyOperation {
17031676
fn schema_name() -> String {
17041677
"JsonWebKeyOperation".to_owned()

0 commit comments

Comments
 (0)