Repository navigation
chore: Introduce open-api feature to gate utoipa and swagger - #1458
Conversation
WalkthroughAdds an "open-api" feature and moves all utoipa/OpenAPI derives, schema/param attributes, and api_doc exports behind it; introduces a feature-gated Management v1 openapi builder that patches per-queue schemas, updates router/bin wiring, and switches some LazyLock usages. Runtime behavior unchanged when feature is disabled. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Router
participant ApiModule as Management::v1::openapi
participant QueueReg as QueueRegistry
participant AuthZ
alt open-api enabled
Client->>Router: GET /openapi.json
Router->>ApiModule: v1_api_doc(&queue_configs)
ApiModule->>QueueReg: request per-queue configs
QueueReg-->>ApiModule: queue configs + utoipa refs
ApiModule->>AuthZ: call authorizer.api_doc() (if provided)
AuthZ-->>ApiModule: authorizer OpenAPI component
ApiModule->>ApiModule: merge & patch SetTaskQueueConfig paths/schemas
ApiModule-->>Router: complete OpenAPI spec
Router-->>Client: OpenAPI JSON / Swagger UI
else open-api disabled
Client->>Router: GET /openapi.json
Router-->>Client: 404 / not compiled (no API docs)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
crates/lakekeeper/src/api/router.rs (1)
322-328: Gate the test withopen-apifeature.The test references a cfg-gated static; without the feature it will fail to compile.
-#[cfg(test)] -mod test { +#[cfg(all(test, feature = "open-api"))] +mod test {crates/lakekeeper/Cargo.toml (1)
14-24: Feature wiring incomplete: tests unconditionally useutoipawithoutopen-apifeature guard or dev-dependency.The test file at
crates/lakekeeper/src/tests/tasks.rsusesutoipa::ToSchema(lines 17, 35, 44) unconditionally, bututoipais only available under the optionalopen-apifeature and is not in[dev-dependencies]. This causes compilation to fail when building without theopen-apifeature (e.g.,cargo test --no-default-features).Fix: Either:
- Guard the test module with
#[cfg(feature = "open-api")], or- Add
utoipato[dev-dependencies](if tests should always include this)crates/authz-openfga/src/relations.rs (4)
13-14: Unconditional utoipa import breaks no-open-api builds.This crate should compile without the "open-api" feature, but
use utoipa::ToSchema;makes utoipa a hard dependency.-use utoipa::ToSchema; +#[cfg(feature = "open-api")] +use utoipa as _;Follow-up: gate ToSchema derives (see next comments).
49-61: Gate ToSchema derives behind the feature.Deriving ToSchema unconditionally defeats the feature flag. Apply cfg_attr and fully qualify the path to avoid needing the import.
-#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[cfg_attr(feature = "open-api", derive(utoipa::ToSchema))] pub(super) enum UserOrRole {Repeat this pattern for all types in this file currently deriving ToSchema.
146-153: Apply the same gating to APIRoleRelation, RoleAssignment, APIRoleAction (and peers).Several enums/structs still derive ToSchema unconditionally. Gate them with cfg_attr like elsewhere in the repo.
-#[derive(Debug, Clone, Deserialize, Copy, Eq, PartialEq, ToSchema, EnumIter)] +#[derive(Debug, Clone, Deserialize, Copy, Eq, PartialEq, EnumIter)] +#[cfg_attr(feature = "open-api", derive(utoipa::ToSchema))] pub(super) enum APIRoleRelation { ... } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[cfg_attr(feature = "open-api", derive(utoipa::ToSchema))] pub(super) enum RoleAssignment { ... } -#[derive(Copy, Debug, Clone, Eq, PartialEq, Serialize, Deserialize, ToSchema, EnumIter)] +#[derive(Copy, Debug, Clone, Eq, PartialEq, Serialize, Deserialize, EnumIter)] +#[cfg_attr(feature = "open-api", derive(utoipa::ToSchema))] pub(super) enum APIRoleAction { ... }Apply similarly to all APIServer*, APIProject*, APIWarehouse*, APINamespace*, APITable*, APIView* types in this file.
Also applies to: 154-161, 200-211
275-291: Gate allToSchemaderives behind theopen-apifeature flag.Verification found 22 un-gated
ToSchemaderives throughout the file. All instances need to be properly gated with#[cfg_attr(feature = "open-api", ...)]or the derive removed entirely for non-API types. Additionally, verify the import at line 13 (use utoipa::ToSchema;) is properly handled.Affected lines requiring fixes: 49, 146, 154, 200, 275, 283, 329, 428, 442, 537, 675, 688, 778, 949, 962, 1052, 1176, 1188, 1267, 1390, 1401, 1472.
🧹 Nitpick comments (8)
crates/lakekeeper/src/service/tasks/task_registry.rs (3)
150-160: Avoid allocation forutoipa_type_name.Use a borrowed
Cowto skip theto_string()allocation.- utoipa_type_name: T::name().to_string().into(), + utoipa_type_name: std::borrow::Cow::Borrowed(T::name()),
295-304: Good feature-gating; consider aliases to reduce repetition.Minor tidy: define type aliases once and reference them in the struct to cut duplicate cfg blocks.
Example:
#[cfg(feature = "open-api")] type OpenApiTypeName = std::borrow::Cow<'static, str>; #[cfg(not(feature = "open-api"))] type OpenApiTypeName = (); #[cfg(feature = "open-api")] type OpenApiSchema = utoipa::openapi::RefOr<utoipa::openapi::Schema>; #[cfg(not(feature = "open-api"))] type OpenApiSchema = (); pub struct QueueApiConfig { pub queue_name: &'static TaskQueueName, pub utoipa_type_name: OpenApiTypeName, pub utoipa_schema: OpenApiSchema, }
306-314: Optional: harmonize Debug across features.Current Debug prints
utoipa_type_name(as()) when the feature is off. If you prefer cleaner output, gate those fields in Debug and show a simple “disabled” marker.impl std::fmt::Debug for QueueApiConfig { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - f.debug_struct("QueueApiConfig") - .field("queue_name", &self.queue_name) - .field("utoipa_type_name", &self.utoipa_type_name) - .field("utoipa_schema", &"<schema>") - .finish() + let mut ds = f.debug_struct("QueueApiConfig"); + ds.field("queue_name", &self.queue_name); + #[cfg(feature = "open-api")] + { + ds.field("utoipa_type_name", &self.utoipa_type_name) + .field("utoipa_schema", &"<schema>"); + } + #[cfg(not(feature = "open-api"))] + { + ds.field("open_api", &"<disabled>"); + } + ds.finish() } }crates/lakekeeper/src/service/tasks/mod.rs (1)
111-137: Avoid duplicating TaskConfig trait via cfg if possible.Two near-identical trait definitions increase maintenance overhead. Consider a single trait plus a feature-gated supertrait bound to utoipa::ToSchema (e.g., a sealed helper trait) or cfg_if! around a type alias for the bound.
crates/lakekeeper/src/api/management/mod.rs (2)
96-106: Minor OpenAPI response code description mismatch.The 500 response is described as "Unauthorized". Suggest 401/403 for unauthorized, or adjust description to "InternalError".
342-349: OpenAPI description nit."List of users" on Search Role should be "List of roles".
crates/lakekeeper/src/service/storage/s3.rs (2)
48-48: Add a client timeout to the static HTTP client.reqwest::Client::new() has no default timeout; long hangs are possible if Cloudflare R2 is slow. Prefer a bounded timeout.
-static S3_HTTP_CLIENT: LazyLock<reqwest::Client> = LazyLock::new(reqwest::Client::new); +static S3_HTTP_CLIENT: LazyLock<reqwest::Client> = LazyLock::new(|| { + reqwest::Client::builder() + .timeout(std::time::Duration::from_secs(15)) + .build() + .expect("failed to build reqwest client") +});
596-605: Avoid unwrap when building temporary credentials.Prefer propagating the build error instead of unwrap to prevent panics on unexpected inputs.
- Ok(aws_sdk_sts::types::Credentials::builder() + let creds = aws_sdk_sts::types::Credentials::builder() .access_key_id(tmp_credentials.result.access_key_id) .secret_access_key(tmp_credentials.result.secret_access_key) .session_token(tmp_credentials.result.session_token) .expiration( (std::time::SystemTime::now() + std::time::Duration::from_secs(ttl_seconds)).into(), ) - .build() - .unwrap()) + .build() + .map_err(|e| CredentialsError::ShortTermCredential { + source: Some(Box::new(e)), + reason: "Failed to build AWS credentials from Cloudflare R2 response".to_string(), + })?; + Ok(creds)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (32)
crates/authz-openfga/Cargo.toml(2 hunks)crates/authz-openfga/src/api.rs(8 hunks)crates/authz-openfga/src/check.rs(3 hunks)crates/authz-openfga/src/relations.rs(22 hunks)crates/lakekeeper-bin/Cargo.toml(1 hunks)crates/lakekeeper-bin/src/main.rs(1 hunks)crates/lakekeeper/Cargo.toml(5 hunks)crates/lakekeeper/src/api/iceberg/v1/namespace.rs(1 hunks)crates/lakekeeper/src/api/management/mod.rs(112 hunks)crates/lakekeeper/src/api/management/v1/openapi.rs(1 hunks)crates/lakekeeper/src/api/management/v1/project.rs(6 hunks)crates/lakekeeper/src/api/management/v1/role.rs(6 hunks)crates/lakekeeper/src/api/management/v1/server.rs(5 hunks)crates/lakekeeper/src/api/management/v1/tabular.rs(1 hunks)crates/lakekeeper/src/api/management/v1/tasks.rs(11 hunks)crates/lakekeeper/src/api/management/v1/user.rs(9 hunks)crates/lakekeeper/src/api/management/v1/warehouse/mod.rs(10 hunks)crates/lakekeeper/src/api/router.rs(6 hunks)crates/lakekeeper/src/lib.rs(1 hunks)crates/lakekeeper/src/service/authz/implementations/allow_all.rs(3 hunks)crates/lakekeeper/src/service/authz/mod.rs(2 hunks)crates/lakekeeper/src/service/catalog_store/warehouse.rs(1 hunks)crates/lakekeeper/src/service/identifier/tabular.rs(1 hunks)crates/lakekeeper/src/service/storage/az.rs(2 hunks)crates/lakekeeper/src/service/storage/gcs/mod.rs(3 hunks)crates/lakekeeper/src/service/storage/mod.rs(5 hunks)crates/lakekeeper/src/service/storage/s3.rs(6 hunks)crates/lakekeeper/src/service/tasks/mod.rs(4 hunks)crates/lakekeeper/src/service/tasks/tabular_expiration_queue.rs(3 hunks)crates/lakekeeper/src/service/tasks/tabular_purge_queue.rs(3 hunks)crates/lakekeeper/src/service/tasks/task_registry.rs(3 hunks)justfile(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-25T06:54:15.179Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1378
File: crates/lakekeeper/src/api/management/v1/warehouse/undrop.rs:51-53
Timestamp: 2025-09-25T06:54:15.179Z
Learning: In the lakekeeper codebase, when iterating over &[TabularId] and pattern matching TabularId::View(id), the id variable has type &ViewId. Using *id correctly dereferences to get ViewId, which can be passed directly to authorization methods that expect ViewId parameters.
Applied to files:
crates/lakekeeper/src/service/identifier/tabular.rs
🧬 Code graph analysis (4)
crates/lakekeeper/src/api/management/mod.rs (3)
crates/lakekeeper/src/api/management/v1/openapi.rs (1)
api_doc(115-298)crates/lakekeeper/src/service/authz/implementations/allow_all.rs (1)
api_doc(70-72)crates/lakekeeper/src/service/authz/mod.rs (2)
api_doc(230-230)api_doc(849-851)
crates/lakekeeper/src/service/tasks/mod.rs (4)
crates/lakekeeper/src/service/tasks/task_registry.rs (10)
fmt(29-34)fmt(88-93)fmt(122-128)fmt(307-313)tabular_expiration_queue(200-200)tabular_purge_queue(221-221)max_time_since_last_heartbeat(348-350)max_time_since_last_heartbeat(364-366)queue_name(344-346)queue_name(360-362)crates/lakekeeper/src/service/tasks/tabular_expiration_queue.rs (3)
tabular_purge_queue(228-228)max_time_since_last_heartbeat(67-69)queue_name(63-65)crates/lakekeeper/src/service/tasks/tabular_purge_queue.rs (2)
max_time_since_last_heartbeat(54-56)queue_name(50-52)crates/lakekeeper/src/tests/tasks.rs (2)
max_time_since_last_heartbeat(56-58)queue_name(52-54)
crates/lakekeeper/src/api/router.rs (2)
crates/lakekeeper/src/api/management/v1/openapi.rs (1)
api_doc(115-298)crates/lakekeeper-bin/src/main.rs (2)
v1_api_doc(161-161)v1_api_doc(163-163)
crates/lakekeeper/src/api/management/v1/openapi.rs (3)
crates/lakekeeper/src/api/management/mod.rs (2)
set_task_queue_config(1417-1433)get_task_queue_config(1448-1461)crates/lakekeeper/src/service/authz/implementations/allow_all.rs (1)
api_doc(70-72)crates/lakekeeper/src/service/authz/mod.rs (2)
api_doc(230-230)api_doc(849-851)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: sqlx-check
- GitHub Check: docker / docker
- GitHub Check: security_audit
- GitHub Check: check-generated-openapi-matches
- GitHub Check: test
- GitHub Check: clippy
- GitHub Check: docker / docker
- GitHub Check: openfga
- GitHub Check: security_audit
🔇 Additional comments (41)
crates/lakekeeper/src/service/catalog_store/warehouse.rs (1)
39-39: LGTM! Clean feature-gating of OpenAPI schema derivation.The conditional derive follows the established pattern (line 38 for sqlx) and correctly gates the utoipa::ToSchema derivation behind the "open-api" feature flag. This aligns perfectly with the PR objective to make OpenAPI support optional.
crates/lakekeeper/src/api/management/v1/role.rs (1)
19-121: LGTM! Clean and consistent feature gating.The OpenAPI-related derives and attributes are correctly wrapped with
cfg_attr(feature = "open-api", ...)throughout all structs. The implementation properly:
- Preserves the distinction between
ToSchemaandIntoParams(line 103)- Uses the correct attribute names (
schemafor ToSchema,paramfor IntoParams at line 119)- Maintains runtime behavior unchanged when the feature is disabled
crates/lakekeeper/src/api/iceberg/v1/namespace.rs (2)
310-311: LGTM! OpenAPI derive correctly gated.The conditional compilation of
utoipa::IntoParamsis correctly implemented usingcfg_attr. Core derives remain unconditional, preserving runtime behavior when the feature is disabled.
316-316: LGTM! OpenAPI feature properly defined and gated.Verification confirms the "open-api" feature is correctly defined in
crates/lakekeeper/Cargo.tomlwith proper dependencies onutoipa,utoipa-swagger-ui, andserde_norway. The conditional attribute on line 316 is valid and the code change is approved.crates/lakekeeper/src/api/management/v1/user.rs (1)
19-20: Feature-gating implementation verified and correct.All checks passed:
- ✅
open-apifeature is properly defined in Cargo.toml with correct dependencies- ✅
utoipais correctly marked as optional- ✅ Consistent pattern applied across all management v1 modules
The conditional OpenAPI support is correctly implemented using
cfg_attrwithout affecting runtime behavior or serialization logic.crates/lakekeeper/src/service/authz/implementations/allow_all.rs (2)
5-6: LGTM! Proper conditional import.The conditional import of
utoipa::OpenApiis correctly gated behind theopen-apifeature, preventing unused imports when the feature is disabled.
49-52: LGTM! ApiDoc correctly gated.The
ApiDocstruct is properly conditionally compiled and has an empty#[openapi()]attribute, which is appropriate since this authorization implementation doesn't expose any custom endpoints (as confirmed by the emptyRouter::new()at line 74).crates/lakekeeper/src/service/tasks/task_registry.rs (2)
1-1: LGTM on import tweaks.Importing
fmt::Formatteris consistent with the updatedDebugimpl usage.
321-322: GateToSchemaderives in test code to support--no-default-featuresbuilds.The file contains unconditional
use utoipa::ToSchemaandToSchemaderives that will fail when compiling tests with--no-default-featuresunlessutoiparemains a dev-dependency. Gate both the import and derives at lines 321–322 and 338–342, 354–358:- use serde::{Deserialize, Serialize}; - use utoipa::ToSchema; + use serde::{Deserialize, Serialize}; + #[cfg(feature = "open-api")] + use utoipa::ToSchema; use super::*; // ... - #[derive(Clone, Debug, Serialize, Deserialize, ToSchema)] + #[derive(Clone, Debug, Serialize, Deserialize)] + #[cfg_attr(feature = "open-api", derive(utoipa::ToSchema))] struct TestQueueConfig { test_field: String, } - #[derive(Clone, Debug, Serialize, Deserialize, ToSchema)] + #[derive(Clone, Debug, Serialize, Deserialize)] + #[cfg_attr(feature = "open-api", derive(utoipa::ToSchema))] struct SecondTestQueueConfig { other_field: i32, }Also apply the same gating to test structs in
crates/lakekeeper/src/tests/tasks.rs(lines 17, 35, 44) to ensure tests compile consistently across feature configurations.crates/lakekeeper-bin/src/main.rs (1)
161-163: LGTM! Ownership change aligns with OpenAPI feature gating.The switch from cloning
queue_configsto passing a reference (&queue_configs) reduces unnecessary allocations during OpenAPI doc generation. This aligns with the broader refactor to make OpenAPI support optional.crates/lakekeeper-bin/Cargo.toml (1)
28-28: LGTM! Feature enabling is consistent with PR objectives.Enabling the
open-apifeature forlakekeeper-authz-openfgaensures OpenAPI metadata is generated for the authz module when building the binary.crates/authz-openfga/Cargo.toml (2)
13-14: LGTM! Feature flag correctly declared.The
open-apifeature properly gates theutoipadependency, enabling optional OpenAPI support.
33-33: LGTM! Dependency correctly marked as optional.Making
utoipaoptional ensures it's only included when theopen-apifeature is enabled.justfile (1)
12-15: LGTM! Per-crate clippy checks improve CI coverage.The updated clippy commands now test different feature combinations per crate, ensuring the
open-apifeature gates work correctly across various build configurations.crates/lakekeeper/src/service/authz/mod.rs (2)
229-230: LGTM! Trait method correctly feature-gated.The
api_doc()method in theAuthorizertrait is properly gated behind theopen-apifeature, ensuring it's only compiled when OpenAPI support is enabled.
848-851: LGTM! Implementation correctly feature-gated.The
HidingAuthorizer::api_doc()implementation is properly gated behind theopen-apifeature, consistent with the trait definition.crates/authz-openfga/src/api.rs (2)
51-62: LGTM! OpenAPI attributes correctly feature-gated.The
GetAccessQueryparameters are properly wrapped withcfg_attr(feature = "open-api", ...), ensuring OpenAPI metadata is only generated when the feature is enabled.
128-226: LGTM! Consistent feature-gating across all query structs.All query parameter attributes (
GetRoleAssignmentsQuery,GetServerAssignmentsQuery,GetProjectAssignmentsQuery,GetWarehouseAssignmentsQuery,GetNamespaceAssignmentsQuery,GetTableAssignmentsQuery,GetViewAssignmentsQuery) are consistently wrapped withcfg_attr(feature = "open-api", ...). TheGetProjectAssignmentsResponse.project_idschema attribute is also properly gated.crates/lakekeeper/src/api/management/v1/tabular.rs (2)
110-117: LGTM! OpenAPI derives and attributes properly feature-gated.The
SearchTabularRequeststruct'sToSchemaderive andschemaattribute are correctly wrapped withcfg_attr(feature = "open-api", ...), preserving runtime behavior while making OpenAPI metadata optional.
120-128: LGTM! Consistent feature-gating for response types.Both
SearchTabularResponseandSearchTabularstructs have theirToSchemaderives properly gated behind theopen-apifeature, maintaining consistency with the broader PR changes.crates/lakekeeper/src/service/storage/az.rs (2)
41-62: LGTM! Storage profile OpenAPI derives feature-gated.The
AdlsProfilestruct'sToSchemaderive is correctly wrapped withcfg_attr(feature = "open-api", ...), ensuring OpenAPI metadata is only generated when needed.
440-461: LGTM! Credential enum OpenAPI attributes properly feature-gated.The
AzCredentialenum'sToSchemaderive and all per-variantschema(title)attributes are consistently wrapped withcfg_attr(feature = "open-api", ...), maintaining runtime compatibility while making OpenAPI metadata optional.crates/lakekeeper/src/api/management/v1/project.rs (1)
27-36: OpenAPI gating looks correct and non-invasive.All ToSchema derives and field schema hints are correctly behind cfg_attr(feature = "open-api"). Runtime behavior unchanged.
Also applies to: 54-64, 66-74, 345-377
crates/lakekeeper/src/api/management/v1/tasks.rs (2)
215-254: Validatepage_sizeto prevent abuse and clarify limits.Add a bound check (e.g., 1..=1000) to reject invalid or excessive page sizes.
[uggest_recommended_refactor]
Apply this diff near the other input validations:@@ if let Some(queue_names) = &query.queue_name { if queue_names.len() > 100 { @@ } } + if let Some(page_size) = query.page_size { + if page_size <= 0 || page_size > 1000 { + return Err(ErrorModel::bad_request( + "Invalid page size. Must be between 1 and 1000.", + "InvalidPageSize", + None, + ) + .into()); + } + }Also applies to: 307-367
41-78: OpenAPI cfg-attr usage is consistent and clean.Derives and per-field schema hints are properly gated; public JSON surface remains stable.
Also applies to: 114-140, 141-158, 193-207, 255-263, 266-298
crates/lakekeeper/src/lib.rs (1)
51-53: Conditional re-export is appropriate.
pub use utoipais correctly behind the feature and doc(cfg).crates/lakekeeper/src/service/tasks/tabular_expiration_queue.rs (1)
21-30: Gating of queue OpenAPI config is solid.
API_CONFIGand ToSchema are properly behind the feature; no leakage in non-OpenAPI builds.Also applies to: 57-61
crates/lakekeeper/src/service/tasks/tabular_purge_queue.rs (1)
17-26: Consistent OpenAPI gating.Matches the pattern used in expiration queue; safe for non-OpenAPI builds.
Also applies to: 45-47
crates/lakekeeper/src/api/router.rs (1)
47-55: Swagger wiring and API spec loading are cleanly gated.
- Using
#[cfg(feature = "open-api")]for both v1_api_doc and ICEBERG spec is correct.- Taking
&[&QueueApiConfig]avoids unnecessary allocs at call sites.Also applies to: 276-301
crates/lakekeeper/src/service/identifier/tabular.rs (1)
16-22: OpenAPI gating looks correct for TabularId.The cfg_attr wrappers for ToSchema and per-variant value_type avoid open-api dependency when the feature is off. Good change.
crates/lakekeeper/src/service/storage/gcs/mod.rs (1)
48-60: Good feature-gating of OpenAPI metadata.Moving ToSchema derives and schema(title) under cfg_attr cleanly decouples open-api. No further changes needed here.
Also applies to: 84-85, 92-92, 95-97
crates/lakekeeper/src/service/storage/mod.rs (1)
41-43: Consistent cfg_attr gating across profiles and credentials.Derives and schema titles are correctly conditional. This should let builds without open-api skip utoipa cleanly.
Also applies to: 50-58, 64-66, 843-846, 862-862, 880-880, 908-908
crates/lakekeeper/src/api/management/v1/server.rs (2)
14-16: OpenAPI derives correctly gated.BootstrapRequest, LicenseStatus, and ServerInfo now derive ToSchema only behind open-api. The field-level schema on default_project_id is also properly gated.
Also applies to: 57-59, 83-85, 97-97
44-46: LazyLock path normalization is fine.Using std::sync::LazyLock directly is clear and avoids extra imports.
crates/authz-openfga/src/check.rs (1)
31-39: Gate all utoipa attributes and derives in check.rs with cfg_attr(feature = "open-api", ...).Verification confirms the identified issues: all six items on lines 31, 319, 355, 375, 398, and 408 are unconditionally referencing utoipa, which will break builds when the
open-apifeature is disabled. The provided diffs are correct and address each instance.However, the codebase scan reveals the same issue exists beyond check.rs:
- crates/authz-openfga/src/api.rs: 23
#[utoipa::path(...)]attributes and 25#[derive(..., utoipa::ToSchema)]derives are un-gated (note: field-levelcfg_attrexist but not derive-level)- crates/iceberg-ext/src/catalog/rest/error.rs: 2 un-gated
utoipa::ToSchemaderivesIf this PR modifies those files, the review scope appears incomplete. Confirm PR scope and apply gating uniformly across the crate.
crates/lakekeeper/src/service/tasks/mod.rs (2)
79-93: Conditional ToSchema on TaskEntity looks correct.cfg_attr usage on the enum and per-field schema(value_type) keeps runtime clean with the feature off.
28-36: MSRV verification confirms LazyLock compatibility.The workspace declares
rust-version = "1.87.0"in the rootCargo.toml, which exceeds the minimum requirement forstd::sync::LazyLock(stabilized in Rust 1.80.0). No issues found.crates/lakekeeper/src/api/management/mod.rs (1)
15-33: Nice conditional exposure of api_doc.openapi module and re-export are properly gated; keeps surface minimal when docs are off.
crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (2)
752-761: IntoParams/ToSchema gating looks consistent.Nice application of cfg_attr to query structs and responses.
333-357: No issues found after verification.The implementation is correct and exhaustively handles all storage profile variants. Each same-type comparison delegates to the corresponding per-type overlap implementation (S3, Azure, GCS), while cross-variant comparisons correctly return false since overlap is only possible between the same storage provider. Rust's exhaustive pattern matching ensures no variants are missed at compile time.
crates/lakekeeper/src/service/storage/s3.rs (1)
237-264: Review comment verified and resolved.The
storage_profile.normalize(storage_credential.as_ref())?;call at warehouse/mod.rs line 335 executes immediately before the overlap check at line 344. The only production call site tois_overlapping_locationis in the warehouse creation endpoint, where the incoming profile is guaranteed to be normalized prior to any comparison. Existing warehouse profiles in the database are also normalized by the same normalization path when they were created. The method's assumption thatkey_prefixvalues are normalized (no leading/trailing slashes) is satisfied.
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
crates/authz-openfga/src/relations.rs (4)
100-104: Fix format capture and expected types in UnexpectedEntity.
format!("... {type}")won’t resolve (notypein scope) and the expected types omitFgaType::Role.Apply:
- _ => Err(OpenFGAError::UnexpectedEntity { - r#type: vec![FgaType::User], - value: id.to_string(), - reason: format!("Expected user or role type, but got {type}"), - }), + _ => Err(OpenFGAError::UnexpectedEntity { + r#type: vec![FgaType::User, FgaType::Role], + value: id.to_string(), + reason: format!("Expected user or role type, but got {}", r#type), + }),
537-540: Use tuple variant patternsVariant(_)instead of struct patterns{ .. }.These variants are newtype/tuple;
{ .. }will not compile.Apply:
- ProjectAssignment::Describe { .. } => APIProjectRelation::Describe, - ProjectAssignment::Select { .. } => APIProjectRelation::Select, - ProjectAssignment::Create { .. } => APIProjectRelation::Create, - ProjectAssignment::Modify { .. } => APIProjectRelation::Modify, + ProjectAssignment::Describe(_) => APIProjectRelation::Describe, + ProjectAssignment::Select(_) => APIProjectRelation::Select, + ProjectAssignment::Create(_) => APIProjectRelation::Create, + ProjectAssignment::Modify(_) => APIProjectRelation::Modify,- WarehouseAssignment::PassGrants { .. } => APIWarehouseRelation::PassGrants, - WarehouseAssignment::ManageGrants { .. } => APIWarehouseRelation::ManageGrants, - WarehouseAssignment::Describe { .. } => APIWarehouseRelation::Describe, - WarehouseAssignment::Select { .. } => APIWarehouseRelation::Select, - WarehouseAssignment::Create { .. } => APIWarehouseRelation::Create, - WarehouseAssignment::Modify { .. } => APIWarehouseRelation::Modify, + WarehouseAssignment::PassGrants(_) => APIWarehouseRelation::PassGrants, + WarehouseAssignment::ManageGrants(_) => APIWarehouseRelation::ManageGrants, + WarehouseAssignment::Describe(_) => APIWarehouseRelation::Describe, + WarehouseAssignment::Select(_) => APIWarehouseRelation::Select, + WarehouseAssignment::Create(_) => APIWarehouseRelation::Create, + WarehouseAssignment::Modify(_) => APIWarehouseRelation::Modify,- NamespaceAssignment::PassGrants { .. } => APINamespaceRelation::PassGrants, - NamespaceAssignment::ManageGrants { .. } => APINamespaceRelation::ManageGrants, - NamespaceAssignment::Describe { .. } => APINamespaceRelation::Describe, - NamespaceAssignment::Select { .. } => APINamespaceRelation::Select, - NamespaceAssignment::Create { .. } => APINamespaceRelation::Create, - NamespaceAssignment::Modify { .. } => APINamespaceRelation::Modify, + NamespaceAssignment::PassGrants(_) => APINamespaceRelation::PassGrants, + NamespaceAssignment::ManageGrants(_) => APINamespaceRelation::ManageGrants, + NamespaceAssignment::Describe(_) => APINamespaceRelation::Describe, + NamespaceAssignment::Select(_) => APINamespaceRelation::Select, + NamespaceAssignment::Create(_) => APINamespaceRelation::Create, + NamespaceAssignment::Modify(_) => APINamespaceRelation::Modify,- TableAssignment::PassGrants { .. } => APITableRelation::PassGrants, - TableAssignment::ManageGrants { .. } => APITableRelation::ManageGrants, - TableAssignment::Describe { .. } => APITableRelation::Describe, - TableAssignment::Select { .. } => APITableRelation::Select, - TableAssignment::Modify { .. } => APITableRelation::Modify, + TableAssignment::PassGrants(_) => APITableRelation::PassGrants, + TableAssignment::ManageGrants(_) => APITableRelation::ManageGrants, + TableAssignment::Describe(_) => APITableRelation::Describe, + TableAssignment::Select(_) => APITableRelation::Select, + TableAssignment::Modify(_) => APITableRelation::Modify,- ViewAssignment::PassGrants { .. } => APIViewRelation::PassGrants, - ViewAssignment::ManageGrants { .. } => APIViewRelation::ManageGrants, - ViewAssignment::Describe { .. } => APIViewRelation::Describe, - ViewAssignment::Modify { .. } => APIViewRelation::Modify, + ViewAssignment::PassGrants(_) => APIViewRelation::PassGrants, + ViewAssignment::ManageGrants(_) => APIViewRelation::ManageGrants, + ViewAssignment::Describe(_) => APIViewRelation::Describe, + ViewAssignment::Modify(_) => APIViewRelation::Modify,Also applies to: 779-785, 1056-1061, 1275-1279, 1484-1487
371-376: Wrong mapping: CanListUsers → CanListAllProjects.This should map to
ServerRelation::CanListUsers.Apply:
- CatalogServerAction::CanListUsers => ServerRelation::CanListAllProjects, + CatalogServerAction::CanListUsers => ServerRelation::CanListUsers,
1001-1008: GrantableRelation for Namespace: use grant actions for Create/Modify.Grant mapping should use
CanGrantCreate/CanGrantModify, notCanCreateNamespace/CanUpdateProperties.Apply:
- APINamespaceRelation::Create => NamespaceRelation::CanCreateNamespace, - APINamespaceRelation::Modify => NamespaceRelation::CanUpdateProperties, + APINamespaceRelation::Create => NamespaceRelation::CanGrantCreate, + APINamespaceRelation::Modify => NamespaceRelation::CanGrantModify,
🧹 Nitpick comments (6)
crates/lakekeeper/src/service/tasks/task_registry.rs (1)
306-314: Consider feature-aware Debug formatting for clarity.When the
open-apifeature is disabled, the Debug output will showutoipa_type_name: (), which may be confusing. Consider using conditional compilation to customize the Debug output or omit these fields when the feature is disabled.Example approach:
impl std::fmt::Debug for QueueApiConfig { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - f.debug_struct("QueueApiConfig") + let mut debug_struct = f.debug_struct("QueueApiConfig"); + debug_struct .field("queue_name", &self.queue_name) + #[cfg(feature = "open-api")] .field("utoipa_type_name", &self.utoipa_type_name) + #[cfg(feature = "open-api")] .field("utoipa_schema", &"<schema>") - .finish() + .finish(); } }crates/lakekeeper-bin/src/main.rs (3)
11-11: Avoid coupling to re-exports for proc-macro paths (optional).Importing
tokio/tracingvialakekeeperworks, but it tightly couples the bin to those re-exports. Prefer direct crate paths for macro attributes and macros to reduce break risk if re-exports change.Example:
-use lakekeeper::{tokio, tracing, CONFIG}; +use lakekeeper::CONFIG; // rely on direct crates in paths: #[tokio::main], tracing::info!If the bin intentionally relies on re-exports for version pinning, keep as-is.
160-166: Avoid the intermediate Vec allocation if the API accepts a slice/iterator.You build
Vec<&_>from a static collection, then immediately borrow it. Ifapi_doccan take a slice or iterator, pass the static directly to avoid allocation.Option A (if
api_docaccepts a slice):- let queue_configs_ref = &lakekeeper::service::tasks::BUILT_IN_API_CONFIGS; - let queue_configs: Vec<&_> = queue_configs_ref.iter().collect(); - let doc = match &CONFIG.authz_backend { - AuthZBackend::AllowAll => api_doc::<AllowAllAuthorizer>(&queue_configs), + let queue_configs = &lakekeeper::service::tasks::BUILT_IN_API_CONFIGS; + let doc = match &CONFIG.authz_backend { + AuthZBackend::AllowAll => api_doc::<AllowAllAuthorizer>(queue_configs), AuthZBackend::External(e) if e == "openfga" => { - api_doc::<OpenFGAAuthorizer>(&queue_configs) + api_doc::<OpenFGAAuthorizer>(queue_configs) }Option B (if it accepts
IntoIterator<Item = &...>): passlakekeeper::service::tasks::BUILT_IN_API_CONFIGS.iter()directly.
162-168: Slightly clearer error for unsupported backends (optional).Consider listing supported values in the error to aid users.
- AuthZBackend::External(e) => anyhow::bail!("Unsupported authz backend `{e}`"), + AuthZBackend::External(e) => { + anyhow::bail!("Unsupported authz backend `{e}`. Supported: `openfga`.") + }crates/lakekeeper/src/api/router.rs (2)
148-150: Avoid temporary Vec<&T> allocation.Consider taking &[QueueApiConfig] in maybe_merge_swagger_router (and v1_api_doc) to pass registered_api_config.as_slice() directly. Keeps zero alloc and simpler lifetimes.
47-54: Path robustness improvement forinclude_str!— optional refactor.The code is safe;
LazyLockis stable at MSRV 1.87.0. However, consider usingconcat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/docs/api/rest-catalog-open-api.yaml")withinclude_str!to anchor the path to the crate root and improve maintainability, avoiding brittle relative paths that break if directory structure changes.#[cfg(feature = "open-api")] static ICEBERG_OPENAPI_SPEC_YAML: std::sync::LazyLock<serde_json::Value> = std::sync::LazyLock::new(|| { let mut yaml_str = include_str!(concat!( env!("CARGO_MANIFEST_DIR"), "/../../docs/docs/api/rest-catalog-open-api.yaml" )) .to_string(); yaml_str = yaml_str.replace(" /v1/", " /catalog/v1/"); serde_norway::from_str(&yaml_str).expect("Failed to parse Iceberg API model V1 as JSON") });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
crates/authz-openfga/Cargo.toml(2 hunks)crates/authz-openfga/src/api.rs(61 hunks)crates/authz-openfga/src/authorizer.rs(3 hunks)crates/authz-openfga/src/check.rs(5 hunks)crates/authz-openfga/src/relations.rs(20 hunks)crates/lakekeeper-bin/Cargo.toml(1 hunks)crates/lakekeeper-bin/src/main.rs(3 hunks)crates/lakekeeper/src/api/management/v1/openapi.rs(1 hunks)crates/lakekeeper/src/api/management/v1/warehouse/mod.rs(10 hunks)crates/lakekeeper/src/api/router.rs(7 hunks)crates/lakekeeper/src/service/tasks/task_registry.rs(5 hunks)crates/lakekeeper/src/tests/tasks.rs(2 hunks)docs/docs/api/management-open-api.yaml(2 hunks)justfile(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- crates/authz-openfga/Cargo.toml
- crates/lakekeeper-bin/Cargo.toml
- crates/lakekeeper/src/api/management/v1/openapi.rs
- justfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: check-generated-openapi-matches
- GitHub Check: test
- GitHub Check: sqlx-check
- GitHub Check: clippy
- GitHub Check: security_audit
- GitHub Check: security_audit
🔇 Additional comments (17)
crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (1)
44-59: LGTM! Feature-gating is consistently applied.All OpenAPI derives and schema attributes have been correctly moved behind
cfg_attr(feature = "open-api", ...). The pattern is consistent across all structs, and the previous review comment regardingvalue_type=i64forexpiration_seconds(Line 111) has been addressed.Also applies to: 74-95, 97-114, 148-155, 157-171, 173-188, 190-196, 198-203, 205-211, 213-232, 234-240, 242-249, 257-273, 275-285, 287-293, 1110-1116, 1118-1121, 1123-1129, 1131-1139
crates/lakekeeper/src/service/tasks/task_registry.rs (5)
1-1: LGTM: Import cleanup is correct.The removal of
Cowfrom direct imports is appropriate since it's now only used within a feature-gated context with a fully qualified path (std::borrow::Cow<'static, str>at line 296).
148-160: LGTM: Feature-gated initialization is correct.The conditional compilation branches are mutually exclusive and correctly initialize the OpenAPI-related fields based on the feature flag. The types align with the
QueueApiConfigstruct definition.
288-304: LGTM: Feature-gated struct fields are well-designed.The conditional field types using unit types
()when the feature is disabled is a clean pattern that maintains struct layout and API consistency. The public fields changing types based on the feature flag is an expected consequence of feature-gating OpenAPI functionality.
337-355: LGTM: Conditional test derives are implemented correctly.Using
cfg_attr(feature = "open-api", derive(utoipa::ToSchema))is the idiomatic approach for feature-gated derives in test code. This ensures tests compile correctly regardless of whether theopen-apifeature is enabled.
288-288: Past review concern has been addressed.The previous review comment requested removing the
typed_builder::TypedBuilderderive from this struct. The current code shows only#[derive(Clone)], confirming this has been resolved.docs/docs/api/management-open-api.yaml (2)
150-160: Example formatting change in GetEndpointStatistics documentation.Line 154 restructures the endpoint statistics example from an inline object format to a YAML list item format (with leading dash). This appears to be a documentation/readability improvement rather than a functional change to the API schema.
4799-4801: The Rust source code reveals that theexpiration_secondsfield has an explicit utoipa schema attribute#[cfg_attr(feature = "open-api", schema(value_type=i64))], which directly instructs the OpenAPI generator to usei64format. The YAML output at lines 4799-4801 matches this configuration exactly.However, I cannot definitively confirm whether this represents a breaking change without seeing what the field format was before this PR. The git history shows a recent commit "chore: Introduce open-api feature to gate utoipa and swagger", suggesting the OpenAPI spec was recently refactored.
Key findings:
- The int64 format is intentional in the Rust source (not accidental)
- The Rust type is
chrono::Durationbut explicitly serializes asi64seconds- The database already stores this as
Option<i64>To verify if this is truly a breaking change, you need to check the PR diff to confirm: was the
expiration-secondsfield previously documented asformat: int32in the YAML, or is this the first OpenAPI documentation of this field as int64?If the field was previously int32, treat as breaking per web guidance and document migration steps for consumers. If this is newly documented or already was int64, no action needed.
crates/lakekeeper-bin/src/main.rs (2)
100-103: Good feature gating of the CLI subcommand.
ManagementOpenapiis cleanly hidden when--features open-apiis off; clap derives handle this well.Please update docs/README to note the subcommand is available only with the
open-apifeature.
155-159: No dependency wiring issues found—code is correctly configured.The base
lakekeeper_authz_openfgacrate is listed as an unconditional dependency incrates/lakekeeper-bin/Cargo.toml, not tied to theopen-apifeature. Theopen-apifeature only controls theopen-apifeature of the authz-openfga crate itself, not its presence.The
crates/lakekeeper-bin/src/authorizer.rsfile imports and uses OpenFGAAuthorizer unconditionally, with runtime selection determined byOPENFGA_CONFIG.is_openfga_enabled(), meaning runtime authz does not depend on theopen-apifeature. Only the doc generation code in main.rs (lines 153–159) is guarded by#[cfg(feature = "open-api")].The dependency is correctly wired: the base crate is always available for runtime use, and only documentation generation is feature-gated.
crates/lakekeeper/src/tests/tasks.rs (1)
34-36: Good use of cfg_attr for OpenAPI derives.Keeps tests compiling cleanly without the feature and avoids unconditional utoipa deps.
If not already, ensure the crate’s Cargo.toml enables utoipa only under the "open-api" feature for dev builds.Also applies to: 44-46
crates/lakekeeper/src/api/router.rs (1)
276-301: Swagger wiring correctly feature-gated.Nice separation; no code paths compile in without "open-api".
crates/authz-openfga/src/api.rs (1)
24-26: Consistent feature-gating of OpenAPI derives and paths.The shift to cfg_attr across IntoParams/ToSchema and path macros is clean and keeps runtime unaffected when disabled.
Also applies to: 46-48, 352-364, 792-1390
crates/authz-openfga/src/check.rs (1)
31-39: OpenAPI annotations properly gated; runtime unchanged.Attributes and schema hints are conditionally compiled; endpoints remain intact.
Also applies to: 319-419
crates/authz-openfga/src/authorizer.rs (1)
28-30: OpenAPI surface correctly gated on the feature — verification complete.All three locations (import at lines 28-30, trait declaration in mod.rs, and impl at lines 85-88) are consistently gated on
feature = "open-api". The import-as-underscore pattern correctly avoids unused warnings, andapi_doc()compiles only when the feature is enabled. No impl/trait mismatch exists.crates/authz-openfga/src/relations.rs (2)
57-59: Confirm OpenAPI value_type for RoleAssignee.You expose
Roleasuuid::Uuid. If the wire format is not a bare UUID (e.g., includes a prefix or composite), this will mislead clients. Please confirm.
48-61: Gating OpenAPI metadata behindopen-apiis clean and consistent.Approach aligns with the PR goal; serde behavior remains unaffected when the feature is off.
Please ensure CI runs an
--all-featuresbuild to catch any missing imports/types referenced byschema(as=...).
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
crates/authz-openfga/src/api.rs (1)
186-190: Fully qualify the Uuid type in schema attribute.Line 188 uses
value_type = Uuidwithout full qualification. As noted in previous reviews, utoipa may fail to resolve this type without the full path.Apply this diff:
- #[cfg_attr(feature = "open-api", schema(value_type = Uuid))] + #[cfg_attr(feature = "open-api", schema(value_type = uuid::Uuid))] project_id: ProjectId,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
crates/authz-openfga/src/api.rs(61 hunks)crates/authz-openfga/src/relations.rs(20 hunks)docs/docs/api/management-open-api.yaml(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/docs/api/management-open-api.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: test
- GitHub Check: clippy
- GitHub Check: check-generated-openapi-matches
- GitHub Check: sqlx-check
🔇 Additional comments (3)
crates/authz-openfga/src/api.rs (1)
24-25: Consistent and thorough OpenAPI feature gating.The feature gating is systematically applied across imports, derives, and attributes. All OpenAPI-related metadata is properly moved behind the
open-apifeature while preserving runtime behavior when disabled.Also applies to: 46-47, 54-55, 90-91, 1323-1381
crates/authz-openfga/src/relations.rs (2)
48-61: Correct use of fully qualified type paths in OpenAPI schemas.The schema attributes properly use fully qualified paths (e.g.,
uuid::Uuidon line 57 andStringon line 54), ensuring utoipa can resolve types correctly when the feature is enabled.Also applies to: 146-163, 202-214
278-295: Comprehensive and consistent feature gating across all relation types.All relation, assignment, and action types have been systematically updated with feature-gated OpenAPI derives and schema attributes. The pattern is uniform, schema titles match variant names, and the implementation preserves all runtime behavior.
Also applies to: 434-469, 684-719, 961-996, 1191-1220, 1408-1434
✅ PR Title Formatted CorrectlyThe title of this PR match the correct format. Thank you! |
* feat: Publish images to Dockerhub (lakekeeper#1274) * feat: Update UI to 0.9.0 with multi-project support (lakekeeper#1275) * chore: release 0.9.4 Release-As: 0.9.4 * chore: release main (lakekeeper#1262) * chore(ci): Fix Dockerhub login * chore(docs): Improve developer guide (lakekeeper#1265) * chore(docs): add info regarding `view_version`'s internal representation (lakekeeper#1261) * chore(docs): Architecture clarify Secret Store (lakekeeper#1284) * fix: Update Limes to 0.2.2 - Fixes compilation issue due to breaking `jwks_client_rs` change (lakekeeper#1282) * fix: Update Limes to 0.2.2 * increase min rust version * chore: release 0.9.5 Release-As: 0.9.5 * chore: release main (lakekeeper#1286) * chore: enable changelog sections for release-please (lakekeeper#1264) k * fix(deps): update rust crate rand to v0.9.2 (lakekeeper#1252) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate async-channel to v2.5.0 (lakekeeper#1225) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency mkdocs-material to v9.6.17 (lakekeeper#1289) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate anyhow to v1.0.99 (lakekeeper#1290) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: Remove bitnami images (lakekeeper#1288) * feat!: Move to Lakekeeper IO based on hyperscaler SDKs (lakekeeper#1285) * chore(deps): update rust crate reqwest to v0.12.23 (lakekeeper#1294) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(docs): Improve Cloud storage test docs * fix: accept "disable" as PG sslmode as documented (lakekeeper#1303) * feat: Simplify task interface, re-exports, enable delete-after-commit (lakekeeper#1302) * feat: Introduce `RequestMetadata` for Internal Principals which bypass AuthZ (lakekeeper#1306) * chore(deps): update azure/setup-helm action to v4.3.1 (lakekeeper#1299) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(test): use nextest filterset instead of needs_env_var (lakekeeper#1304) * chore(deps): update rust crate openssl-src to v300.5.2 (lakekeeper#1292) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate async-compression to v0.4.28 (lakekeeper#1311) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate thiserror to v2.0.16 (lakekeeper#1296) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Provide `ApiContext` to externally registered tasks (lakekeeper#1307) * feat!: Simplify Task interface, extend SpecializedTask interface (lakekeeper#1310) * feat: Improve authorizer `are_allowed_*` batch check signature (lakekeeper#1315) * chore(authz): Enforce use of AuthZ decisions with #[must_use] (lakekeeper#1317) * feat: Task Management APIs (lakekeeper#1316) * chore(deps): update rust crate tracing-subscriber to v0.3.20 [security] (lakekeeper#1318) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Add `RunNow` and `RunAt` to Controls for Tasks (lakekeeper#1322) * chore(deps): update rust crate tokio-util to v0.7.16 (lakekeeper#1313) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(docs): Improve Entra ID docs (lakekeeper#1325) * chore(docs): Improve Upgrades & Migration docs (lakekeeper#1326) * feat: Add tasks heartbeat with Catalog state (lakekeeper#1324) * ci: add configuration for CodeRabbit reviews (lakekeeper#1327) * feat: Add optional STS session-tags in S3 STS requests for ABAC authorization (lakekeeper#1230) * feat: Random Server IDs (lakekeeper#1328) * chore(deps): update rust crate percent-encoding to v2.3.2 (lakekeeper#1312) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat(authz): Deprecate Permission Endpoints for Tables without WarehouseIDs (lakekeeper#1334) * fix: Tasks endpoints in router (lakekeeper#1335) * feat(ci): add nextest profile ci_no_secrets for external PRs (lakekeeper#1333) * chore(deps): update rust crate chrono to v0.4.42 (lakekeeper#1331) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: Pin examples duckdb version to 1.3 (lakekeeper#1343) * feat!: Require warehouse_id when checking permissions on views or tables via ID (lakekeeper#1340) * fix: migrate away from bitnami in unittest.yml (lakekeeper#1344) * chore: Remove coderabitt config * fix(docs): Fix inconsistent URL format in README (lakekeeper#1345) Co-authored-by: Christian <[email protected]> * feat: Remove serde_yaml & serde_yml (lakekeeper#1341) * feat!: add `warehouse_id` to PKs of all `table_*` and `view_*` tables (lakekeeper#1254) * feat: Minor namespace join performance improvements * fix: Warehouse permissions are directly used for task retrieval & control (lakekeeper#1347) * fix: Potential Race Condition when undropping Tabulars (lakekeeper#1342) * fix: table rename authz and error handling (lakekeeper#1346) Co-authored-by: Andre Luis Anastacio <[email protected]> * chore(deps): update rust crate google-cloud-auth to v1.1.2 (lakekeeper#1337) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update rust crate time to v0.3.44 (lakekeeper#1349) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency mkdocs-material to v9.6.20 (lakekeeper#1309) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * feat: Set ServerID during migration (lakekeeper#1348) * chore(deps): Remove utoipa fork (lakekeeper#1352) * chore(deps): update rust crate serde_with to v3.14.1 (lakekeeper#1351) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate url to v2.5.7 (lakekeeper#1354) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate async-compression to v0.4.30 (lakekeeper#1323) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update rust crate serde_json to v1.0.145 (lakekeeper#1250) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update strum monorepo to v0.27.2 (lakekeeper#1251) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update serde monorepo to v1.0.226 (lakekeeper#1355) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate clap to v4.5.48 (lakekeeper#1356) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Add Entity Names to Tasks (lakekeeper#1353) * fix: case insensitivity of catalog endpoints (lakekeeper#1338) * fix: Improve delete_warehouse error message for active tasks * chore(deps): update rust crate tempfile to v3.22.0 (lakekeeper#1359) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update rust crate axum-prometheus to 0.9.0 (lakekeeper#1358) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix: PgSslMode not supported error string * feat(authz)!: add OpenFGA schema v4 and v3->v4 migration (lakekeeper#1314) Co-authored-by: Christian <[email protected]> Co-authored-by: Christian Thiel <[email protected]> * chore(deps): update rust crate uuid to v1.18.1 (lakekeeper#1362) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency markdown-grid-tables to v0.6.0 (lakekeeper#1357) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate anyhow to v1.0.100 (lakekeeper#1350) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix: clippy * chore(deps): update rust crate moka to v0.12.11 (lakekeeper#1365) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate tempfile to v3.23.0 (lakekeeper#1367) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate async-nats to 0.43.0 (lakekeeper#1366) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/setup-node action to v5 (lakekeeper#1371) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/checkout action to v5 (lakekeeper#1369) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/setup-python action to v6 (lakekeeper#1372) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: V3 support (lakekeeper#1364) * chore: Set Get Task Permission to "CanGetMetadata" (lakekeeper#1376) * chore(deps): update dependency node to v22 (lakekeeper#1373) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat(authz)!: extend OpenFGA tabular entities with WarehouseId (lakekeeper#1329) --------- Co-authored-by: Christian <[email protected]> Co-authored-by: Christian Thiel <[email protected]> * feat: Add support for tasks affecting views (lakekeeper#1378) * feat(authz): Add specific Task Actions (lakekeeper#1379) * chore(tests): Test with Iceberg 1.9.2 & 1.10.0 (lakekeeper#1267) * feat: Enrich task metadata with concrete tabular type (lakekeeper#1383) * feat: Add loadTable Snapshots filter (lakekeeper#1385) * feat: add endpoint for fuzzy search of tabulars (lakekeeper#1387) * feat: Update UI to 0.10.0 (lakekeeper#1390) * feat(ui): Update UI to 0.10.1 * chore: Use lakekeeper re-exports in bin (lakekeeper#1391) * fix(tabular-search): distance and docs for `searchterm is uuid` (lakekeeper#1393) * chore(examples): Idempotent bucket creation in minimal example (lakekeeper#1386) In the case where you already have a bucket created, like the "examples" bucket, I ran into an issue where the createbuckets service fails, and this prevents lakekeeper from starting back up. This fix adds a simple minio flag to ignore buckets that already exist, making things even more user friendly * feat: Make number of workers spawned for Expiration & Purge configurable (lakekeeper#1395) * chore: release main (lakekeeper#1295) * chore: added gif to readme (lakekeeper#1396) * chore: remove unneded `#[allow(dead_code)]` (lakekeeper#1399) * fix: Use FnOnce for queue & service registration * Revert "fix: Use FnOnce for queue & service registration" This reverts commit 47b03a0. * chore(docs): Add 0.10 docs * perf(db): remove `join namespace` from `active_tabulars` view (lakekeeper#1401) * doc(db): how to connect to db and inspect schema (lakekeeper#1402) * feat: implement `OpenFgaEntity` for `ServerId` (lakekeeper#1394) * impl OpenFgaEntity * Use the implementation * fix: Use FnOnce for queue & service registration (lakekeeper#1404) * chore(deps): update dependency mkdocs-material to v9.6.21 (lakekeeper#1406) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Expose client-managed X-Iceberg-Access-Delegation (lakekeeper#1407) * fix: Use higher consistency for some OpenFGA queries (lakekeeper#1408) * feat: Improve Kubernetes Auth docs (lakekeeper#1415) * chore: release 0.10.1 Release-As: 0.10.1 * fix: Endpoint stats for Project Endpoints (lakekeeper#1412) * feat: Add create table guard to cleanup location on Failure (lakekeeper#1418) * chore: Generate ID types with Macro (lakekeeper#1419) * chore: Re-Export Tokio from lakekeeper-io create (lakekeeper#1420) * fix: Add support for `write.metadata.metrics.` Table Properties (lakekeeper#1422) * fix: Update UI to 0.10.2 (lakekeeper#1423) * chore: release main (lakekeeper#1403) * fix: Parse empty ProjectID headers as None (lakekeeper#1424) * chore: release 0.10.2 Release-As: 0.10.2 * chore: release main (lakekeeper#1425) * feat: Add `debug_migrate_before_serve` env var (lakekeeper#1426) * feat: Move OpenFGA Authorizer to separate crate (lakekeeper#1421) * chore(renovate): Group dependencies * chore(renovate): ignore additional deps * chore: Rename src/service -> src/server, trait Catalog -> CatalogStore (lakekeeper#1428) * feat(examples): add k8s iceberg sink connector (avro) (lakekeeper#1336) --------- Co-authored-by: Christian <[email protected]> * chore(ci): Fix release please (lakekeeper#1433) * feat: Expose License Information via API (lakekeeper#1432) * fix(deps): update all non-major dependencies (lakekeeper#1429) * chore(ci): Remove mgmt API version update via release-please * chore: Restructure catalog_store into multiple modules (lakekeeper#1434) * feat: Validate Downscoping works on Warehouse creation (lakekeeper#1437) * chore(ci): Fix release please * docs: Add info about installing sqlx to developer-guide.md (lakekeeper#1438) * docs: Update developer-guide.md (lakekeeper#1439) * chore(deps): update all non-major dependencies (lakekeeper#1436) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix: Better normalization for ARNs in S3 Profile (lakekeeper#1441) * chore(deps): update all non-major dependencies (lakekeeper#1442) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(main): release 0.10.3 (lakekeeper#1427) * fix: Release Please CI outputs * fix(ci): Revert 0.10.3 release * chore(main): release 0.10.3 (lakekeeper#1446) * feat: Introduce CatalogWarehouseOps & CatalogNamespaceOps abstractions (lakekeeper#1440) * feat: Allow x-user-agent header (lakekeeper#1453) * feat: Table & View Ops Abstractions, Improved Error Handling (lakekeeper#1454) * fix: CORS allow access delegation & etag headers (lakekeeper#1455) * fix: Headers should be lowercase (lakekeeper#1457) * chore(tests): Add trino information_schema.tables test (lakekeeper#1456) * chore: Introduce open-api feature to gate utoipa and swagger (lakekeeper#1458) * chore: Release As 0.11 * fix: Debug assertion table identifier mismatch for signer (lakekeeper#1460) * feat: Caching Short-Term-Credentials (STC) (lakekeeper#1459) * feat: Warehouse Cache (lakekeeper#1462) * chore(deps): update actions/setup-node action to v6 (lakekeeper#1443) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Version based Warehouse Cache (lakekeeper#1465) * feat: AuthZ Server and Project Ops (lakekeeper#1471) * chore(deps): update github artifact actions (lakekeeper#1461) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: Rename release branch pattern to rel-* * feat: Catalog returns full Namespace Hierarchy for nested Namespaces (lakekeeper#1472) --------- Co-authored-by: Christian <[email protected]> Co-authored-by: Christian Thiel <[email protected]> Co-authored-by: Dao Thanh Tung <[email protected]> Co-authored-by: Moritz Zielke <[email protected]> Co-authored-by: Baptiste Gouhoury <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Dolan Antenucci <[email protected]> Co-authored-by: Anatoly Popov <[email protected]> Co-authored-by: Andre Luis Anastacio <[email protected]> Co-authored-by: Scott Haines <[email protected]> Co-authored-by: Viktor Kessler <[email protected]> Co-authored-by: Yohan Valencia <[email protected]> Co-authored-by: Paul Roman <[email protected]>
Summary by CodeRabbit
New Features
Changes
Documentation