From 168bb56aa2b7021f1c50e1c689a3beb6b8a3c743 Mon Sep 17 00:00:00 2001 From: Emi Tatsuo Date: Fri, 13 Nov 2020 17:54:06 -0500 Subject: [PATCH] Renamed methods to match spec --- examples/certificates.rs | 2 +- src/types.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/certificates.rs b/examples/certificates.rs index 5842f1d..095f65f 100644 --- a/examples/certificates.rs +++ b/examples/certificates.rs @@ -57,7 +57,7 @@ fn handle_request(users: Arc>>, request: Reque } } else { // The user didn't provide a certificate - Response::needs_certificate() + Response::client_certificate_required() } }.boxed() } diff --git a/src/types.rs b/src/types.rs index c0e9fb3..fb4dada 100644 --- a/src/types.rs +++ b/src/types.rs @@ -109,14 +109,14 @@ impl ResponseHeader { }) } - pub fn needs_certificate() -> Result { + pub fn client_certificate_required() -> Result { Ok(Self { status: Status::CLIENT_CERTIFICATE_REQUIRED, meta: Meta::new("No certificate provided")?, }) } - pub fn not_authorized() -> Result { + pub fn certificate_not_authorized() -> Result { Ok(Self { status: Status::CERTIFICATE_NOT_AUTHORIZED, meta: Meta::new("Your certificate is not authorized to view this content")?, @@ -271,13 +271,13 @@ impl Response { Ok(Self::new(header)) } - pub fn needs_certificate() -> Result { - let header = ResponseHeader::needs_certificate()?; + pub fn client_certificate_required() -> Result { + let header = ResponseHeader::client_certificate_required()?; Ok(Self::new(header)) } - pub fn not_authorized() -> Result { - let header = ResponseHeader::not_authorized()?; + pub fn certificate_not_authorized() -> Result { + let header = ResponseHeader::certificate_not_authorized()?; Ok(Self::new(header)) }