Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiimk committed Dec 26, 2024
1 parent 81ed93c commit df43036
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Recommendation: for ease of reading, use the following order:
- Fixed
-->

## [Unreleased] - 2024-12-28
### Changed
- Flight SQL protocol now fully support authentication (anonymous and bearer token)
- The `kamu notebook` command uses new image based on latest Jupyter and new [`kamu-client-python`](https://github.com/kamu-data/kamu-client-python) library
- The `kamu sql server` command interface changed to use `--engine datafusion/spark`, removing the `--flight-sql` flag
- Examples in `example/flightsql/python` were updated to new auth and showcasing `kamu` Python library

## [0.214.0] - 2024-12-23
### Added
- New `kamu system decode` command that can decode an arbitrary block file for debugging
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/flight-sql/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ impl FlightSqlService for KamuFlightSqlService {
// See: https://github.com/apache/arrow-rs/issues/6516
if request.get_ref().r#type == CLOSE_SESSION {
self.do_action_close_session(request).await?;
return Ok(Response::new(Box::pin(futures::stream::empty())));
Ok(Response::new(Box::pin(futures::stream::empty())))
} else {
Err(Status::invalid_argument(format!(
"do_action: The defined request is invalid: {:?}",
Expand Down
6 changes: 2 additions & 4 deletions src/adapter/flight-sql/src/session_auth_anon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ pub struct SessionAuthAnonymous {}
impl SessionAuth for SessionAuthAnonymous {
async fn auth_basic(&self, username: &str, password: &str) -> Result<SessionToken, Status> {
match (username, password) {
("anonymous", "") => {}
// Some libraries have bugs that prevent using empty password
("anonymous", "anonymous") => {}
// Deprecated: preserving compatibility with old credentials
("kamu", "kamu") => {}
// kamu/kamu is deprecated - preserving compatibility with old credentials
("anonymous", "" | "anonymous") | ("kamu", "kamu") => {}
_ => {
return Err(Status::unauthenticated(
"Basic auth is only supported for 'anonymous' accounts with no password. \
Expand Down
2 changes: 1 addition & 1 deletion src/app/cli/src/explore/notebook_server_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl NotebookServerFactory {
("KAMU_CLIENT_URL", client_url.as_str()),
])
.work_dir("/opt/workdir")
.map(network, move |c, network| c.network(network))
.map(network, container_runtime::ContainerRunCommand::network)
.extra_host(("host.docker.internal", "host-gateway"))
.map_or(
address,
Expand Down
2 changes: 2 additions & 0 deletions src/app/cli/tests/tests/test_di_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ fn test_di_cli_graph_validates(tenancy_config: TenancyConfig) {
cli_catalog_builder.add_value(CurrentAccountSubject::new_test());
cli_catalog_builder.add_value(JwtAuthenticationConfig::default());
cli_catalog_builder.add_value(GithubAuthenticationConfig::default());
cli_catalog_builder.add_value(kamu_adapter_flight_sql::SessionId(String::new()));

let validate_result = cli_catalog_builder.validate();

Expand Down Expand Up @@ -99,6 +100,7 @@ fn test_di_server_graph_validates(tenancy_config: TenancyConfig) {
cli_catalog_builder.add_value(GithubAuthenticationConfig::default());
cli_catalog_builder.add_value(ServerUrlConfig::new_test(None));
cli_catalog_builder.add_value(AccessToken::new("some-test-token"));
cli_catalog_builder.add_value(kamu_adapter_flight_sql::SessionId(String::new()));

// TODO: We should ensure this test covers parameters requested by commands and
// types needed for GQL/HTTP adapter that are currently being constructed
Expand Down

0 comments on commit df43036

Please sign in to comment.