Skip to content

Commit 5b41088

Browse files
committed
Doc fix
Add missing doc strings, and fix bare URLs in existing docs. Signed-off-by: setrofim <setrofim@gmail.com>
1 parent 1ce28ff commit 5b41088

File tree

9 files changed

+22
-4
lines changed

9 files changed

+22
-4
lines changed

src/base64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pub fn decode_str(v: &str) -> Result<Vec<u8>, Error> {
1515
.map_err(|e| Error::ParseError(e.to_string()))
1616
}
1717

18+
/// a `Vec<u8>` encoded as base64 in human readable serialization
1819
#[derive(Debug, PartialEq)]
1920
pub struct Bytes(Vec<u8>);
2021

src/ear.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ enum KeyFormat {
3333
pub struct Ear {
3434
/// The EAT profile of the associated claim-set
3535
///
36-
/// See https://datatracker.ietf.org/doc/html/draft-ietf-rats-eat-19#name-eat_profile-eat-profile-cla
36+
/// See <https://datatracker.ietf.org/doc/html/draft-ietf-rats-eat-19#name-eat_profile-eat-profile-cla>
3737
pub profile: String,
3838
/// "Issued At" -- the time at which the EAR is issued
3939
///
4040
/// See:
41-
/// - https://datatracker.ietf.org/doc/html/draft-ietf-rats-eat-19#section-4.3.1
42-
/// - https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6
41+
/// - <https://datatracker.ietf.org/doc/html/draft-ietf-rats-eat-19#section-4.3.1>
42+
/// - <https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6>
4343
pub iat: i64,
4444
/// Identifier of the verifier that created the EAR
4545
pub vid: VerifierID,

src/error.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,34 @@
22

33
use thiserror::Error;
44

5+
/// EAR errors
56
#[derive(Error, Debug)]
67
pub enum Error {
8+
/// an error occured while parsing serialized structures
79
#[error("parse error: {0}")]
810
ParseError(String),
11+
/// an error occured while formatting structures
912
#[error("format error: {0}")]
1013
FormatError(String),
14+
/// an error occured during signing
1115
#[error("sign error: {0}")]
1216
SignError(String),
17+
/// an error occured during verification
1318
#[error("verify error: {0}")]
1419
VerifyError(String),
20+
/// an error occured while processing cryptographic keys
1521
#[error("key error: {0}")]
1622
KeyError(String),
23+
/// an error occured during validation of the internal integrity of structures
1724
#[error("validation error: {0}")]
1825
ValidationError(String),
26+
// invalid claim value
1927
#[error("invalid value: {0}")]
2028
InvalidValue(i8),
29+
// invalid string name
2130
#[error("invalid name: {0}")]
2231
InvalidName(String),
32+
// invalid integer key
2333
#[error("invalid key: {0}")]
2434
InvalidKey(i32),
2535
}

src/id.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ use serde::{
99

1010
use crate::error::Error;
1111

12+
/// identifies the verifier that produced the EAR
1213
#[derive(Debug, PartialEq)]
1314
pub struct VerifierID {
15+
/// uniquely identifies the software build running the verifier
1416
pub build: String,
17+
/// uniquely identifies the organizational unit responsible for this build
1518
pub developer: String,
1619
}
1720

src/key.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use serde::{
99
ser::{Serialize, SerializeMap},
1010
};
1111

12+
/// public key that is being attested
1213
#[derive(Debug, PartialEq)]
1314
pub struct KeyAttestation {
1415
pub pub_key: Bytes,

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ pub use self::trust::claim::TrustClaim;
9999
pub use self::trust::tier::TrustTier;
100100
pub use self::trust::vector::TrustVector;
101101

102+
/// trustworthiness claims
102103
pub mod claim {
103104
pub use super::trust::claim::CRYPTO_VALIDATION_FAILED;
104105
pub use super::trust::claim::NO_CLAIM;

src/nonce.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl<'de> Visitor<'de> for OneNonceVisitor {
137137
}
138138
}
139139

140+
/// echoed back by the verifier to provide freshness
140141
#[derive(Debug, PartialEq)]
141142
pub struct Nonce(Vec<OneNonce>);
142143

src/raw.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use serde::ser::{SerializeMap as _, SerializeSeq as _, SerializeTupleVariant as
1111

1212
use crate::base64::Bytes;
1313

14+
/// deserialized raw JSON object or CBOR map
1415
#[derive(Debug, PartialEq)]
1516
pub enum RawValue {
1617
Integer(i64),

src/trust/claim.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ pub static SOURCED_DATA_CLAIM_MAP: &Map<i8, ValueDescription<'static>> = &phf_ma
333333
///
334334
/// This is a claim regarding the trustworthiness of one aspect of the attested environment, as
335335
/// defined in
336-
/// https://datatracker.ietf.org/doc/html/draft-ietf-rats-ar4si-04#name-trustworthiness-claims
336+
/// <https://datatracker.ietf.org/doc/html/draft-ietf-rats-ar4si-04#name-trustworthiness-claims>
337337
#[derive(Debug, Clone, Copy)]
338338
pub struct TrustClaim {
339339
/// Claim value

0 commit comments

Comments
 (0)