Skip to content

Commit

Permalink
Merge pull request #11 from joswayski/byok
Browse files Browse the repository at this point in the history
Bring Your Own Key for enterprise customers
  • Loading branch information
joswayski authored Jul 7, 2024
2 parents bf9d112 + 19893bc commit 25fc437
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ async fn check_for_key(
.into_response());
}

if !cache.lock().await.contains(&api_key) {
let is_poor = !&api_key.starts_with("enterprise-");

if is_poor && !cache.lock().await.contains(&api_key) {
return Err((StatusCode::UNAUTHORIZED, "Get a valid key first dummy").into_response());
}

Expand Down

0 comments on commit 25fc437

Please sign in to comment.