You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "DerGut (via GitHub)" <gi...@apache.org> on 2026/08/06 18:42:59 UTC

[PR] refactor: Move SensitiveBytes and Credential into shared module [iceberg-rust]

DerGut opened a new pull request, #2971:
URL: https://github.com/apache/iceberg-rust/pull/2971

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   This is derived from a thread in https://github.com/apache/iceberg-rust/pull/2836#discussion_r3684663264 and from @plusplusjiajia's original implementation on https://github.com/apache/iceberg-rust/pull/2838. There's three issues I see with the freshly introduced `iceberg::catalog::session::Credential` type:
   1. the naming of `Credential` already exists in the context of credential vending (see [`iceberg_catalog_rest::StorageCredential`](https://github.com/apache/iceberg-rust/blob/f28ae7dca60904a5f135f3b6eecb03b09032b581/crates/catalog/rest/src/types.rs#L240) - but in Java it's plain [`Credential`](https://github.com/apache/iceberg/blob/c9afdc64f41e42d4601fb3aa02ebe8cd785f453a/core/src/main/java/org/apache/iceberg/rest/credentials/Credential.java#L26)). A new `Credential` concept meaning "any sensitive string" conflicts with it
   2. use cases exist for a sensitive string type outside of catalog credentials, like FileIO properties (e.g. `s3.session-token`): `iceberg::catalog` is the wrong place to share it
   3. The existing (and analogous) [`iceberg::encryption::SensitiveBytes`](https://github.com/apache/iceberg-rust/blob/f28ae7dca60904a5f135f3b6eecb03b09032b581/crates/iceberg/src/encryption/crypto.rs#L46) type is located somewhere completely different, making it non-obvious that both exists and share semantics
   
   ## What changes are included in this PR?
   
   This PR moves the recently introduced (and unreleased) `Credential` type to a separate `iceberg::sensitive` module and colocates it with the existing `iceberg::encryption::SensitiveBytes`. 
   
   ## Are these changes tested?
   
   I added two new tests to assert the redaction behavior of the `SensitiveBytes` type and a third test to assert that imports of `SensitiveBytes` by its old location remain backwards-compatible.
   
   ## AI Disclosure
   
   I used AI to rubber-duck approaches and rebase my PR onto latest main.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] refactor: Move SensitiveBytes and Credential into shared module [iceberg-rust]

Posted by "DerGut (via GitHub)" <gi...@apache.org>.
DerGut commented on code in PR #2971:
URL: https://github.com/apache/iceberg-rust/pull/2971#discussion_r3782246694


##########
crates/iceberg/src/encryption/crypto.rs:
##########
@@ -532,4 +484,11 @@ mod tests {
             "Encrypted portion should be plaintext length + 16-byte tag"
         );
     }
+
+    #[test]
+    fn test_backwards_compatible_sensitive_bytes_import() {
+        use crate::encryption::SensitiveBytes;
+
+        let _ = SensitiveBytes::new(&b"123"[..]);
+    }

Review Comment:
   You're right! I could still add a comment above the
   ```rust
   pub use crate::sensitive::SensitiveBytes;
   ```
   export, but in a sense the `public-api.txt` files already deal with this. Removing it for now 👍 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] refactor: Move SensitiveBytes and Credential into shared module [iceberg-rust]

Posted by "DerGut (via GitHub)" <gi...@apache.org>.
DerGut commented on code in PR #2971:
URL: https://github.com/apache/iceberg-rust/pull/2971#discussion_r3782261571


##########
crates/iceberg/src/encryption/crypto.rs:
##########
@@ -532,4 +484,11 @@ mod tests {
             "Encrypted portion should be plaintext length + 16-byte tag"
         );
     }
+
+    #[test]
+    fn test_backwards_compatible_sensitive_bytes_import() {
+        use crate::encryption::SensitiveBytes;
+
+        let _ = SensitiveBytes::new(&b"123"[..]);
+    }

Review Comment:
   Dropped in https://github.com/apache/iceberg-rust/pull/2971/commits/a5f58081b2bf2b4493b5b797055db502252599b1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] refactor: Move SensitiveBytes and Credential into shared module [iceberg-rust]

Posted by "CTTY (via GitHub)" <gi...@apache.org>.
CTTY merged PR #2971:
URL: https://github.com/apache/iceberg-rust/pull/2971


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] refactor: Move SensitiveBytes and Credential into shared module [iceberg-rust]

Posted by "xanderbailey (via GitHub)" <gi...@apache.org>.
xanderbailey commented on code in PR #2971:
URL: https://github.com/apache/iceberg-rust/pull/2971#discussion_r3742297832


##########
crates/iceberg/src/encryption/crypto.rs:
##########
@@ -532,4 +484,11 @@ mod tests {
             "Encrypted portion should be plaintext length + 16-byte tag"
         );
     }
+
+    #[test]
+    fn test_backwards_compatible_sensitive_bytes_import() {
+        use crate::encryption::SensitiveBytes;
+
+        let _ = SensitiveBytes::new(&b"123"[..]);
+    }

Review Comment:
   Not totally sure this test is adding a lot, we could remove it?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org