Skip to content

Conversation

@RobertIndie
Copy link
Contributor

Motivation

Bring apache/pulsar#24481 to Pulsar.Client

Please see more details in the PIP-432

@RobertIndie RobertIndie marked this pull request as ready for review July 30, 2025 10:51
@Lanayx Lanayx requested a review from Copilot July 30, 2025 11:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements PIP-432 by adding an isEncrypted field to the EncryptionContext type to indicate whether a message is actually encrypted or was decrypted successfully. This provides API consumers with visibility into the encryption state of messages.

  • Adds IsEncrypted boolean field to EncryptionContext type
  • Updates FromMetadata method to accept an isEncrypted parameter
  • Updates consumer implementation to pass encryption state through the message processing pipeline
  • Adds comprehensive test coverage to verify the IsEncrypted field behavior

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Pulsar.Client/Common/DTO.fs Adds IsEncrypted field to EncryptionContext and updates factory method
src/Pulsar.Client/Internal/ConsumerImpl.fs Updates message processing to track and pass encryption state
tests/IntegrationTests/MessageCrypto.fs Adds test function to verify IsEncrypted field and updates existing tests
Comments suppressed due to low confidence (1)

tests/IntegrationTests/MessageCrypto.fs:110

  • The test assumes all messages should be unencrypted (IsEncrypted = false) but doesn't test the case where messages are actually encrypted. Consider adding a separate test function to verify IsEncrypted = true for encrypted messages.
                    failwith $"Message {i} should not be encrypted, but IsEncrypted = true"

@Lanayx Lanayx merged commit 1eae9d1 into fsprojects:develop Jul 31, 2025
2 checks passed
RobertIndie added a commit to RobertIndie/pulsar-client-dotnet that referenced this pull request Jul 31, 2025
* PIP-432: Add isEncrypted field to EncryptionContext

* Add doc for EncryptionContext.IsEncrypted

(cherry picked from commit 1eae9d1)
Lanayx pushed a commit that referenced this pull request Jul 31, 2025
* PIP-432: Add isEncrypted field to EncryptionContext

* Add doc for EncryptionContext.IsEncrypted

(cherry picked from commit 1eae9d1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants