From d3279088e3a816db2c254b957159d5b697dc0f62 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Sun, 10 Jul 2022 11:05:51 -0400 Subject: colonies: Fully support {meta, user}-data cloud-init should be able to use this as a seed to properly set up the Planet. --- src/handlers/ships.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/handlers/ships.rs') diff --git a/src/handlers/ships.rs b/src/handlers/ships.rs index 91944fc..3101e54 100644 --- a/src/handlers/ships.rs +++ b/src/handlers/ships.rs @@ -8,7 +8,7 @@ use sqlx::{query, query_as, Error as SqlxError}; use tracing::log::warn; use crate::{ - errors::{JsonResult, ServiceError, StringResult}, + errors::{JsonResult, ServiceError, StringResult, StrResult}, State, }; @@ -31,7 +31,7 @@ pub async fn new( Json(new_ship): Json, state: Extension>, AuthBearer(token): AuthBearer, -) -> StringResult { +) -> StrResult { check_bearer(token)?; let mut conn = state.conn.acquire().await?; @@ -52,7 +52,7 @@ pub async fn delete( Path(shasum): Path, state: Extension>, AuthBearer(token): AuthBearer, -) -> StringResult { +) -> StrResult { check_bearer(token)?; let mut conn = state.conn.acquire().await?; @@ -89,7 +89,7 @@ pub async fn get( Ok(Json(db_ship)) } -fn check_bearer(token: String) -> Result<(), ServiceError> { +pub fn check_bearer(token: String) -> Result<(), ServiceError> { let expected_token = match std::env::var("SHARED_KEY") { Ok(t) => t, Err(_) => { -- cgit v1.2.3