Unleash / unleash-client-rust

Unleash client SDK for Rust language projects
Apache License 2.0
23 stars 17 forks source link

feat: add support for `namePrefix`, `tags` and `project` filters #54

Open teqm opened 1 year ago

teqm commented 1 year ago

About the changes

Added missing support for feature filters, that is namePrefix, tags and project. According to https://docs.getunleash.io/reference/sdks#server-side-sdk-compatibility-table it's already present in some of the SDKs, so I suppose we can add it here as well. It's nothing "big", but in my experience (with node.js SDK) can be useful.

Important files

Discussion points

sighphyre commented 1 year ago

...but also, Clippy seems to have a few warnings here

teqm commented 1 year ago

As of today I haven't looked into these features at all, so I'm at a bit of a loss what this actually offers.

It adds a convenient way to filter the features - yeah I agree with you that it doesn't bring a lot of value, but if I'm not mistaken the tag filtering isn't possible to implement client side as this information isn't returned from the API.

When it comes to namePrefix and project then those can be done in a different way, namePrefix can be easily checked client side, and project can be limited with API token (you can select to which project(s) you want to give access to). I've added those two only to align with other SDKs (ref https://docs.getunleash.io/reference/sdks#server-side-sdk-compatibility-table).

If you feel like this isn't valuable, feel free to reject the PR - I can handle it :sweat_smile: