launchdarkly-server-sdk 8.1.0 → 8.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 133fe555993b53f1e53f3348242d1c96ac2318d2c2c1ebf48e33e4d23c6e97f3
4
- data.tar.gz: 12f604c2a17d9d06433a1ad041051e41f767efa3c7310a5925553cb5678b5709
3
+ metadata.gz: c8386f877f9c75e57e88df29c2983ccb3e70c47f038a374a54cd07a904480b4e
4
+ data.tar.gz: 1edbe1a519399f47e8da823c0cb5f034ab657d47612647b0846237e280976d70
5
5
  SHA512:
6
- metadata.gz: 1be2d4708681d7e0a2665e68e878ed8d2e17975f6c28716ed139911b866acb067884b4af872e6f5469177f09b5071f1c8fbb0ac6b7519f581bb20ee11afb76df
7
- data.tar.gz: 2d0a5df44d5de21887eb4330f34bf65d4a4bab9a153d7644077790e3262a8b6418c26c4ebe5612523be468d05ddd5a8b837dc22a347c08ef463229c337e040c3
6
+ metadata.gz: 6af0847efe755ef23429d0060a759fc44be91f50af5d5509550dbba3d3c953dd052c0773836f7a2786b5e993c5ca31a7c59a8661a925e76954b28e07a63c1bdf
7
+ data.tar.gz: 6f58802cf33e04bad0c77d40acf1f3442909b8dbc54647b9fc32540d3fc8d538f56b6651a2ad24c99509813e5a9b89a554aac6e204459b891015338f593a32b1
data/README.md CHANGED
@@ -39,7 +39,12 @@ Contributing
39
39
  ------------
40
40
 
41
41
  We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this SDK.
42
-
42
+
43
+ Verifying SDK build provenance with the SLSA framework
44
+ ------------
45
+
46
+ LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md).
47
+
43
48
  About LaunchDarkly
44
49
  -----------
45
50
 
@@ -481,12 +481,14 @@ module LaunchDarkly
481
481
  key: event.key,
482
482
  value: event.value,
483
483
  }
484
+
484
485
  out[:default] = event.default unless event.default.nil?
485
486
  out[:variation] = event.variation unless event.variation.nil?
486
487
  out[:version] = event.version unless event.version.nil?
487
488
  out[:prereqOf] = event.prereq_of unless event.prereq_of.nil?
488
- out[:contextKeys] = event.context.keys
489
+ out[:context] = @context_filter.filter_redact_anonymous(event.context)
489
490
  out[:reason] = event.reason unless event.reason.nil?
491
+
490
492
  out
491
493
 
492
494
  when LaunchDarkly::Impl::MigrationOpEvent
@@ -23,14 +23,32 @@ module LaunchDarkly
23
23
  # @return [Hash]
24
24
  #
25
25
  def filter(context)
26
- return filter_single_context(context, true) unless context.multi_kind?
26
+ internal_filter(context, false)
27
+ end
28
+
29
+ #
30
+ # Return a hash representation of the provided context with attribute
31
+ # redaction applied.
32
+ #
33
+ # If a context is anonyomous, all attributes will be redacted except
34
+ # for key, kind, and anonymous.
35
+ #
36
+ # @param context [LaunchDarkly::LDContext]
37
+ # @return [Hash]
38
+ #
39
+ def filter_redact_anonymous(context)
40
+ internal_filter(context, true)
41
+ end
42
+
43
+ private def internal_filter(context, redact_anonymous)
44
+ return filter_single_context(context, true, redact_anonymous) unless context.multi_kind?
27
45
 
28
46
  filtered = {kind: 'multi'}
29
47
  (0...context.individual_context_count).each do |i|
30
48
  c = context.individual_context(i)
31
49
  next if c.nil?
32
50
 
33
- filtered[c.kind] = filter_single_context(c, false)
51
+ filtered[c.kind] = filter_single_context(c, false, redact_anonymous)
34
52
  end
35
53
 
36
54
  filtered
@@ -43,22 +61,24 @@ module LaunchDarkly
43
61
  # @param include_kind [Boolean]
44
62
  # @return [Hash]
45
63
  #
46
- private def filter_single_context(context, include_kind)
64
+ private def filter_single_context(context, include_kind, redact_anonymous)
47
65
  filtered = {key: context.key}
48
66
 
49
67
  filtered[:kind] = context.kind if include_kind
50
- filtered[:anonymous] = true if context.get_value(:anonymous)
68
+
69
+ anonymous = context.get_value(:anonymous)
70
+ filtered[:anonymous] = true if anonymous
51
71
 
52
72
  redacted = []
53
73
  private_attributes = @private_attributes.concat(context.private_attributes)
54
74
 
55
75
  name = context.get_value(:name)
56
- if !name.nil? && !check_whole_attribute_private(:name, private_attributes, redacted)
76
+ if !name.nil? && !check_whole_attribute_private(:name, private_attributes, redacted, anonymous && redact_anonymous)
57
77
  filtered[:name] = name
58
78
  end
59
79
 
60
80
  context.get_custom_attribute_names.each do |attribute|
61
- unless check_whole_attribute_private(attribute, private_attributes, redacted)
81
+ unless check_whole_attribute_private(attribute, private_attributes, redacted, anonymous && redact_anonymous)
62
82
  value = context.get_value(attribute)
63
83
  filtered[attribute] = redact_json_value(nil, attribute, value, private_attributes, redacted)
64
84
  end
@@ -75,10 +95,11 @@ module LaunchDarkly
75
95
  # @param attribute [Symbol]
76
96
  # @param private_attributes [Array<Reference>]
77
97
  # @param redacted [Array<Symbol>]
98
+ # @param redact_all [Boolean]
78
99
  # @return [Boolean]
79
100
  #
80
- private def check_whole_attribute_private(attribute, private_attributes, redacted)
81
- if @all_attributes_private
101
+ private def check_whole_attribute_private(attribute, private_attributes, redacted, redact_all)
102
+ if @all_attributes_private || redact_all
82
103
  redacted << attribute
83
104
  return true
84
105
  end
@@ -26,6 +26,8 @@ module LaunchDarkly
26
26
  @sdk_key = sdk_key
27
27
  @config = config
28
28
  @http_client = LaunchDarkly::Util.new_http_client(config.base_uri, config)
29
+ .use(:auto_inflate)
30
+ .headers("Accept-Encoding" => "gzip")
29
31
  @cache = @config.cache_store
30
32
  end
31
33
 
@@ -1,3 +1,3 @@
1
1
  module LaunchDarkly
2
- VERSION = "8.1.0" # x-release-please-version
2
+ VERSION = "8.3.0" # x-release-please-version
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: launchdarkly-server-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.0
4
+ version: 8.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - LaunchDarkly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-03 00:00:00.000000000 Z
11
+ date: 2024-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-dynamodb