launchdarkly / ld-relay

LaunchDarkly Relay Proxy
Other
112 stars 80 forks source link

Flag Evaluation Route Returns All Flags #63

Closed zmckinnon closed 5 years ago

zmckinnon commented 5 years ago

I recently installed the ld-relay via docker and noticed that/sdk/evalx/{clientId}/users/{user} returns all flags instead of only client side flags.

Is this expected? When the client connects to https://app.launchdarkly.com, it only returns flags that have been marked as "Make this flag available to client-side SDKs", but when I access that route via the ld-relay, it returns all flags.

Is it possible to only return client side flags?

eli-darkly commented 5 years ago

Thanks for bringing this to our attention. The relay endpoint is supposed to behave just like the regular service endpoint, so it should be returning only the client-side flags. So that's a pretty straightforward bug, and we'll have a fix ASAP.

zmckinnon commented 5 years ago

When I send a GET request to https://app.launchdarkly.com/sdk/evalx/5c98f0804421b90813e75ca5/users/eyJrZXkiOiJVbmtub3duIn0, I get:

{"encounter-builder-difficulty-bar":{"value":"new-c","version":29,"variation":3,"trackEvents":false},"encounter-builder-filter-monster-tags":{"value":true,"version":15,"variation":0,"trackEvents":false},"encounter-builder-filter-source-category":{"value":false,"version":9,"variation":1,"trackEvents":false},"encounter-builder-grid-view":{"value":false,"version":7,"variation":1,"trackEvents":false},"encounter-builder-homebrew-monsters":{"value":false,"version":3,"variation":1,"trackEvents":false},"encounter-builder-monster-grouping":{"value":false,"version":3,"variation":1,"trackEvents":false},"encounter-builder-randomizer-widget":{"value":true,"version":9,"variation":0,"trackEvents":false},"encounter-builder-similar-encounters":{"value":false,"version":4,"variation":1,"trackEvents":false},"encounter-builder-suggested-monsters":{"value":false,"version":4,"variation":1,"trackEvents":false},"encounter-builder-summary-tab":{"value":false,"version":26,"variation":1,"trackEvents":false}}

which is ONLY our client side flags.

When I send a GET request to https://launch-darkly-relay.dndbeyond.com/sdk/evalx/5c98f0804421b90813e75ca5/users/eyJrZXkiOiJVbmtub3duIn0, I get:

{"ContentManagement.EnableContentManagementLinkInCampaignDetails":{"value":true,"variation":0,"version":3,"trackEvents":false},"ContentManagement.EnablePreReleaseFeedbackForm":{"value":true,"variation":0,"version":5,"trackEvents":false},"app-portal.encounter-builder-manifestlocation":{"value":"https://media.dndbeyond.com/encounter-builder/staging/asset-manifest.0.0.41.json","variation":1,"version":51,"trackEvents":false},"app-portal.megamenu-manifestlocation":{"value":"https://media.dndbeyond.com/mega-menu/asset-manifest.json","variation":1,"version":10,"trackEvents":false},"character-tools":{"value":true,"variation":0,"version":6,"trackEvents":false},"critical-role-election-2019-survey-link":{"value":"DISABLED","variation":0,"version":3,"trackEvents":false},"encounter-builder":{"value":false,"variation":1,"version":4,"trackEvents":false},"encounter-builder-difficulty-bar":{"value":"new-c","variation":3,"version":29,"trackEvents":false},"encounter-builder-filter-monster-tags":{"value":true,"variation":0,"version":15,"trackEvents":false},"encounter-builder-filter-source-category":{"value":false,"variation":1,"version":9,"trackEvents":false},"encounter-builder-grid-view":{"value":false,"variation":1,"version":7,"trackEvents":false},"encounter-builder-homebrew-monsters":{"value":false,"variation":1,"version":3,"trackEvents":false},"encounter-builder-monster-grouping":{"value":false,"variation":1,"version":3,"trackEvents":false},"encounter-builder-randomizer-widget":{"value":true,"variation":0,"version":9,"trackEvents":false},"encounter-builder-similar-encounters":{"value":false,"variation":1,"version":4,"trackEvents":false},"encounter-builder-suggested-monsters":{"value":false,"variation":1,"version":4,"trackEvents":false},"encounter-builder-summary-tab":{"value":false,"variation":1,"version":26,"trackEvents":false},"marketplace-redesign":{"value":true,"variation":0,"version":9,"trackEvents":false},"repository-character-endpoint":{"value":false,"variation":1,"version":2,"trackEvents":false},"unreleased-content-check":{"value":false,"variation":1,"version":2,"trackEvents":false},"vehicles-character":{"value":true,"variation":0,"version":25,"trackEvents":false},"vehicles-listing":{"value":true,"variation":0,"version":3,"trackEvents":false},"vehicles-listing.acquisitions-inc":{"value":true,"variation":0,"version":3,"trackEvents":false}}

which is ALL of our flags.

eli-darkly commented 5 years ago

This is fixed in version 5.6.0.

zmckinnon commented 5 years ago

Confirmed!!!!!!!!

Now I get:

{"encounter-builder-difficulty-bar":{"value":"new-c","variation":3,"version":29,"trackEvents":false},"encounter-builder-filter-monster-tags":{"value":true,"variation":0,"version":15,"trackEvents":false},"encounter-builder-filter-source-category":{"value":false,"variation":1,"version":9,"trackEvents":false},"encounter-builder-grid-view":{"value":false,"variation":1,"version":7,"trackEvents":false},"encounter-builder-homebrew-monsters":{"value":true,"variation":0,"version":5,"trackEvents":false},"encounter-builder-monster-grouping":{"value":false,"variation":1,"version":3,"trackEvents":false},"encounter-builder-randomizer-widget":{"value":true,"variation":0,"version":9,"trackEvents":false},"encounter-builder-similar-encounters":{"value":false,"variation":1,"version":4,"trackEvents":false},"encounter-builder-suggested-monsters":{"value":false,"variation":1,"version":4,"trackEvents":false},"encounter-builder-summary-tab":{"value":true,"variation":0,"version":33,"trackEvents":false},"ld-test":{"value":false,"variation":1,"version":13,"trackEvents":false}}