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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/frontend/src/meta_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ pub trait FrontendMetaClient: Send + Sync {
async fn expire_iceberg_table_snapshots(&self, sink_id: SinkId) -> Result<()>;

async fn refresh(&self, request: RefreshRequest) -> Result<RefreshResponse>;

fn cluster_id(&self) -> &str;
}

pub struct FrontendMetaClientImpl(pub MetaClient);
Expand Down Expand Up @@ -424,4 +426,8 @@ impl FrontendMetaClient for FrontendMetaClientImpl {
async fn refresh(&self, request: RefreshRequest) -> Result<RefreshResponse> {
self.0.refresh(request).await
}

fn cluster_id(&self) -> &str {
self.0.cluster_id()
}
}
5 changes: 4 additions & 1 deletion src/frontend/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,10 @@ impl SessionManagerImpl {
salt,
}
} else if auth_info.encryption_type == EncryptionType::Oauth as i32 {
UserAuthenticator::OAuth(auth_info.metadata.clone())
UserAuthenticator::OAuth {
metadata: auth_info.metadata.clone(),
cluster_id: self.env.meta_client().cluster_id().to_owned(),
}
} else {
return Err(Box::new(Error::new(
ErrorKind::Unsupported,
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,10 @@ impl FrontendMetaClient for MockFrontendMetaClient {
async fn refresh(&self, _request: RefreshRequest) -> RpcResult<RefreshResponse> {
Ok(RefreshResponse { status: None })
}

fn cluster_id(&self) -> &str {
"test-cluster-uuid"
}
}

#[cfg(test)]
Expand Down
4 changes: 4 additions & 0 deletions src/utils/pgwire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ tracing = "0.1"
workspace-hack = { path = "../../workspace-hack" }

[dev-dependencies]
base64 = "0.22"
jsonwebtoken = "9"
rand = "0.8"
rsa = "0.9"
tempfile = "3"
tokio-postgres = "0.7"

Expand Down
2 changes: 1 addition & 1 deletion src/utils/pgwire/src/pg_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ where
})?;
self.ready_for_query()?;
}
UserAuthenticator::ClearText(_) | UserAuthenticator::OAuth(_) => {
UserAuthenticator::ClearText(_) | UserAuthenticator::OAuth { .. } => {
self.stream
.write_no_flush(&BeMessage::AuthenticationCleartextPassword)?;
}
Expand Down
Loading
Loading