Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions runtimes/core/src/api/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,7 @@ impl EndpointHandler {
.into_parts();

// Authenticate the request from the platform, if applicable.
#[allow(clippy::manual_unwrap_or_default)]
let platform_seal_of_approval = match self.authenticate_platform(&parts) {
Ok(seal) => seal,
Err(_err) => None,
};

let platform_seal_of_approval = self.authenticate_platform(&parts)?;
let meta = CallMeta::parse_with_caller(
&self.shared.inbound_svc_auth,
&parts.headers,
Expand Down
12 changes: 12 additions & 0 deletions runtimes/core/src/api/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ impl From<WebSocketUpgradeRejection> for Error {
}
}

impl From<crate::api::reqauth::platform::ValidationError> for Error {
fn from(value: crate::api::reqauth::platform::ValidationError) -> Self {
Error {
code: ErrCode::Unauthenticated,
message: "platform authentication failed".into(),
internal_message: Some(value.to_string()),
stack: None,
details: None,
}
}
}

impl From<Error> for AppError {
fn from(val: Error) -> Self {
let message = match val.internal_message {
Expand Down