diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d814bd..4a2cc4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,9 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # If you only need the current version keep this. + + - name: Install PCRE development libraries + run: sudo apt-get update && sudo apt-get install -y libpcre3-dev - uses: ./.github/actions/setup-cache with: diff --git a/contract-tests/src/Main.hs b/contract-tests/src/Main.hs index 631b5e7..c86779c 100644 --- a/contract-tests/src/Main.hs +++ b/contract-tests/src/Main.hs @@ -48,7 +48,7 @@ getAppStatus = , "context-type" , "secure-mode-hash" , "tags" - , "inline-context" + , "inline-context-all" , "anonymous-redaction" , "omit-anonymous-contexts" , "client-prereq-events" diff --git a/src/LaunchDarkly/Server/Client.hs b/src/LaunchDarkly/Server/Client.hs index 68547ed..13798fb 100644 --- a/src/LaunchDarkly/Server/Client.hs +++ b/src/LaunchDarkly/Server/Client.hs @@ -55,7 +55,7 @@ import LaunchDarkly.Server.Config.ClientContext (ClientContext (..)) import LaunchDarkly.Server.Config.HttpConfiguration (HttpConfiguration (..)) import LaunchDarkly.Server.Config.Internal (ApplicationInfo, Config, getApplicationInfoHeader, shouldSendEvents) import LaunchDarkly.Server.Context (getValue) -import LaunchDarkly.Server.Context.Internal (Context (Invalid), getCanonicalKey, getKey, getKeys, optionallyRedactAnonymous, redactContext) +import LaunchDarkly.Server.Context.Internal (Context (Invalid), getCanonicalKey, getKey, optionallyRedactAnonymous, redactContext, redactContextRedactAnonymous) import LaunchDarkly.Server.DataSource.Internal (DataSource (..), DataSourceFactory, DataSourceUpdates (..), defaultDataSourceUpdates, nullDataSourceFactory) import LaunchDarkly.Server.Details (EvalErrorKind (..), EvaluationDetail (..), EvaluationReason (..)) import LaunchDarkly.Server.Evaluate (evaluateDetail, evaluateTyped) @@ -293,7 +293,7 @@ track client context key value metric = do makeBaseEvent $ CustomEvent { key = key - , contextKeys = getKeys context + , context = redactContextRedactAnonymous (getField @"config" client) context , metricValue = metric , value = value } diff --git a/src/LaunchDarkly/Server/Events.hs b/src/LaunchDarkly/Server/Events.hs index 248c2be..698ada8 100644 --- a/src/LaunchDarkly/Server/Events.hs +++ b/src/LaunchDarkly/Server/Events.hs @@ -214,7 +214,7 @@ makeFeatureEventWithContextPayload context includeReason event = data CustomEvent = CustomEvent { key :: !Text - , contextKeys :: !(KeyMap Text) + , context :: !Value , metricValue :: !(Maybe Double) , value :: !(Maybe Value) } @@ -226,7 +226,7 @@ instance ToJSON CustomEvent where filter ((/=) Null . snd) [ ("key", toJSON $ getField @"key" ctx) - , ("contextKeys", toJSON $ getField @"contextKeys" ctx) + , ("context", toJSON $ getField @"context" ctx) , ("metricValue", toJSON $ getField @"metricValue" ctx) , ("data", toJSON $ getField @"value" ctx) ]