Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: server-side payload filters #435

Merged
merged 9 commits into from
Sep 4, 2024

Conversation

cwaldren-ld
Copy link
Contributor

@cwaldren-ld cwaldren-ld commented Sep 3, 2024

This PR introduces Payload Filters to the C++ Server-Side SDK. The filter key can be configured individually on the Streaming or Polling data sources.

If an invalid key is provided (empty or not matching regex), a runtime error will be logged at the time of data source construction. The SDK will then request an unfiltered environment as a failsafe.

e2e testing:

  • Manual test (streaming): valid filter key
  • Manual test (streaming): invalid filter key (empty, malformed)
  • Manual test (polling): valid filter key
  • Manual test (polling): invalid filter key (empty, malformed)

@cwaldren-ld cwaldren-ld force-pushed the cw/sc-253807/payload-filters-round2 branch from dbfde41 to c6fa406 Compare September 3, 2024 20:41
@@ -6,7 +6,6 @@
#include "nlohmann/json.hpp"

namespace nlohmann {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Formatter inserted these newlines. The main changes are in Config[Streaming|Polling]Params adding the new filter key param.

@cwaldren-ld cwaldren-ld force-pushed the cw/sc-253807/payload-filters-round2 branch from c6fa406 to a9ffde2 Compare September 3, 2024 21:06
@cwaldren-ld cwaldren-ld force-pushed the cw/sc-253807/payload-filters-round2 branch from a9ffde2 to c7c254c Compare September 3, 2024 21:08
@cwaldren-ld cwaldren-ld marked this pull request as ready for review September 3, 2024 22:26
@cwaldren-ld cwaldren-ld requested a review from a team as a code owner September 3, 2024 22:26
}
try {
return regex_search(filter_key,
boost::regex("^[a-zA-Z0-9][._\\-a-zA-Z0-9]*$"));
Copy link
Member

Choose a reason for hiding this comment

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

I think we should try to keep these regexes the same and \w more concisely represents A-Za-z0-9_.

@cwaldren-ld cwaldren-ld merged commit aaff0b8 into main Sep 4, 2024
23 checks passed
@cwaldren-ld cwaldren-ld deleted the cw/sc-253807/payload-filters-round2 branch September 4, 2024 18:25
@github-actions github-actions bot mentioned this pull request Sep 4, 2024
cwaldren-ld pushed a commit that referenced this pull request Sep 4, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>launchdarkly-cpp-client: 3.6.4</summary>

##
[3.6.4](launchdarkly-cpp-client-v3.6.3...launchdarkly-cpp-client-v3.6.4)
(2024-09-04)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * launchdarkly-cpp-internal bumped from 0.8.1 to 0.8.2
    * launchdarkly-cpp-common bumped from 1.7.0 to 1.8.0
</details>

<details><summary>launchdarkly-cpp-common: 1.8.0</summary>

##
[1.8.0](launchdarkly-cpp-common-v1.7.0...launchdarkly-cpp-common-v1.8.0)
(2024-09-04)


### Features

* server-side payload filters
([#435](#435))
([aaff0b8](aaff0b8))
</details>

<details><summary>launchdarkly-cpp-internal: 0.8.2</summary>

##
[0.8.2](launchdarkly-cpp-internal-v0.8.1...launchdarkly-cpp-internal-v0.8.2)
(2024-09-04)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * launchdarkly-cpp-common bumped from 1.7.0 to 1.8.0
</details>

<details><summary>launchdarkly-cpp-server: 3.6.0</summary>

##
[3.6.0](launchdarkly-cpp-server-v3.5.3...launchdarkly-cpp-server-v3.6.0)
(2024-09-04)


### Features

* server-side payload filters
([#435](#435))
([aaff0b8](aaff0b8))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * launchdarkly-cpp-internal bumped from 0.8.1 to 0.8.2
    * launchdarkly-cpp-common bumped from 1.7.0 to 1.8.0
</details>

<details><summary>launchdarkly-cpp-server-redis-source: 2.1.12</summary>

##
[2.1.12](launchdarkly-cpp-server-redis-source-v2.1.11...launchdarkly-cpp-server-redis-source-v2.1.12)
(2024-09-04)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * launchdarkly-cpp-server bumped from 3.5.3 to 3.6.0
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants