Skip to content

Commit

Permalink
fix: consider API security from environment variable in pgwire (#2260)
Browse files Browse the repository at this point in the history
  • Loading branch information
abcpro1 authored Dec 15, 2023
1 parent 42290a9 commit 4c4f500
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dozer-api/src/sql/pgwire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use tokio::select;
use crate::auth::Authorizer;
use crate::shutdown::ShutdownReceiver;
use crate::sql::datafusion::SQLExecutor;
use crate::CacheEndpoint;
use crate::{get_api_security, CacheEndpoint};

use super::datafusion::PlannedStatement;
use super::util::Iso8601Duration;
Expand Down Expand Up @@ -100,7 +100,8 @@ impl PgWireServer {
let host = config.host.unwrap_or_else(default_host);
let port = config.port.unwrap_or_else(default_sql_port);
let server_addr = format!("{}:{}", host, port);
let jwt_secret = self.api_security.as_ref().map(|security| {
let api_security = get_api_security(self.api_security.to_owned());
let jwt_secret = api_security.as_ref().map(|security| {
let ApiSecurity::Jwt(secret) = security.clone();
secret
});
Expand Down

0 comments on commit 4c4f500

Please sign in to comment.