openfeature-flipt-provider 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +58 -0
- data/Gemfile.lock +45 -37
- data/README.md +195 -27
- data/lib/openfeature/flipt/version.rb +1 -1
- data/openfeature-flipt-provider.gemspec +3 -1
- metadata +19 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7005453b2888483bcbc5d15c5ce25839a1a83a3c1cc2a57f261a321245958ebb
|
|
4
|
+
data.tar.gz: 0eb48df8042e31a91e557a9d537d5c604b3c8c9a221bffbb41b6536715bc0009
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f209bc4b1e9c17122b827664a87911f7c22c88853da6f59b7ac05f947cff135f5e7982e30d16a44bbd40e1258457dfc784424280a7319788b72376edd4155d5d
|
|
7
|
+
data.tar.gz: 2b69728350c5ded3bf7d89e0d2de9ffeb9dd674af544bfafa23eb5a63287372ae6d0b37f3d258cd2faac724b0bca609cc027501151d9fea294d47225e2d50afb
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.0](https://github.com/open-feature/ruby-sdk-contrib/compare/openfeature-flipt-provider/v0.0.4...openfeature-flipt-provider/v0.1.0) (2026-11-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* require Ruby >= 3.4 and test only on 3.4 and 4.0 ([#264](https://github.com/open-feature/ruby-sdk-contrib/issues/264))
|
|
9
|
+
|
|
10
|
+
### ✨ New Features
|
|
11
|
+
|
|
12
|
+
* support Ruby 3.3 (lower minimum from 3.4 to 3.3) ([#204](https://github.com/open-feature/ruby-sdk-contrib/issues/204)) ([295a34f](https://github.com/open-feature/ruby-sdk-contrib/commit/295a34f6d0bb4ff382362020a976ae0235e3ed53))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### 🧹 Chore
|
|
16
|
+
|
|
17
|
+
* **deps:** lock file maintenance ([#234](https://github.com/open-feature/ruby-sdk-contrib/issues/234)) ([402c691](https://github.com/open-feature/ruby-sdk-contrib/commit/402c6913534128605eb2bd4cad870c31cff2d7c0))
|
|
18
|
+
* **deps:** lock file maintenance ([#242](https://github.com/open-feature/ruby-sdk-contrib/issues/242)) ([788b51c](https://github.com/open-feature/ruby-sdk-contrib/commit/788b51c34300d0654fa837bfd15a86d56a7ac142))
|
|
19
|
+
* **deps:** lock file maintenance ([#248](https://github.com/open-feature/ruby-sdk-contrib/issues/248)) ([24d69f1](https://github.com/open-feature/ruby-sdk-contrib/commit/24d69f1ce10a461a9e86971ffa3d579394894145))
|
|
20
|
+
* **deps:** lock file maintenance ([#251](https://github.com/open-feature/ruby-sdk-contrib/issues/251)) ([a351265](https://github.com/open-feature/ruby-sdk-contrib/commit/a3512650043f83c8be7e224d9797c639ddc3a4f0))
|
|
21
|
+
* **deps:** lock file maintenance ([#259](https://github.com/open-feature/ruby-sdk-contrib/issues/259)) ([ffe7663](https://github.com/open-feature/ruby-sdk-contrib/commit/ffe7663ffef575202abe21b94f196076a49b3ad1))
|
|
22
|
+
* **deps:** lock file maintenance ([#277](https://github.com/open-feature/ruby-sdk-contrib/issues/277)) ([857f47f](https://github.com/open-feature/ruby-sdk-contrib/commit/857f47f679bfa29454dd899ef40040c08a69dd13))
|
|
23
|
+
* **deps:** update dependency ruby to v4 ([#124](https://github.com/open-feature/ruby-sdk-contrib/issues/124)) ([f6fdaf6](https://github.com/open-feature/ruby-sdk-contrib/commit/f6fdaf6c304f730960e379ec7042657916a7ae44))
|
|
24
|
+
* **deps:** update dependency ruby to v4.0.3 ([#161](https://github.com/open-feature/ruby-sdk-contrib/issues/161)) ([538486e](https://github.com/open-feature/ruby-sdk-contrib/commit/538486e8b6a42979c35a251f12e94292f412f8a0))
|
|
25
|
+
* **deps:** update dependency ruby to v4.0.4 ([#170](https://github.com/open-feature/ruby-sdk-contrib/issues/170)) ([0bde1a8](https://github.com/open-feature/ruby-sdk-contrib/commit/0bde1a85b475764deb22b56d34e1e333a809ec37))
|
|
26
|
+
* **deps:** update dependency ruby to v4.0.5 ([#173](https://github.com/open-feature/ruby-sdk-contrib/issues/173)) ([d410cee](https://github.com/open-feature/ruby-sdk-contrib/commit/d410ceeed7c77ea2626d009c052ed53d2621e511))
|
|
27
|
+
* **deps:** update dependency ruby to v4.0.6 ([#194](https://github.com/open-feature/ruby-sdk-contrib/issues/194)) ([c786a79](https://github.com/open-feature/ruby-sdk-contrib/commit/c786a7972924b7feee9321fd20062bb17ca2caea))
|
|
28
|
+
* **deps:** update dependency ruby to v4.0.7 ([#219](https://github.com/open-feature/ruby-sdk-contrib/issues/219)) ([74e1acb](https://github.com/open-feature/ruby-sdk-contrib/commit/74e1acb0bab6d20d74107da95a6472daff0c0da4))
|
|
29
|
+
* **deps:** update dependency ruby to v4.0.8 ([#272](https://github.com/open-feature/ruby-sdk-contrib/issues/272)) ([003d193](https://github.com/open-feature/ruby-sdk-contrib/commit/003d193e84e4c27639405d2cfe83680f0aa0c21b))
|
|
30
|
+
* **deps:** update dependency ruby to v4.0.9 ([#276](https://github.com/open-feature/ruby-sdk-contrib/issues/276)) ([feaca24](https://github.com/open-feature/ruby-sdk-contrib/commit/feaca24ef5f68442132750137c73a49780eabc3a))
|
|
31
|
+
* require Ruby >= 3.4 and test only on 3.4 and 4.0 ([#264](https://github.com/open-feature/ruby-sdk-contrib/issues/264)) ([89489ce](https://github.com/open-feature/ruby-sdk-contrib/commit/89489ceb37f3d9dbebc29982a265bb7aeecc6af7))
|
|
32
|
+
* resolve open dependabot security alerts ([#180](https://github.com/open-feature/ruby-sdk-contrib/issues/180)) ([b96958f](https://github.com/open-feature/ruby-sdk-contrib/commit/b96958ffd4603caf8b64dcf432a729a44289afc0))
|
|
33
|
+
* resolve open dependabot security alerts ([#203](https://github.com/open-feature/ruby-sdk-contrib/issues/203)) ([a1ab3a3](https://github.com/open-feature/ruby-sdk-contrib/commit/a1ab3a38f8221ea822792f098c5213a071c01d68))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### 🛠️ Build
|
|
37
|
+
|
|
38
|
+
* **deps-dev:** bump json from 2.19.0 to 2.19.2 in /providers/openfeature-flipt-provider ([#136](https://github.com/open-feature/ruby-sdk-contrib/issues/136)) ([9b6cd0c](https://github.com/open-feature/ruby-sdk-contrib/commit/9b6cd0cd32871c5a156702fe70e50fa8cfa3ebec))
|
|
39
|
+
|
|
40
|
+
## [0.0.4](https://github.com/open-feature/ruby-sdk-contrib/compare/openfeature-flipt-provider/v0.0.3...openfeature-flipt-provider/v0.0.4) (2026-03-18)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### 🧹 Chore
|
|
44
|
+
|
|
45
|
+
* **deps:** update dependency ruby to v3.4.9 ([#107](https://github.com/open-feature/ruby-sdk-contrib/issues/107)) ([e0d4314](https://github.com/open-feature/ruby-sdk-contrib/commit/e0d4314f1183cc80e84ba04980fe2d01584bec9c))
|
|
46
|
+
|
|
47
|
+
## [0.0.3](https://github.com/open-feature/ruby-sdk-contrib/compare/openfeature-flipt-provider/v0.0.2...openfeature-flipt-provider/v0.0.3) (2026-03-09)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### ✨ New Features
|
|
51
|
+
|
|
52
|
+
* add OFREP provider ([#80](https://github.com/open-feature/ruby-sdk-contrib/issues/80)) ([e33e0ab](https://github.com/open-feature/ruby-sdk-contrib/commit/e33e0ab340193eee4434df65bb33e1002a69eaad))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### 🧹 Chore
|
|
56
|
+
|
|
57
|
+
* add conformance tests, SimpleCov, version standardization, and README improvements ([#95](https://github.com/open-feature/ruby-sdk-contrib/issues/95)) ([1c430a9](https://github.com/open-feature/ruby-sdk-contrib/commit/1c430a92041a7841ac01a2642a66376b8259acd2))
|
|
58
|
+
* improve repository maturity and contributor experience ([#91](https://github.com/open-feature/ruby-sdk-contrib/issues/91)) ([7e28025](https://github.com/open-feature/ruby-sdk-contrib/commit/7e280257e6f543bc46537f43aeac302be003b47b))
|
|
59
|
+
* update minimum Ruby version to >= 3.4 ([#83](https://github.com/open-feature/ruby-sdk-contrib/issues/83)) ([ccf689a](https://github.com/open-feature/ruby-sdk-contrib/commit/ccf689a097de8d7db86fffd84b2127ac75687d4c))
|
|
60
|
+
|
|
3
61
|
## [0.0.2](https://github.com/open-feature/ruby-sdk-contrib/compare/openfeature-flipt-provider-v0.0.1...openfeature-flipt-provider/v0.0.2) (2025-04-15)
|
|
4
62
|
|
|
5
63
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
openfeature-flipt-provider (0.0
|
|
4
|
+
openfeature-flipt-provider (0.1.0)
|
|
5
5
|
ffi (~> 1.17)
|
|
6
6
|
flipt_client (~> 0.10.0)
|
|
7
7
|
openfeature-sdk (~> 0.4.0)
|
|
@@ -10,32 +10,33 @@ GEM
|
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
12
|
ast (2.4.3)
|
|
13
|
-
diff-lcs (1.6.
|
|
14
|
-
|
|
15
|
-
ffi (1.17.
|
|
16
|
-
ffi (1.17.
|
|
17
|
-
ffi (1.17.
|
|
18
|
-
ffi (1.17.
|
|
19
|
-
ffi (1.17.
|
|
20
|
-
ffi (1.17.
|
|
21
|
-
ffi (1.17.
|
|
22
|
-
ffi (1.17.
|
|
23
|
-
ffi (1.17.
|
|
24
|
-
ffi (1.17.
|
|
13
|
+
diff-lcs (1.6.2)
|
|
14
|
+
docile (1.4.1)
|
|
15
|
+
ffi (1.17.4)
|
|
16
|
+
ffi (1.17.4-aarch64-linux-gnu)
|
|
17
|
+
ffi (1.17.4-aarch64-linux-musl)
|
|
18
|
+
ffi (1.17.4-arm-linux-gnu)
|
|
19
|
+
ffi (1.17.4-arm-linux-musl)
|
|
20
|
+
ffi (1.17.4-arm64-darwin)
|
|
21
|
+
ffi (1.17.4-x86-linux-gnu)
|
|
22
|
+
ffi (1.17.4-x86-linux-musl)
|
|
23
|
+
ffi (1.17.4-x86_64-darwin)
|
|
24
|
+
ffi (1.17.4-x86_64-linux-gnu)
|
|
25
|
+
ffi (1.17.4-x86_64-linux-musl)
|
|
25
26
|
flipt_client (0.10.0)
|
|
26
|
-
json (
|
|
27
|
-
language_server-protocol (3.17.0.
|
|
27
|
+
json (3.1.0)
|
|
28
|
+
language_server-protocol (3.17.0.6)
|
|
28
29
|
lint_roller (1.1.0)
|
|
29
|
-
openfeature-sdk (0.4.
|
|
30
|
-
parallel (
|
|
31
|
-
parser (3.3.
|
|
30
|
+
openfeature-sdk (0.4.1)
|
|
31
|
+
parallel (2.3.0)
|
|
32
|
+
parser (3.3.13.0)
|
|
32
33
|
ast (~> 2.4.1)
|
|
33
34
|
racc
|
|
34
|
-
prism (1.
|
|
35
|
+
prism (1.9.0)
|
|
35
36
|
racc (1.8.1)
|
|
36
37
|
rainbow (3.1.1)
|
|
37
|
-
rake (13.2
|
|
38
|
-
regexp_parser (2.
|
|
38
|
+
rake (13.4.2)
|
|
39
|
+
regexp_parser (2.13.1)
|
|
39
40
|
rspec (3.12.0)
|
|
40
41
|
rspec-core (~> 3.12.0)
|
|
41
42
|
rspec-expectations (~> 3.12.0)
|
|
@@ -49,40 +50,46 @@ GEM
|
|
|
49
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
50
51
|
rspec-support (~> 3.12.0)
|
|
51
52
|
rspec-support (3.12.2)
|
|
52
|
-
rubocop (1.
|
|
53
|
-
json (
|
|
53
|
+
rubocop (1.91.0)
|
|
54
|
+
json (>= 2.3)
|
|
54
55
|
language_server-protocol (~> 3.17.0.2)
|
|
55
56
|
lint_roller (~> 1.1.0)
|
|
56
|
-
parallel (
|
|
57
|
+
parallel (>= 1.10)
|
|
57
58
|
parser (>= 3.3.0.2)
|
|
58
59
|
rainbow (>= 2.2.2, < 4.0)
|
|
59
60
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
60
|
-
rubocop-ast (>= 1.
|
|
61
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
61
62
|
ruby-progressbar (~> 1.7)
|
|
62
63
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
63
|
-
rubocop-ast (1.
|
|
64
|
+
rubocop-ast (1.50.0)
|
|
64
65
|
parser (>= 3.3.7.2)
|
|
65
|
-
prism (~> 1.
|
|
66
|
-
rubocop-performance (1.
|
|
66
|
+
prism (~> 1.7)
|
|
67
|
+
rubocop-performance (1.26.1)
|
|
67
68
|
lint_roller (~> 1.1)
|
|
68
69
|
rubocop (>= 1.75.0, < 2.0)
|
|
69
|
-
rubocop-ast (>= 1.
|
|
70
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
70
71
|
ruby-progressbar (1.13.0)
|
|
71
|
-
|
|
72
|
+
simplecov (0.22.0)
|
|
73
|
+
docile (~> 1.1)
|
|
74
|
+
simplecov-html (~> 0.11)
|
|
75
|
+
simplecov_json_formatter (~> 0.1)
|
|
76
|
+
simplecov-html (0.13.2)
|
|
77
|
+
simplecov_json_formatter (0.1.4)
|
|
78
|
+
standard (1.57.0)
|
|
72
79
|
language_server-protocol (~> 3.17.0.2)
|
|
73
80
|
lint_roller (~> 1.0)
|
|
74
|
-
rubocop (~> 1.
|
|
81
|
+
rubocop (~> 1.91.0)
|
|
75
82
|
standard-custom (~> 1.0.0)
|
|
76
83
|
standard-performance (~> 1.8)
|
|
77
84
|
standard-custom (1.0.2)
|
|
78
85
|
lint_roller (~> 1.0)
|
|
79
86
|
rubocop (~> 1.50)
|
|
80
|
-
standard-performance (1.
|
|
87
|
+
standard-performance (1.9.0)
|
|
81
88
|
lint_roller (~> 1.1)
|
|
82
|
-
rubocop-performance (~> 1.
|
|
83
|
-
unicode-display_width (3.
|
|
84
|
-
unicode-emoji (~> 4.
|
|
85
|
-
unicode-emoji (4.0
|
|
89
|
+
rubocop-performance (~> 1.26.0)
|
|
90
|
+
unicode-display_width (3.3.0)
|
|
91
|
+
unicode-emoji (~> 4.3)
|
|
92
|
+
unicode-emoji (4.3.0)
|
|
86
93
|
|
|
87
94
|
PLATFORMS
|
|
88
95
|
aarch64-linux-gnu
|
|
@@ -102,7 +109,8 @@ DEPENDENCIES
|
|
|
102
109
|
rake (~> 13.0)
|
|
103
110
|
rspec (~> 3.12.0)
|
|
104
111
|
rubocop
|
|
112
|
+
simplecov (~> 0.22)
|
|
105
113
|
standard (>= 1.35.1)
|
|
106
114
|
|
|
107
115
|
BUNDLED WITH
|
|
108
|
-
|
|
116
|
+
4.0.20
|
data/README.md
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
<img width="400" src="https://raw.githubusercontent.com/flipt-io/flipt/main/logo.svg" alt="flipt logo" />
|
|
3
|
-
</p>
|
|
1
|
+
# OpenFeature Flipt Provider for Ruby
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
This repository contains the Ruby provider for [Flipt](https://www.flipt.io/), a feature flagging and experimentation platform.
|
|
3
|
+
This is the Ruby provider for [Flipt](https://www.flipt.io/), a feature flagging and experimentation platform, implementing the [OpenFeature](https://openfeature.dev/) standard.
|
|
8
4
|
|
|
9
5
|
In conjunction with the [OpenFeature SDK](https://openfeature.dev/docs/reference/concepts/provider/) you can use this provider to integrate Flipt into your Ruby application.
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
| Status | Feature | Description |
|
|
10
|
+
|--------|---------|-------------|
|
|
11
|
+
| ✅ | Flag Evaluation | Support for all OpenFeature flag types |
|
|
12
|
+
| ✅ | Boolean Flags | Evaluate boolean feature flags |
|
|
13
|
+
| ✅ | String Flags | Evaluate string feature flags |
|
|
14
|
+
| ✅ | Number Flags | Evaluate numeric feature flags (integer, float) |
|
|
15
|
+
| ✅ | Object Flags | Evaluate JSON object flags |
|
|
16
|
+
| ✅ | Evaluation Context | Support for entity ID and context attributes |
|
|
17
|
+
| ✅ | Namespace Support | Evaluate flags within a specific namespace |
|
|
18
|
+
| ✅ | Error Handling | Comprehensive error handling with default values |
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- Ruby >= 3.4
|
|
12
23
|
|
|
13
24
|
## Installation
|
|
25
|
+
|
|
14
26
|
Add this line to your application's Gemfile:
|
|
15
27
|
|
|
16
28
|
```ruby
|
|
@@ -18,40 +30,196 @@ gem 'openfeature-flipt-provider'
|
|
|
18
30
|
```
|
|
19
31
|
|
|
20
32
|
And then execute:
|
|
33
|
+
|
|
21
34
|
```bash
|
|
22
|
-
|
|
35
|
+
bundle install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or install it yourself as:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
gem install openfeature-flipt-provider
|
|
23
42
|
```
|
|
24
43
|
|
|
25
44
|
## Usage
|
|
26
|
-
|
|
45
|
+
|
|
46
|
+
### Basic Setup
|
|
27
47
|
|
|
28
48
|
```ruby
|
|
29
49
|
require "open_feature/sdk"
|
|
30
50
|
require "openfeature/flipt/provider"
|
|
31
51
|
|
|
52
|
+
# Configure the Flipt provider
|
|
53
|
+
provider = OpenFeature::Flipt::Provider.new(
|
|
54
|
+
namespace: "my-namespace",
|
|
55
|
+
options: {
|
|
56
|
+
url: "http://localhost:8080",
|
|
57
|
+
authentication: "your-api-token"
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# Set the provider in OpenFeature
|
|
32
62
|
OpenFeature::SDK.configure do |config|
|
|
33
|
-
config.set_provider(
|
|
34
|
-
OpenFeature::Flipt::Provider.new(
|
|
35
|
-
namespace: "flipt-namespace",
|
|
36
|
-
options: {
|
|
37
|
-
url: "https://url-to-flipt-server",
|
|
38
|
-
update_interval: 60,
|
|
39
|
-
authentication: "token"
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
)
|
|
63
|
+
config.set_provider(provider)
|
|
43
64
|
end
|
|
65
|
+
|
|
66
|
+
# Get a client
|
|
44
67
|
client = OpenFeature::SDK.build_client
|
|
68
|
+
```
|
|
45
69
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
70
|
+
### Evaluating Flags
|
|
71
|
+
|
|
72
|
+
#### Boolean Flags
|
|
73
|
+
|
|
74
|
+
```ruby
|
|
75
|
+
# Simple boolean flag
|
|
76
|
+
enabled = client.fetch_boolean_value(
|
|
77
|
+
flag_key: "new_feature",
|
|
78
|
+
default_value: false
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# With evaluation context
|
|
82
|
+
evaluation_context = OpenFeature::SDK::EvaluationContext.new(
|
|
83
|
+
targeting_key: "user_123",
|
|
84
|
+
email: "user@example.com",
|
|
85
|
+
plan: "premium"
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
enabled = client.fetch_boolean_value(
|
|
89
|
+
flag_key: "new_feature",
|
|
90
|
+
default_value: false,
|
|
91
|
+
evaluation_context: evaluation_context
|
|
92
|
+
)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### String Flags
|
|
96
|
+
|
|
97
|
+
```ruby
|
|
98
|
+
variant = client.fetch_string_value(
|
|
99
|
+
flag_key: "color_scheme",
|
|
100
|
+
default_value: "default",
|
|
101
|
+
evaluation_context: evaluation_context
|
|
102
|
+
)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### Number Flags
|
|
106
|
+
|
|
107
|
+
```ruby
|
|
108
|
+
max_items = client.fetch_integer_value(
|
|
109
|
+
flag_key: "max_items",
|
|
110
|
+
default_value: 10,
|
|
111
|
+
evaluation_context: evaluation_context
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
rate_limit = client.fetch_float_value(
|
|
115
|
+
flag_key: "rate_limit",
|
|
116
|
+
default_value: 1.5,
|
|
117
|
+
evaluation_context: evaluation_context
|
|
118
|
+
)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### Object Flags
|
|
122
|
+
|
|
123
|
+
```ruby
|
|
124
|
+
config = client.fetch_object_value(
|
|
125
|
+
flag_key: "app_config",
|
|
126
|
+
default_value: { "timeout" => 30 },
|
|
127
|
+
evaluation_context: evaluation_context
|
|
128
|
+
)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Configuration Options
|
|
132
|
+
|
|
133
|
+
The provider constructor accepts the following parameters:
|
|
134
|
+
|
|
135
|
+
| Option | Type | Default | Required | Description |
|
|
136
|
+
|--------|------|---------|----------|-------------|
|
|
137
|
+
| `namespace` | String | `"default"` | No | The Flipt namespace to use when fetching flags |
|
|
138
|
+
| `options` | Hash | `{}` | No | Options passed to the underlying Flipt client (see below) |
|
|
139
|
+
|
|
140
|
+
The `options` hash is passed directly to the [Flipt Client Ruby SDK](https://github.com/flipt-io/flipt-client-sdks/tree/main/flipt-client-ruby). Common options include:
|
|
141
|
+
|
|
142
|
+
| Option | Type | Description |
|
|
143
|
+
|--------|------|-------------|
|
|
144
|
+
| `url` | String | URL of the Flipt server |
|
|
145
|
+
| `update_interval` | Integer | Polling interval in seconds for fetching flag state |
|
|
146
|
+
| `authentication` | String | Authentication token for the Flipt server |
|
|
147
|
+
|
|
148
|
+
For a complete list of client options, refer to the [Flipt Client Ruby SDK documentation](https://github.com/flipt-io/flipt-client-sdks/tree/main/flipt-client-ruby#constructor-arguments).
|
|
149
|
+
|
|
150
|
+
## Evaluation Context
|
|
151
|
+
|
|
152
|
+
The provider maps OpenFeature evaluation context fields to Flipt evaluation parameters:
|
|
153
|
+
|
|
154
|
+
- `targeting_key` maps to the Flipt `entity_id`. If not provided, defaults to `"default"`.
|
|
155
|
+
- All other context fields are passed as string key-value pairs in the Flipt evaluation context.
|
|
156
|
+
|
|
157
|
+
```ruby
|
|
158
|
+
evaluation_context = OpenFeature::SDK::EvaluationContext.new(
|
|
159
|
+
targeting_key: "user_123",
|
|
160
|
+
plan: "premium",
|
|
161
|
+
region: "us-east-1"
|
|
162
|
+
)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Error Handling
|
|
166
|
+
|
|
167
|
+
The provider handles errors gracefully and returns the default value with appropriate reasons:
|
|
168
|
+
|
|
169
|
+
| Reason | Description |
|
|
170
|
+
|--------|-------------|
|
|
171
|
+
| `TARGETING_MATCH` | Flag evaluated successfully (default or match reason from Flipt) |
|
|
172
|
+
| `DISABLED` | The flag is disabled in Flipt |
|
|
173
|
+
| `UNKNOWN` | Flipt returned an unknown evaluation reason |
|
|
174
|
+
| `DEFAULT` | Default value returned (unrecognized Flipt reason) |
|
|
175
|
+
| `ERROR` | An error occurred during evaluation |
|
|
176
|
+
|
|
177
|
+
## Development
|
|
178
|
+
|
|
179
|
+
### Running Tests
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
bundle install
|
|
183
|
+
bundle exec rspec
|
|
52
184
|
```
|
|
53
185
|
|
|
54
|
-
|
|
186
|
+
### Running Linter
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
bundle exec rubocop
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Building the Gem
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
gem build openfeature-flipt-provider.gemspec
|
|
196
|
+
```
|
|
55
197
|
|
|
56
198
|
## Contributing
|
|
57
|
-
|
|
199
|
+
|
|
200
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
201
|
+
|
|
202
|
+
1. Fork the repository
|
|
203
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
204
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
205
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
206
|
+
5. Open a Pull Request
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
Apache 2.0 - See [LICENSE](LICENSE) for more information.
|
|
211
|
+
|
|
212
|
+
## Links
|
|
213
|
+
|
|
214
|
+
- [Flipt Documentation](https://docs.flipt.io/)
|
|
215
|
+
- [Flipt Client Ruby SDK](https://github.com/flipt-io/flipt-client-sdks/tree/main/flipt-client-ruby)
|
|
216
|
+
- [OpenFeature Documentation](https://openfeature.dev/)
|
|
217
|
+
- [OpenFeature Ruby SDK](https://github.com/open-feature/ruby-sdk)
|
|
218
|
+
- [Ruby SDK Contrib Repository](https://github.com/open-feature/ruby-sdk-contrib)
|
|
219
|
+
|
|
220
|
+
## Support
|
|
221
|
+
|
|
222
|
+
For issues related to:
|
|
223
|
+
- **This provider**: [GitHub Issues](https://github.com/open-feature/ruby-sdk-contrib/issues)
|
|
224
|
+
- **Flipt**: [Flipt Community](https://www.flipt.io/docs)
|
|
225
|
+
- **OpenFeature**: [OpenFeature Community](https://openfeature.dev/community/)
|
|
@@ -12,13 +12,14 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
spec.description = "OpenFeature Flipt Provider for Ruby"
|
|
13
13
|
spec.homepage = "https://github.com/open-feature/ruby-sdk-contrib/tree/main/providers/openfeature-flipt-provider"
|
|
14
14
|
spec.license = "Apache-2.0"
|
|
15
|
-
spec.required_ruby_version = ">= 3.
|
|
15
|
+
spec.required_ruby_version = ">= 3.4"
|
|
16
16
|
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/tree/main/providers/openfeature-flipt-provider"
|
|
19
19
|
spec.metadata["changelog_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/blob/main/providers/openfeature-flipt-provider/CHANGELOG.md"
|
|
20
20
|
spec.metadata["bug_tracker_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/issues"
|
|
21
21
|
spec.metadata["documentation_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/tree/main/providers/openfeature-flipt-provider/README.md"
|
|
22
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
|
22
23
|
|
|
23
24
|
# Specify which files should be added to the gem when it is released.
|
|
24
25
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
@@ -37,4 +38,5 @@ Gem::Specification.new do |spec|
|
|
|
37
38
|
spec.add_development_dependency "rspec", "~> 3.12.0"
|
|
38
39
|
spec.add_development_dependency "standard", ">= 1.35.1"
|
|
39
40
|
spec.add_development_dependency "rubocop"
|
|
41
|
+
spec.add_development_dependency "simplecov", "~> 0.22"
|
|
40
42
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openfeature-flipt-provider
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Firdaus Al Ghifari
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: ffi
|
|
@@ -108,6 +107,20 @@ dependencies:
|
|
|
108
107
|
- - ">="
|
|
109
108
|
- !ruby/object:Gem::Version
|
|
110
109
|
version: '0'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: simplecov
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - "~>"
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0.22'
|
|
117
|
+
type: :development
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "~>"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '0.22'
|
|
111
124
|
description: OpenFeature Flipt Provider for Ruby
|
|
112
125
|
email:
|
|
113
126
|
- firdaus.alghifari@gmail.com
|
|
@@ -139,7 +152,7 @@ metadata:
|
|
|
139
152
|
changelog_uri: https://github.com/open-feature/ruby-sdk-contrib/blob/main/providers/openfeature-flipt-provider/CHANGELOG.md
|
|
140
153
|
bug_tracker_uri: https://github.com/open-feature/ruby-sdk-contrib/issues
|
|
141
154
|
documentation_uri: https://github.com/open-feature/ruby-sdk-contrib/tree/main/providers/openfeature-flipt-provider/README.md
|
|
142
|
-
|
|
155
|
+
rubygems_mfa_required: 'true'
|
|
143
156
|
rdoc_options: []
|
|
144
157
|
require_paths:
|
|
145
158
|
- lib
|
|
@@ -147,15 +160,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
147
160
|
requirements:
|
|
148
161
|
- - ">="
|
|
149
162
|
- !ruby/object:Gem::Version
|
|
150
|
-
version: '3.
|
|
163
|
+
version: '3.4'
|
|
151
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
165
|
requirements:
|
|
153
166
|
- - ">="
|
|
154
167
|
- !ruby/object:Gem::Version
|
|
155
168
|
version: '0'
|
|
156
169
|
requirements: []
|
|
157
|
-
rubygems_version:
|
|
158
|
-
signing_key:
|
|
170
|
+
rubygems_version: 4.0.20
|
|
159
171
|
specification_version: 4
|
|
160
172
|
summary: OpenFeature Flipt Provider for Ruby
|
|
161
173
|
test_files: []
|