flipper-cloud 0.20.0.beta2 → 0.20.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flipper/cloud/configuration.rb +1 -0
- data/lib/flipper/cloud/middleware.rb +3 -0
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/cloud/middleware_spec.rb +15 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6117cc953e569df240b187815f80b55a4c91014916e98fd9b0e2c0fa9ad45cf1
|
4
|
+
data.tar.gz: 9bcdb028730c3f5376316b3f3536df24463e6aa8c1e09b515ad472015147a1ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bc8e410bc84697b17ddaa0d5afc6fb4e9fd7ae2e775375e3b7b03a31c4fee2628d2fe964aeba93e00ae512d6df1d9338037b667f71907ed1453e0bedb8d0fa0
|
7
|
+
data.tar.gz: 711c266fbc227fa51bc37bff2b3d2cca8ae6c5fc595d7ae1121fce9876cae05974dcae56a259d2f380f2712908f6fe02bcafba8b8b3a1754fb72fd1aa10de288
|
@@ -33,6 +33,9 @@ module Flipper
|
|
33
33
|
message_verifier = MessageVerifier.new(secret: flipper.sync_secret)
|
34
34
|
if message_verifier.verify(payload, signature)
|
35
35
|
flipper.sync
|
36
|
+
body = JSON.generate({
|
37
|
+
groups: Flipper.group_names.map { |name| {name: name}}
|
38
|
+
})
|
36
39
|
end
|
37
40
|
rescue MessageVerifier::InvalidSignature
|
38
41
|
status = 400
|
data/lib/flipper/version.rb
CHANGED
@@ -43,6 +43,12 @@ RSpec.describe Flipper::Cloud::Middleware do
|
|
43
43
|
let(:app) { Flipper::Cloud.app(flipper) }
|
44
44
|
|
45
45
|
it 'uses instance to sync' do
|
46
|
+
Flipper.register(:admins) { |*args| false }
|
47
|
+
Flipper.register(:staff) { |*args| false }
|
48
|
+
Flipper.register(:basic) { |*args| false }
|
49
|
+
Flipper.register(:plus) { |*args| false }
|
50
|
+
Flipper.register(:premium) { |*args| false }
|
51
|
+
|
46
52
|
stub = stub_request_for_token('regular')
|
47
53
|
env = {
|
48
54
|
"HTTP_FLIPPER_CLOUD_SIGNATURE" => signature_header_value,
|
@@ -50,6 +56,15 @@ RSpec.describe Flipper::Cloud::Middleware do
|
|
50
56
|
post '/webhooks', request_body, env
|
51
57
|
|
52
58
|
expect(last_response.status).to eq(200)
|
59
|
+
expect(JSON.parse(last_response.body)).to eq({
|
60
|
+
"groups" => [
|
61
|
+
{"name" => "admins"},
|
62
|
+
{"name" => "staff"},
|
63
|
+
{"name" => "basic"},
|
64
|
+
{"name" => "plus"},
|
65
|
+
{"name" => "premium"},
|
66
|
+
],
|
67
|
+
})
|
53
68
|
expect(stub).to have_been_requested
|
54
69
|
end
|
55
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.0.
|
4
|
+
version: 0.20.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flipper
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.20.0.
|
19
|
+
version: 0.20.0.beta3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.20.0.
|
26
|
+
version: 0.20.0.beta3
|
27
27
|
description:
|
28
28
|
email:
|
29
29
|
- nunemaker@gmail.com
|