flipt_client 0.7.0 → 0.9.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: 3e6d2ba2cc57cac3446b5df105f61a2f1e15ca6bcbbcdfa7306c821f2c562fc5
4
- data.tar.gz: 84ec8fa11e6910cbfc5fe50394806190c279be2f32587d7105d16687192fac93
3
+ metadata.gz: 9d7272b8279c1431c8cc1e464cec449a7d6c2c6c40a4892f3606c634dfd04f24
4
+ data.tar.gz: 41aabf46845348ee6c072e151342583b1e2d5ffae369c463f8aa1f2eb9d698a1
5
5
  SHA512:
6
- metadata.gz: 6b740a30f15d192a44d4ecf59bd682bdf6097b3260ec5d223c20f3cee4d4a3d5f6e812f705a5f53b03d0d9f9d872e48d520f7d4738f10ec23bb3398a534d641d
7
- data.tar.gz: af4e1d93cc2b070488a9f5120f3cfe4ef4bff8bfdac29261b3e4b9ad84767efc9edcb6c42afeafe30049cbd0b971f1a82d912cc1e8ba9fd6b50a53c5c877707f
6
+ metadata.gz: f0331b39703e02f7690313d8c95a184cb00436fc025963403f6613645f71877b7661e693a820c2aa6f8d03f019de083f5409211431a278394b8514e8fd1727fa
7
+ data.tar.gz: dbc6f543c9f22aa68c036676b5ad819a6ebef0a5dc1607eb507e19f029889386a21bf18cb3f2dae75d16d3d9e792c379f3113f9f90bad14fa46fdfa85b3d6019
data/README.md CHANGED
@@ -55,6 +55,25 @@ resp = client.evaluate_variant({ flag_key: 'buzz', entity_id: 'someentity', cont
55
55
  puts resp
56
56
  ```
57
57
 
58
+ ### Constructor Arguments
59
+
60
+ The `Flipt::EvaluationClient` constructor accepts two optional arguments:
61
+
62
+ - `namespace`: The namespace to fetch flag state from. If not provided, the client will default to the `default` namespace.
63
+ - `engine_opts`: A hash that supports several options for the client. The structure is:
64
+ - `url`: The URL of the upstream Flipt instance. If not provided, the client will default to `http://localhost:8080`.
65
+ - `update_interval`: The interval (in seconds) in which to fetch new flag state. If not provided, the client will default to 120 seconds.
66
+ - `authentication`: The authentication strategy to use when communicating with the upstream Flipt instance. If not provided, the client will default to no authentication. See the [Authentication](#authentication) section for more information.
67
+ - `reference`: The [reference](https://docs.flipt.io/guides/user/using-references) to use when fetching flag state. If not provided, reference will not be used.
68
+
69
+ ### Authentication
70
+
71
+ The `FliptEvaluationClient` supports the following authentication strategies:
72
+
73
+ - No Authentication (default)
74
+ - [Client Token Authentication](https://docs.flipt.io/authentication/using-tokens)
75
+ - [JWT Authentication](https://docs.flipt.io/authentication/using-jwts)
76
+
58
77
  ## Load Test
59
78
 
60
79
  1. To run the load test, you'll need to have Flipt running locally. You can do this by running the following command from the root of the repository:
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flipt
4
- VERSION = '0.7.0'
4
+ VERSION = '0.9.0'
5
5
  end
data/lib/flipt_client.rb CHANGED
@@ -14,19 +14,19 @@ module Flipt
14
14
 
15
15
  FLIPTENGINE = 'libfliptengine'
16
16
 
17
+ LIB_FILES = {
18
+ /arm64-darwin/ => "ext/darwin_arm64/#{FLIPTENGINE}.dylib",
19
+ /x86_64-darwin/ => "ext/darwin_x86_64/#{FLIPTENGINE}.dylib",
20
+ /arm64-linux|aarch64-linux/ => "ext/linux_arm64/#{FLIPTENGINE}.so",
21
+ /x86_64-linux/ => "ext/linux_x86_64/#{FLIPTENGINE}.so"
22
+ }.freeze
23
+
17
24
  def self.libfile
18
- case RbConfig::CONFIG['arch']
19
- when /arm64-darwin/
20
- "ext/darwin_arm64/#{FLIPTENGINE}.dylib"
21
- when /x86_64-darwin/
22
- "ext/darwin_x86_64/#{FLIPTENGINE}.dylib"
23
- when /arm64-linux|aarch64-linux/
24
- "ext/linux_arm64/#{FLIPTENGINE}.so"
25
- when /x86_64-linux/
26
- "ext/linux_x86_64/#{FLIPTENGINE}.so"
27
- else
28
- raise "unsupported platform #{RbConfig::CONFIG['arch']}"
25
+ arch = RbConfig::CONFIG['arch']
26
+ LIB_FILES.each do |pattern, path|
27
+ return path if arch.match?(pattern)
29
28
  end
29
+ raise "unsupported platform #{arch}"
30
30
  end
31
31
 
32
32
  ffi_lib File.expand_path(libfile, __dir__)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flipt_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flipt Devs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-23 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Flipt Client Evaluation SDK
14
14
  email:
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  requirements: []
59
- rubygems_version: 3.3.26
59
+ rubygems_version: 3.3.27
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Flipt Client Evaluation SDK