stigg-sidecar-sdk 2.87.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +22 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +120 -0
- data/LICENSE +14 -0
- data/README.md +74 -0
- data/Rakefile +12 -0
- data/lib/stigg/sidecar/v1/sidecar_pb.rb +56 -0
- data/lib/stigg/sidecar/v1/sidecar_services_pb.rb +32 -0
- data/lib/stigg_sidecar_sdk/certs/root-ca.pem +30 -0
- data/lib/stigg_sidecar_sdk/client.rb +54 -0
- data/lib/stigg_sidecar_sdk/version.rb +7 -0
- data/lib/stigg_sidecar_sdk.rb +5 -0
- data/project.json +36 -0
- data/stigg-sidecar-sdk.gemspec +31 -0
- metadata +87 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9031e4f64791cee34a3c1a4d761bf1d3b98a580beabebe3ee365f31864ae3895
|
4
|
+
data.tar.gz: fd73076f6e0ee58f18e1cbf9daff6a9c0f6cfb3b8c58cf8a55998a9866a6eb9c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 95eb4901c3e8cc537e611d4914823a52fdc1b65205cd3222c4fbe4523f73f7ff4975bcde1e783df7e67bde4390a3e2dc99257b026b5fb1d0e3320ff372df0475
|
7
|
+
data.tar.gz: 27e41f18ebf5e3afc09a712ffa40b1c35550ffca3bc029941504fe72aaadf1da09354e1068a75ebe2dae4a246f12ef46c195fb7964f56d013bb116d8cd583355
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 3
|
3
|
+
|
4
|
+
Style/StringLiterals:
|
5
|
+
Enabled: true
|
6
|
+
EnforcedStyle: double_quotes
|
7
|
+
|
8
|
+
Style/StringLiteralsInInterpolation:
|
9
|
+
Enabled: true
|
10
|
+
EnforcedStyle: double_quotes
|
11
|
+
|
12
|
+
Layout/LineLength:
|
13
|
+
Max: 120
|
14
|
+
|
15
|
+
Naming/ConstantName:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Metrics/ModuleLength:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Style/MutableConstant:
|
22
|
+
Enabled: false
|
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in stigg-sidecar-sdk.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem "rake", "~> 13.0"
|
9
|
+
|
10
|
+
gem "rspec", "~> 3.0"
|
11
|
+
|
12
|
+
gem "rubocop", "~> 1.21"
|
13
|
+
|
14
|
+
gem "bump", "~> 0.10"
|
15
|
+
|
16
|
+
gem "stigg-api-client", "~> 2.78"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
stigg-sidecar-sdk (2.87.1)
|
5
|
+
grpc (= 1.62.0)
|
6
|
+
stigg-api-client (= 2.78.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (7.1.3.4)
|
12
|
+
base64
|
13
|
+
bigdecimal
|
14
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
+
connection_pool (>= 2.2.5)
|
16
|
+
drb
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
mutex_m
|
20
|
+
tzinfo (~> 2.0)
|
21
|
+
ast (2.4.2)
|
22
|
+
base64 (0.2.0)
|
23
|
+
bigdecimal (3.1.8)
|
24
|
+
bump (0.10.0)
|
25
|
+
concurrent-ruby (1.3.4)
|
26
|
+
connection_pool (2.4.1)
|
27
|
+
diff-lcs (1.5.1)
|
28
|
+
drb (2.2.1)
|
29
|
+
faraday (2.10.1)
|
30
|
+
faraday-net_http (>= 2.0, < 3.2)
|
31
|
+
logger
|
32
|
+
faraday-net_http (3.1.1)
|
33
|
+
net-http
|
34
|
+
fiber-storage (1.0.0)
|
35
|
+
google-protobuf (3.25.4-x86_64-linux)
|
36
|
+
googleapis-common-protos-types (1.15.0)
|
37
|
+
google-protobuf (>= 3.18, < 5.a)
|
38
|
+
graphlient (0.8.0)
|
39
|
+
faraday (~> 2.0)
|
40
|
+
graphql-client
|
41
|
+
graphql (2.3.14)
|
42
|
+
base64
|
43
|
+
fiber-storage
|
44
|
+
graphql-client (0.23.0)
|
45
|
+
activesupport (>= 3.0)
|
46
|
+
graphql (>= 1.13.0)
|
47
|
+
grpc (1.62.0-x86_64-linux)
|
48
|
+
google-protobuf (~> 3.25)
|
49
|
+
googleapis-common-protos-types (~> 1.0)
|
50
|
+
i18n (1.14.5)
|
51
|
+
concurrent-ruby (~> 1.0)
|
52
|
+
json (2.7.2)
|
53
|
+
language_server-protocol (3.17.0.3)
|
54
|
+
logger (1.6.0)
|
55
|
+
minitest (5.25.1)
|
56
|
+
mutex_m (0.2.0)
|
57
|
+
net-http (0.4.1)
|
58
|
+
uri
|
59
|
+
parallel (1.26.3)
|
60
|
+
parser (3.3.4.2)
|
61
|
+
ast (~> 2.4.1)
|
62
|
+
racc
|
63
|
+
racc (1.8.1)
|
64
|
+
rainbow (3.1.1)
|
65
|
+
rake (13.2.1)
|
66
|
+
regexp_parser (2.9.2)
|
67
|
+
rexml (3.3.5)
|
68
|
+
strscan
|
69
|
+
rspec (3.13.0)
|
70
|
+
rspec-core (~> 3.13.0)
|
71
|
+
rspec-expectations (~> 3.13.0)
|
72
|
+
rspec-mocks (~> 3.13.0)
|
73
|
+
rspec-core (3.13.0)
|
74
|
+
rspec-support (~> 3.13.0)
|
75
|
+
rspec-expectations (3.13.1)
|
76
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
77
|
+
rspec-support (~> 3.13.0)
|
78
|
+
rspec-mocks (3.13.1)
|
79
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
80
|
+
rspec-support (~> 3.13.0)
|
81
|
+
rspec-support (3.13.1)
|
82
|
+
rubocop (1.65.1)
|
83
|
+
json (~> 2.3)
|
84
|
+
language_server-protocol (>= 3.17.0)
|
85
|
+
parallel (~> 1.10)
|
86
|
+
parser (>= 3.3.0.2)
|
87
|
+
rainbow (>= 2.2.2, < 4.0)
|
88
|
+
regexp_parser (>= 2.4, < 3.0)
|
89
|
+
rexml (>= 3.2.5, < 4.0)
|
90
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
91
|
+
ruby-progressbar (~> 1.7)
|
92
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
93
|
+
rubocop-ast (1.32.1)
|
94
|
+
parser (>= 3.3.1.0)
|
95
|
+
ruby-progressbar (1.13.0)
|
96
|
+
stigg-api-client (2.78.0)
|
97
|
+
graphlient (>= 0.6.0, < 1.0)
|
98
|
+
graphql-client (>= 0.19, < 1.0)
|
99
|
+
strscan (3.1.0)
|
100
|
+
tzinfo (2.0.6)
|
101
|
+
concurrent-ruby (~> 1.0)
|
102
|
+
unicode-display_width (2.5.0)
|
103
|
+
uri (0.13.0)
|
104
|
+
|
105
|
+
PLATFORMS
|
106
|
+
arm64-darwin-22
|
107
|
+
arm64-darwin-23
|
108
|
+
x86_64-darwin-21
|
109
|
+
x86_64-linux
|
110
|
+
|
111
|
+
DEPENDENCIES
|
112
|
+
bump (~> 0.10)
|
113
|
+
rake (~> 13.0)
|
114
|
+
rspec (~> 3.0)
|
115
|
+
rubocop (~> 1.21)
|
116
|
+
stigg-api-client (~> 2.78)
|
117
|
+
stigg-sidecar-sdk!
|
118
|
+
|
119
|
+
BUNDLED WITH
|
120
|
+
2.3.25
|
data/LICENSE
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
STIGG SDK LICENSE TERMS AND CONDITIONS
|
2
|
+
|
3
|
+
THESE SDK LICENSE TERMS AND CONDITIONS (THIS "AGREEMENT") CONSTITUTE A BINDING CONTRACT BETWEEN YOU AND STIGG INC. ("Stigg"). BY DOWNLOADING, INSTALLING OR USING THE SDK (DEFINED BELOW), YOU ACKNOWLEDGE THAT YOU HAVE READ AND UNDERSTOOD, AND AGREE TO BE BOUND BY, THIS AGREEMENT. YOU MAY NOT USE THE SDK IF YOU DO NOT ACCEPT THE TERMS OF THIS AGREEMENT.
|
4
|
+
License Grant. Stigg grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license, subject to the restrictions stated below, to install, run and use Stigg's proprietary [ ] software development kit, and specifically including the Stigg system files, packaged APIs, and add-ons (the "SDK"), for the sole purpose of accessing and using Stigg's proprietary, cloud-based software platform (the "Platform") in accordance with a Stigg subscription (whether free, paid or otherwise), and provided that you have an active account with Stigg.
|
5
|
+
You may allow your contractor(s) to use the SDK, provided they are acting on your behalf to exercise license rights granted in this Agreement and provided further that you will be responsible for their compliance with this Agreement in such use. You may make copies of the SDK to the extent reasonably necessary to exercise the license rights granted in this Agreement. The SDK is licensed, not sold. Stigg reserves all other rights.
|
6
|
+
Restrictions. Unless applicable law gives you more rights despite this limitation, you will not (and have no right to): (a) copy, "frame" or "mirror" the SDK; (b) sell, assign, transfer, lease, rent, sublicense, or otherwise distribute or make available the SDK to any third party (such as offering it as part of a time-sharing, outsourcing or service bureau environment); (c) publicly perform, display or communicate the SDK; (d) modify, alter, adapt, arrange, or translate the SDK; (e) decompile, disassemble, decrypt, reverse engineer, extract, or otherwise attempt to discover the source code or non-literal aspects (such as the underlying structure, sequence, organization, file formats, non-public APIs, ideas, or algorithms) of, the SDK; (f) remove, alter, or conceal any copyright, trademark, or other proprietary rights notices displayed on or in the SDK; (g) circumvent, disable or otherwise interfere with security-related or technical features or protocols of the SDK; (h) make a derivative work of the SDK, or use it to develop any service or product that is the same as (or substantially similar to) it; (i) store or transmit any robot, malware, Trojan horse, spyware, or similar malicious item intended (or that has the potential) to damage or disrupt the SDK.
|
7
|
+
Support Services. Stigg is not obligated under this Agreement to provide any support services for the SDK. Without limiting the generality of the foregoing, you may make support services requests to Stigg via email at support@stigg.io. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
|
8
|
+
DISCLAIMER OF WARRANTY. THE SDK IS LICENSED “AS IS”, WITHOUT ANY WARRANTIES, GUARANTEES, OR CONDITIONS. STIGG EXCLUDES ALL IMPLIED WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
9
|
+
LIMITATION OF LIABILITY.
|
10
|
+
IN NO EVENT SHALL STIGG, ITS AFFILIATES, OR ITS LICENSORS BE LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT FOR ANY CLAIM, DAMAGES (WHETHER DIRECT OR INDIRECT), LOSSES, OR OTHER LIABILITY, REGARDLESS OF THE THEORY OR BASIS OF LIABILITY, INCLUDING WITHOUT LIMITATION BREACH OF WARRANTY, NEGLIGENCE, MISREPRESENTATION, STRICT LIABILITY, OR OTHER CONTRACT, TORT OR STATUTORY LIABILITY.
|
11
|
+
THIS SECTION (LIMITATION OF LIABILITY) SHALL APPLY: (i) TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW (SUCH AS, FOR EXAMPLE, IF A JURISDICTION DOES NOT ALLOW THE EXCLUSION OR THE LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OF LIABILITY FOR PERSONAL INJURY OR DEATH CAUSED BY NEGLIGENCE); (ii) EVEN IF STIGG OR ITS AFFILIATES HAVE BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; AND (iii) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE.
|
12
|
+
Termination. You may terminate this Agreement by destroying all copies of the SDK. This Agreement shall automatically terminate without notice if (a) you no longer have an active account with Stigg, (b) your subscription to the Platform has expired or terminated; or (c) you fail to comply with any of the terms of this Agreement. Upon termination of this Agreement, you shall promptly destroy all copies of the SDK.
|
13
|
+
Entire Agreement. This Agreement is the entire agreement for the SDK.
|
14
|
+
Governing Law. This Agreement is governed by the substantive laws of the State of Israel, without regard to any conflicts of laws rules or principles, and you and Stigg agree to submit to the exclusive jurisdiction of, and venue in, the courts of Tel Aviv-Yafo in any dispute arising out of or relating to this Agreement. Notwithstanding the foregoing, equitable relief may be sought at any time in any court of competent jurisdiction.
|
data/README.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# stigg-sidecar-sdk
|
2
|
+
|
3
|
+
Stigg Ruby SDK makes it easier to interact with Stigg Sidecar
|
4
|
+
|
5
|
+
## Documentation
|
6
|
+
|
7
|
+
See https://docs.stigg.io/docs/sidecar-sdk
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Install the gem and add to the application's Gemfile by executing:
|
12
|
+
|
13
|
+
$ bundle add stigg-sidecar-sdk
|
14
|
+
|
15
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
|
+
|
17
|
+
$ gem install stigg-sidecar-sdk
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
|
22
|
+
Initialize the client:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
|
26
|
+
require("stigg_sidecar_sdk")
|
27
|
+
|
28
|
+
api_key = ENV["STIGG_SERVER_API_KEY"]
|
29
|
+
|
30
|
+
client = Stigg::Sidecar.create_client(Stigg::Sidecar::ApiConfig.new(api_key),
|
31
|
+
remote_sidecar_host: "localhost",
|
32
|
+
remote_sidecar_port: 8443)
|
33
|
+
|
34
|
+
```
|
35
|
+
|
36
|
+
Get single entitlement of a customer
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
|
40
|
+
require("stigg_sidecar_sdk")
|
41
|
+
|
42
|
+
client = Stigg::Sidecar.create_client(Stigg::Sidecar::ApiConfig.new(api_key))
|
43
|
+
|
44
|
+
entitlement = client.get_metered_entitlement(
|
45
|
+
Stigg::Sidecar::V1::GetMeteredEntitlementRequest.new(customer_id: "customer-demo-01",
|
46
|
+
feature_id: "feature-01-templates",
|
47
|
+
options: Stigg::Sidecar::V1::MeteredEntitlementOptions.new(
|
48
|
+
requested_usage: 1
|
49
|
+
))
|
50
|
+
)
|
51
|
+
|
52
|
+
p "Has access: #{entitlement.has_access}"
|
53
|
+
|
54
|
+
```
|
55
|
+
|
56
|
+
Accessing the `api` client:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
|
60
|
+
client = Stigg::Sidecar.create_client(Stigg::Sidecar::ApiConfig.new(api_key))
|
61
|
+
|
62
|
+
customer_resp = client.api.request(
|
63
|
+
Stigg::Mutation::ProvisionCustomer, {
|
64
|
+
"input": {
|
65
|
+
"customerId": "customer-demo-104",
|
66
|
+
"name": "customer name"
|
67
|
+
}
|
68
|
+
}
|
69
|
+
)
|
70
|
+
|
71
|
+
p "Customer created: #{customer_resp.data.provision_customer.customer.ref_id}"
|
72
|
+
|
73
|
+
```
|
74
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: stigg/sidecar/v1/sidecar.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/protobuf/empty_pb'
|
8
|
+
require 'google/protobuf/timestamp_pb'
|
9
|
+
|
10
|
+
|
11
|
+
descriptor_data = "\n\x1estigg/sidecar/v1/sidecar.proto\x12\x10stigg.sidecar.v1\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9f\x02\n\x12\x45ntitlementFeature\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12@\n\x0c\x66\x65\x61ture_type\x18\x02 \x01(\x0e\x32\x1d.stigg.sidecar.v1.FeatureTypeR\x0b\x66\x65\x61tureType\x12\x19\n\x05units\x18\x03 \x01(\tH\x00R\x05units\x88\x01\x01\x12&\n\x0cunits_plural\x18\x04 \x01(\tH\x01R\x0bunitsPlural\x88\x01\x01\x12:\n\nmeter_type\x18\x05 \x01(\x0e\x32\x1b.stigg.sidecar.v1.MeterTypeR\tmeterType\x12\x1d\n\nis_metered\x18\x06 \x01(\x08R\tisMeteredB\x08\n\x06_unitsB\x0f\n\r_units_plural\"e\n\x12\x42ooleanEntitlement\x12\x43\n\x07\x66\x65\x61ture\x18\x04 \x01(\x0b\x32$.stigg.sidecar.v1.EntitlementFeatureH\x00R\x07\x66\x65\x61ture\x88\x01\x01\x42\n\n\x08_feature\"\xad\x01\n\x12NumericEntitlement\x12\x43\n\x07\x66\x65\x61ture\x18\x04 \x01(\x0b\x32$.stigg.sidecar.v1.EntitlementFeatureH\x00R\x07\x66\x65\x61ture\x88\x01\x01\x12\x19\n\x05value\x18\x05 \x01(\x05H\x01R\x05value\x88\x01\x01\x12!\n\x0cis_unlimited\x18\x06 \x01(\x08R\x0bisUnlimitedB\n\n\x08_featureB\x08\n\x06_value\"\xa3\x03\n\x12MeteredEntitlement\x12\x43\n\x07\x66\x65\x61ture\x18\x04 \x01(\x0b\x32$.stigg.sidecar.v1.EntitlementFeatureH\x00R\x07\x66\x65\x61ture\x88\x01\x01\x12$\n\x0busage_limit\x18\x05 \x01(\x01H\x01R\nusageLimit\x88\x01\x01\x12!\n\x0cis_unlimited\x18\x06 \x01(\x08R\x0bisUnlimited\x12#\n\rcurrent_usage\x18\x07 \x01(\x01R\x0c\x63urrentUsage\x12P\n\x0creset_period\x18\t \x01(\x0e\x32(.stigg.sidecar.v1.EntitlementResetPeriodH\x02R\x0bresetPeriod\x88\x01\x01\x12G\n\x0fnext_reset_date\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x03R\rnextResetDate\x88\x01\x01\x42\n\n\x08_featureB\x0e\n\x0c_usage_limitB\x0f\n\r_reset_periodB\x12\n\x10_next_reset_date\"\xe2\x01\n\x0b\x45ntitlement\x12@\n\x07\x62oolean\x18\x01 \x01(\x0b\x32$.stigg.sidecar.v1.BooleanEntitlementH\x00R\x07\x62oolean\x12@\n\x07numeric\x18\x02 \x01(\x0b\x32$.stigg.sidecar.v1.NumericEntitlementH\x00R\x07numeric\x12@\n\x07metered\x18\x03 \x01(\x0b\x32$.stigg.sidecar.v1.MeteredEntitlementH\x00R\x07meteredB\r\n\x0b\x65ntitlement\"o\n\x16GetEntitlementsRequest\x12\x1f\n\x0b\x63ustomer_id\x18\x01 \x01(\tR\ncustomerId\x12$\n\x0bresource_id\x18\x02 \x01(\tH\x00R\nresourceId\x88\x01\x01\x42\x0e\n\x0c_resource_id\"\\\n\x17GetEntitlementsResponse\x12\x41\n\x0c\x65ntitlements\x18\x01 \x03(\x0b\x32\x1d.stigg.sidecar.v1.EntitlementR\x0c\x65ntitlements\";\n\x1a\x42ooleanEntitlementFallback\x12\x1d\n\nhas_access\x18\x01 \x01(\x08R\thasAccess\"w\n\x19\x42ooleanEntitlementOptions\x12M\n\x08\x66\x61llback\x18\x01 \x01(\x0b\x32,.stigg.sidecar.v1.BooleanEntitlementFallbackH\x00R\x08\x66\x61llback\x88\x01\x01\x42\x0b\n\t_fallback\"\xec\x01\n\x1cGetBooleanEntitlementRequest\x12\x1f\n\x0b\x63ustomer_id\x18\x01 \x01(\tR\ncustomerId\x12\x1d\n\nfeature_id\x18\x02 \x01(\tR\tfeatureId\x12$\n\x0bresource_id\x18\x03 \x01(\tH\x00R\nresourceId\x88\x01\x01\x12J\n\x07options\x18\x04 \x01(\x0b\x32+.stigg.sidecar.v1.BooleanEntitlementOptionsH\x01R\x07options\x88\x01\x01\x42\x0e\n\x0c_resource_idB\n\n\x08_options\"\x9d\x02\n\x1dGetBooleanEntitlementResponse\x12\x1d\n\nhas_access\x18\x01 \x01(\x08R\thasAccess\x12\x1f\n\x0bis_fallback\x18\x02 \x01(\x08R\nisFallback\x12[\n\x14\x61\x63\x63\x65ss_denied_reason\x18\x03 \x01(\x0e\x32$.stigg.sidecar.v1.AccessDeniedReasonH\x00R\x12\x61\x63\x63\x65ssDeniedReason\x88\x01\x01\x12\x46\n\x0b\x65ntitlement\x18\x04 \x01(\x0b\x32$.stigg.sidecar.v1.BooleanEntitlementR\x0b\x65ntitlementB\x17\n\x15_access_denied_reason\"\x99\x01\n\x1aNumericEntitlementFallback\x12\x1d\n\nhas_access\x18\x01 \x01(\x08R\thasAccess\x12\x19\n\x05value\x18\x02 \x01(\x05H\x00R\x05value\x88\x01\x01\x12&\n\x0cis_unlimited\x18\x03 \x01(\x08H\x01R\x0bisUnlimited\x88\x01\x01\x42\x08\n\x06_valueB\x0f\n\r_is_unlimited\"w\n\x19NumericEntitlementOptions\x12M\n\x08\x66\x61llback\x18\x01 \x01(\x0b\x32,.stigg.sidecar.v1.NumericEntitlementFallbackH\x00R\x08\x66\x61llback\x88\x01\x01\x42\x0b\n\t_fallback\"\xec\x01\n\x1cGetNumericEntitlementRequest\x12\x1f\n\x0b\x63ustomer_id\x18\x01 \x01(\tR\ncustomerId\x12\x1d\n\nfeature_id\x18\x02 \x01(\tR\tfeatureId\x12$\n\x0bresource_id\x18\x03 \x01(\tH\x00R\nresourceId\x88\x01\x01\x12J\n\x07options\x18\x04 \x01(\x0b\x32+.stigg.sidecar.v1.NumericEntitlementOptionsH\x01R\x07options\x88\x01\x01\x42\x0e\n\x0c_resource_idB\n\n\x08_options\"\x9d\x02\n\x1dGetNumericEntitlementResponse\x12\x1d\n\nhas_access\x18\x01 \x01(\x08R\thasAccess\x12\x1f\n\x0bis_fallback\x18\x02 \x01(\x08R\nisFallback\x12[\n\x14\x61\x63\x63\x65ss_denied_reason\x18\x03 \x01(\x0e\x32$.stigg.sidecar.v1.AccessDeniedReasonH\x00R\x12\x61\x63\x63\x65ssDeniedReason\x88\x01\x01\x12\x46\n\x0b\x65ntitlement\x18\x04 \x01(\x0b\x32$.stigg.sidecar.v1.NumericEntitlementR\x0b\x65ntitlementB\x17\n\x15_access_denied_reason\"\xaa\x01\n\x1aMeteredEntitlementFallback\x12\x1d\n\nhas_access\x18\x01 \x01(\x08R\thasAccess\x12$\n\x0busage_limit\x18\x02 \x01(\x01H\x00R\nusageLimit\x88\x01\x01\x12&\n\x0cis_unlimited\x18\x03 \x01(\x08H\x01R\x0bisUnlimited\x88\x01\x01\x42\x0e\n\x0c_usage_limitB\x0f\n\r_is_unlimited\"\xb9\x01\n\x19MeteredEntitlementOptions\x12,\n\x0frequested_usage\x18\x01 \x01(\x01H\x00R\x0erequestedUsage\x88\x01\x01\x12M\n\x08\x66\x61llback\x18\x02 \x01(\x0b\x32,.stigg.sidecar.v1.MeteredEntitlementFallbackH\x01R\x08\x66\x61llback\x88\x01\x01\x42\x12\n\x10_requested_usageB\x0b\n\t_fallback\"\xec\x01\n\x1cGetMeteredEntitlementRequest\x12\x1f\n\x0b\x63ustomer_id\x18\x01 \x01(\tR\ncustomerId\x12\x1d\n\nfeature_id\x18\x02 \x01(\tR\tfeatureId\x12$\n\x0bresource_id\x18\x03 \x01(\tH\x00R\nresourceId\x88\x01\x01\x12J\n\x07options\x18\x04 \x01(\x0b\x32+.stigg.sidecar.v1.MeteredEntitlementOptionsH\x01R\x07options\x88\x01\x01\x42\x0e\n\x0c_resource_idB\n\n\x08_options\"\xc6\x02\n\x1dGetMeteredEntitlementResponse\x12\x1d\n\nhas_access\x18\x01 \x01(\x08R\thasAccess\x12\x1f\n\x0bis_fallback\x18\x02 \x01(\x08R\nisFallback\x12[\n\x14\x61\x63\x63\x65ss_denied_reason\x18\x03 \x01(\x0e\x32$.stigg.sidecar.v1.AccessDeniedReasonH\x00R\x12\x61\x63\x63\x65ssDeniedReason\x88\x01\x01\x12\'\n\x0frequested_usage\x18\x04 \x01(\x01R\x0erequestedUsage\x12\x46\n\x0b\x65ntitlement\x18\x05 \x01(\x0b\x32$.stigg.sidecar.v1.MeteredEntitlementR\x0b\x65ntitlementB\x17\n\x15_access_denied_reason\"\x98\x02\n\x0cRedisOptions\x12-\n\x12\x65nvironment_prefix\x18\x01 \x01(\tR\x11\x65nvironmentPrefix\x12\x17\n\x04host\x18\x02 \x01(\tH\x00R\x04host\x88\x01\x01\x12\x17\n\x04port\x18\x03 \x01(\x05H\x01R\x04port\x88\x01\x01\x12\x13\n\x02\x64\x62\x18\x04 \x01(\x05H\x02R\x02\x64\x62\x88\x01\x01\x12\x1f\n\x08username\x18\x05 \x01(\tH\x03R\x08username\x88\x01\x01\x12\x1f\n\x08password\x18\x06 \x01(\tH\x04R\x08password\x88\x01\x01\x12\x15\n\x03ttl\x18\x07 \x01(\x05H\x05R\x03ttl\x88\x01\x01\x42\x07\n\x05_hostB\x07\n\x05_portB\x05\n\x03_dbB\x0b\n\t_usernameB\x0b\n\t_passwordB\x06\n\x04_ttl\"\xff\x01\n\x13\x45ntitlementFallback\x12H\n\x07\x62oolean\x18\x01 \x01(\x0b\x32,.stigg.sidecar.v1.BooleanEntitlementFallbackH\x00R\x07\x62oolean\x12H\n\x07numeric\x18\x02 \x01(\x0b\x32,.stigg.sidecar.v1.NumericEntitlementFallbackH\x00R\x07numeric\x12H\n\x07metered\x18\x03 \x01(\x0b\x32,.stigg.sidecar.v1.MeteredEntitlementFallbackH\x00R\x07meteredB\n\n\x08\x66\x61llback\"\xbf\x01\n\tApiConfig\x12\x17\n\x07\x61pi_key\x18\x01 \x01(\tR\x06\x61piKey\x12\x1c\n\x07\x61pi_url\x18\x02 \x01(\tH\x00R\x06\x61piUrl\x88\x01\x01\x12&\n\x0c\x65\x64ge_enabled\x18\x03 \x01(\x08H\x01R\x0b\x65\x64geEnabled\x88\x01\x01\x12%\n\x0c\x65\x64ge_api_url\x18\x04 \x01(\tH\x02R\nedgeApiUrl\x88\x01\x01\x42\n\n\x08_api_urlB\x0f\n\r_edge_enabledB\x0f\n\r_edge_api_url\"\xe7\x03\n\x12LocalSidecarConfig\x12\"\n\nws_enabled\x18\x05 \x01(\x08H\x00R\twsEnabled\x88\x01\x01\x12\x1a\n\x06ws_url\x18\x06 \x01(\tH\x01R\x05wsUrl\x88\x01\x01\x12\x39\n\x05redis\x18\x07 \x01(\x0b\x32\x1e.stigg.sidecar.v1.RedisOptionsH\x02R\x05redis\x88\x01\x01\x12s\n\x15\x65ntitlements_fallback\x18\x08 \x03(\x0b\x32>.stigg.sidecar.v1.LocalSidecarConfig.EntitlementsFallbackEntryR\x14\x65ntitlementsFallback\x12\x34\n\x14\x63\x61\x63he_max_size_bytes\x18\t \x01(\x03H\x03R\x11\x63\x61\x63heMaxSizeBytes\x88\x01\x01\x1an\n\x19\x45ntitlementsFallbackEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12;\n\x05value\x18\x02 \x01(\x0b\x32%.stigg.sidecar.v1.EntitlementFallbackR\x05value:\x02\x38\x01\x42\r\n\x0b_ws_enabledB\t\n\x07_ws_urlB\x08\n\x06_redisB\x17\n\x15_cache_max_size_bytes\"\x89\x02\n\x12ReportUsageRequest\x12\x1f\n\x0b\x63ustomer_id\x18\x01 \x01(\tR\ncustomerId\x12$\n\x0bresource_id\x18\x02 \x01(\tH\x00R\nresourceId\x88\x01\x01\x12\x1d\n\nfeature_id\x18\x03 \x01(\tR\tfeatureId\x12\x14\n\x05value\x18\x04 \x01(\x01R\x05value\x12S\n\x0fupdate_behavior\x18\x05 \x01(\x0e\x32%.stigg.sidecar.v1.UsageUpdateBehaviorH\x01R\x0eupdateBehavior\x88\x01\x01\x42\x0e\n\x0c_resource_idB\x12\n\x10_update_behavior\"\x8f\x01\n\x13\x45ventDimensionValue\x12#\n\x0cstring_value\x18\x01 \x01(\tH\x00R\x0bstringValue\x12#\n\x0cnumber_value\x18\x02 \x01(\x01H\x00R\x0bnumberValue\x12%\n\rboolean_value\x18\x03 \x01(\x08H\x00R\x0c\x62ooleanValueB\x07\n\x05value\"\xa2\x03\n\x05\x45vent\x12\x1d\n\nevent_name\x18\x01 \x01(\tR\teventName\x12\x1f\n\x0b\x63ustomer_id\x18\x02 \x01(\tR\ncustomerId\x12\'\n\x0fidempotency_key\x18\x03 \x01(\tR\x0eidempotencyKey\x12$\n\x0bresource_id\x18\x04 \x01(\tH\x00R\nresourceId\x88\x01\x01\x12G\n\ndimensions\x18\x05 \x03(\x0b\x32\'.stigg.sidecar.v1.Event.DimensionsEntryR\ndimensions\x12=\n\ttimestamp\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\ttimestamp\x88\x01\x01\x1a\x64\n\x0f\x44imensionsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12;\n\x05value\x18\x02 \x01(\x0b\x32%.stigg.sidecar.v1.EventDimensionValueR\x05value:\x02\x38\x01\x42\x0e\n\x0c_resource_idB\x0c\n\n_timestamp\"<\n\x13ReportUsageResponse\x12%\n\x0emeasurement_id\x18\x01 \x01(\tR\rmeasurementId\"F\n\x13ReportEventsRequest\x12/\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x17.stigg.sidecar.v1.EventR\x06\x65vents\"r\n\x19ReloadEntitlementsRequest\x12\x1f\n\x0b\x63ustomer_id\x18\x01 \x01(\tR\ncustomerId\x12$\n\x0bresource_id\x18\x02 \x01(\tH\x00R\nresourceId\x88\x01\x01\x42\x0e\n\x0c_resource_id\"R\n\x1aReloadEntitlementsResponse\x12\x34\n\x16\x65ntitled_entity_exists\x18\x01 \x01(\x08R\x14\x65ntitledEntityExists*\xc6\x03\n\x12\x41\x63\x63\x65ssDeniedReason\x12$\n ACCESS_DENIED_REASON_UNSPECIFIED\x10\x00\x12 \n\x1c\x41\x43\x43\x45SS_DENIED_REASON_UNKNOWN\x10\x01\x12-\n)ACCESS_DENIED_REASON_CUSTOMER_IS_ARCHIVED\x10\x02\x12+\n\'ACCESS_DENIED_REASON_CUSTOMER_NOT_FOUND\x10\x03\x12\x34\n0ACCESS_DENIED_REASON_CUSTOMER_RESOURCE_NOT_FOUND\x10\x04\x12*\n&ACCESS_DENIED_REASON_FEATURE_NOT_FOUND\x10\x05\x12/\n+ACCESS_DENIED_REASON_NO_ACTIVE_SUBSCRIPTION\x10\x06\x12?\n;ACCESS_DENIED_REASON_NO_FEATURE_ENTITLEMENT_IN_SUBSCRIPTION\x10\x07\x12\x38\n4ACCESS_DENIED_REASON_REQUESTED_USAGE_EXCEEDING_LIMIT\x10\x08*^\n\x0b\x46\x65\x61tureType\x12\x1c\n\x18\x46\x45\x41TURE_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x46\x45\x41TURE_TYPE_BOOLEAN\x10\x01\x12\x17\n\x13\x46\x45\x41TURE_TYPE_NUMBER\x10\x02*t\n\tMeterType\x12\x1a\n\x16METER_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fMETER_TYPE_NONE\x10\x01\x12\x1a\n\x16METER_TYPE_FLUCTUATING\x10\x02\x12\x1a\n\x16METER_TYPE_INCREMENTAL\x10\x03*\xf1\x01\n\x16\x45ntitlementResetPeriod\x12(\n$ENTITLEMENT_RESET_PERIOD_UNSPECIFIED\x10\x00\x12 \n\x1c\x45NTITLEMENT_RESET_PERIOD_DAY\x10\x01\x12!\n\x1d\x45NTITLEMENT_RESET_PERIOD_HOUR\x10\x02\x12\"\n\x1e\x45NTITLEMENT_RESET_PERIOD_MONTH\x10\x03\x12!\n\x1d\x45NTITLEMENT_RESET_PERIOD_WEEK\x10\x04\x12!\n\x1d\x45NTITLEMENT_RESET_PERIOD_YEAR\x10\x05*|\n\x13UsageUpdateBehavior\x12%\n!USAGE_UPDATE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x1f\n\x1bUSAGE_UPDATE_BEHAVIOR_DELTA\x10\x01\x12\x1d\n\x19USAGE_UPDATE_BEHAVIOR_SET\x10\x02\x32\x82\x06\n\x0eSidecarService\x12\x66\n\x0fGetEntitlements\x12(.stigg.sidecar.v1.GetEntitlementsRequest\x1a).stigg.sidecar.v1.GetEntitlementsResponse\x12x\n\x15GetBooleanEntitlement\x12..stigg.sidecar.v1.GetBooleanEntitlementRequest\x1a/.stigg.sidecar.v1.GetBooleanEntitlementResponse\x12x\n\x15GetNumericEntitlement\x12..stigg.sidecar.v1.GetNumericEntitlementRequest\x1a/.stigg.sidecar.v1.GetNumericEntitlementResponse\x12x\n\x15GetMeteredEntitlement\x12..stigg.sidecar.v1.GetMeteredEntitlementRequest\x1a/.stigg.sidecar.v1.GetMeteredEntitlementResponse\x12Z\n\x0bReportUsage\x12$.stigg.sidecar.v1.ReportUsageRequest\x1a%.stigg.sidecar.v1.ReportUsageResponse\x12M\n\x0cReportEvents\x12%.stigg.sidecar.v1.ReportEventsRequest\x1a\x16.google.protobuf.Empty\x12o\n\x12ReloadEntitlements\x12+.stigg.sidecar.v1.ReloadEntitlementsRequest\x1a,.stigg.sidecar.v1.ReloadEntitlementsResponseB\x8b\x01\n\x19io.stigg.sidecar.proto.v1B\x0cSidecarProtoP\x01\xa2\x02\x03SSX\xaa\x02\x10Stigg.Sidecar.V1\xca\x02\x10Stigg\\Sidecar\\V1\xe2\x02\x1cStigg\\Sidecar\\V1\\GPBMetadata\xea\x02\x12Stigg::Sidecar::V1b\x06proto3"
|
12
|
+
|
13
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
14
|
+
pool.add_serialized_file(descriptor_data)
|
15
|
+
|
16
|
+
module Stigg
|
17
|
+
module Sidecar
|
18
|
+
module V1
|
19
|
+
EntitlementFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.EntitlementFeature").msgclass
|
20
|
+
BooleanEntitlement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.BooleanEntitlement").msgclass
|
21
|
+
NumericEntitlement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.NumericEntitlement").msgclass
|
22
|
+
MeteredEntitlement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.MeteredEntitlement").msgclass
|
23
|
+
Entitlement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.Entitlement").msgclass
|
24
|
+
GetEntitlementsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.GetEntitlementsRequest").msgclass
|
25
|
+
GetEntitlementsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.GetEntitlementsResponse").msgclass
|
26
|
+
BooleanEntitlementFallback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.BooleanEntitlementFallback").msgclass
|
27
|
+
BooleanEntitlementOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.BooleanEntitlementOptions").msgclass
|
28
|
+
GetBooleanEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.GetBooleanEntitlementRequest").msgclass
|
29
|
+
GetBooleanEntitlementResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.GetBooleanEntitlementResponse").msgclass
|
30
|
+
NumericEntitlementFallback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.NumericEntitlementFallback").msgclass
|
31
|
+
NumericEntitlementOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.NumericEntitlementOptions").msgclass
|
32
|
+
GetNumericEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.GetNumericEntitlementRequest").msgclass
|
33
|
+
GetNumericEntitlementResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.GetNumericEntitlementResponse").msgclass
|
34
|
+
MeteredEntitlementFallback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.MeteredEntitlementFallback").msgclass
|
35
|
+
MeteredEntitlementOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.MeteredEntitlementOptions").msgclass
|
36
|
+
GetMeteredEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.GetMeteredEntitlementRequest").msgclass
|
37
|
+
GetMeteredEntitlementResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.GetMeteredEntitlementResponse").msgclass
|
38
|
+
RedisOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.RedisOptions").msgclass
|
39
|
+
EntitlementFallback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.EntitlementFallback").msgclass
|
40
|
+
ApiConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.ApiConfig").msgclass
|
41
|
+
LocalSidecarConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.LocalSidecarConfig").msgclass
|
42
|
+
ReportUsageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.ReportUsageRequest").msgclass
|
43
|
+
EventDimensionValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.EventDimensionValue").msgclass
|
44
|
+
Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.Event").msgclass
|
45
|
+
ReportUsageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.ReportUsageResponse").msgclass
|
46
|
+
ReportEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.ReportEventsRequest").msgclass
|
47
|
+
ReloadEntitlementsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.ReloadEntitlementsRequest").msgclass
|
48
|
+
ReloadEntitlementsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.ReloadEntitlementsResponse").msgclass
|
49
|
+
AccessDeniedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.AccessDeniedReason").enummodule
|
50
|
+
FeatureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.FeatureType").enummodule
|
51
|
+
MeterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.MeterType").enummodule
|
52
|
+
EntitlementResetPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.EntitlementResetPeriod").enummodule
|
53
|
+
UsageUpdateBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stigg.sidecar.v1.UsageUpdateBehavior").enummodule
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: stigg/sidecar/v1/sidecar.proto for package 'Stigg.Sidecar.V1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require 'stigg/sidecar/v1/sidecar_pb'
|
6
|
+
|
7
|
+
module Stigg
|
8
|
+
module Sidecar
|
9
|
+
module V1
|
10
|
+
module SidecarService
|
11
|
+
class Service
|
12
|
+
|
13
|
+
include ::GRPC::GenericService
|
14
|
+
|
15
|
+
self.marshal_class_method = :encode
|
16
|
+
self.unmarshal_class_method = :decode
|
17
|
+
self.service_name = 'stigg.sidecar.v1.SidecarService'
|
18
|
+
|
19
|
+
rpc :GetEntitlements, ::Stigg::Sidecar::V1::GetEntitlementsRequest, ::Stigg::Sidecar::V1::GetEntitlementsResponse
|
20
|
+
rpc :GetBooleanEntitlement, ::Stigg::Sidecar::V1::GetBooleanEntitlementRequest, ::Stigg::Sidecar::V1::GetBooleanEntitlementResponse
|
21
|
+
rpc :GetNumericEntitlement, ::Stigg::Sidecar::V1::GetNumericEntitlementRequest, ::Stigg::Sidecar::V1::GetNumericEntitlementResponse
|
22
|
+
rpc :GetMeteredEntitlement, ::Stigg::Sidecar::V1::GetMeteredEntitlementRequest, ::Stigg::Sidecar::V1::GetMeteredEntitlementResponse
|
23
|
+
rpc :ReportUsage, ::Stigg::Sidecar::V1::ReportUsageRequest, ::Stigg::Sidecar::V1::ReportUsageResponse
|
24
|
+
rpc :ReportEvents, ::Stigg::Sidecar::V1::ReportEventsRequest, ::Google::Protobuf::Empty
|
25
|
+
rpc :ReloadEntitlements, ::Stigg::Sidecar::V1::ReloadEntitlementsRequest, ::Stigg::Sidecar::V1::ReloadEntitlementsResponse
|
26
|
+
end
|
27
|
+
|
28
|
+
Stub = Service.rpc_stub_class
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIFHDCCA4SgAwIBAgIRALwydIL6IGLIVSPkF5HMsx8wDQYJKoZIhvcNAQELBQAw
|
3
|
+
gaUxHjAcBgNVBAoTFW1rY2VydCBkZXZlbG9wbWVudCBDQTE9MDsGA1UECww0YW50
|
4
|
+
b25AQW50b25zLU1hY0Jvb2stUHJvLTE2LmxvY2FsIChBbnRvbiBaYWdyZWJlbG55
|
5
|
+
KTFEMEIGA1UEAww7bWtjZXJ0IGFudG9uQEFudG9ucy1NYWNCb29rLVByby0xNi5s
|
6
|
+
b2NhbCAoQW50b24gWmFncmViZWxueSkwHhcNMjMxMDI2MTMwMTEzWhcNMzMxMDI2
|
7
|
+
MTMwMTEzWjCBpTEeMBwGA1UEChMVbWtjZXJ0IGRldmVsb3BtZW50IENBMT0wOwYD
|
8
|
+
VQQLDDRhbnRvbkBBbnRvbnMtTWFjQm9vay1Qcm8tMTYubG9jYWwgKEFudG9uIFph
|
9
|
+
Z3JlYmVsbnkpMUQwQgYDVQQDDDtta2NlcnQgYW50b25AQW50b25zLU1hY0Jvb2st
|
10
|
+
UHJvLTE2LmxvY2FsIChBbnRvbiBaYWdyZWJlbG55KTCCAaIwDQYJKoZIhvcNAQEB
|
11
|
+
BQADggGPADCCAYoCggGBAMtBUFUnE6SmjYuYVXI8pTX+9yGdtU+lzDt2R+35Yr24
|
12
|
+
3wXdnmDQe9Pt8y/045Sfb7DCfw0V+wHoMzQindMQYXyBOxkqV+OfKNyTx9PBfbnv
|
13
|
+
97mQozaHuY+Rb9AegHDsP/IY/4bb0JfDrhstqRFQZAMY4+edltWj9/6ry+Z9iv64
|
14
|
+
OG7Afmjl500+XwX5VrnurZdoe0C94ViGN4h8syIZa+hzXP55MVGAHtVlwQcqeXm5
|
15
|
+
u8xXeQRM7DxDiZavmPb5qtLsAjNuH0DU8TymzPepwEZIbCB2KGSm3ZWIoPZq7hJK
|
16
|
+
d9C5udOMpmiONp2WYPHYl5elbZX7UVWqPJvKx0j37nA4gGLDIYo17guJ4l3h/tM8
|
17
|
+
fKG+IK/xPuGoLQmDChgACKW90CXnWUkiBoRkCV5g9t9YhcmswQhpg75VD+/lKLA3
|
18
|
+
J0i0BznIF1fKIUbO1FfVzL5zA9Ol+tWsjOMq0GGzwAjdd5PdG1f92mR/uEgj3/Ui
|
19
|
+
ikVr1G4mZdIW52Uy6wG2OQIDAQABo0UwQzAOBgNVHQ8BAf8EBAMCAgQwEgYDVR0T
|
20
|
+
AQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUKsVOfggqEr3xa5eV6AKgTXEs6tUwDQYJ
|
21
|
+
KoZIhvcNAQELBQADggGBADEVE6sDqw2Ewkx3jJAG1QtRWl/ejebpy/PIvVdbikE/
|
22
|
+
5OI8EnUZTEBZ3Y+yfIb8ohmukm8kUTJ4DMo6eE4nmBSoNzEcwhU0uZSUgxj9N74I
|
23
|
+
yG0Otp4w4foGEpEUztIQl+vd2GJvk35LtqZ5+4ikmOO1iM0NDrZnAjEXLx2ppIc4
|
24
|
+
uvA1+vR9qi5yhs8hUO5licOoCWpc572Ovu4UOSCdRh1/pu6XcikrQ50o0iDMxDUs
|
25
|
+
F5kev+2MUDags9qitHU2kb5bAblo+aoAf7TeGLdCuBiYcr5z0PkJxGw9/b9eVzby
|
26
|
+
Nkg//tVm+4a9W5gr6eo2vK7p4iIfq7+hM9ZLKxXMX3+3mYhaGUftxYRMryZB7SDp
|
27
|
+
VL170K07waLzV4ghq3+lPXVO/24sveBx4jFVsAXKxHGfdFC21nJvTsIp6ythrla5
|
28
|
+
F2CY+gFdpzP4qboqRrukMKuXK0GhNbibJ0vHWtljHypiHoUXmUMV0uL90Nn8uvz/
|
29
|
+
xRT8CwazETbo/z5jk+Zw3A==
|
30
|
+
-----END CERTIFICATE-----
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "stigg"
|
4
|
+
|
5
|
+
module Stigg
|
6
|
+
module Sidecar
|
7
|
+
class ApiConfig
|
8
|
+
attr_reader :api_key, :api_url, :edge_enabled, :edge_api_url, :request_timeout
|
9
|
+
|
10
|
+
# @param [String] api_key
|
11
|
+
# @param [String] api_url
|
12
|
+
# @param [Boolean] edge_enabled
|
13
|
+
# @param [String] edge_api_url
|
14
|
+
# @return [ApiConfig]
|
15
|
+
def initialize(api_key,
|
16
|
+
api_url: nil,
|
17
|
+
edge_enabled: nil,
|
18
|
+
edge_api_url: nil,
|
19
|
+
request_timeout: nil)
|
20
|
+
@api_key = api_key
|
21
|
+
@api_url = api_url
|
22
|
+
@edge_enabled = edge_enabled
|
23
|
+
@edge_api_url = edge_api_url
|
24
|
+
@request_timeout = request_timeout
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
class Client < Stigg::Sidecar::V1::SidecarService::Stub
|
29
|
+
attr_reader :api
|
30
|
+
|
31
|
+
def initialize(api_config,
|
32
|
+
remote_sidecar_host,
|
33
|
+
remote_sidecar_port)
|
34
|
+
host = "#{remote_sidecar_host}:#{remote_sidecar_port}"
|
35
|
+
credentials = GRPC::Core::ChannelCredentials.new(File.read(File.join(__dir__, "certs/root-ca.pem")))
|
36
|
+
super(host, credentials)
|
37
|
+
api_key = api_config.api_key
|
38
|
+
api_url = api_config.api_url || "https://api.stigg.io/graphql"
|
39
|
+
request_timeout = api_config.request_timeout || 30
|
40
|
+
@api = Stigg.create_client(api_key, api_url, request_timeout)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class << self
|
45
|
+
# @param [ApiConfig] api_config
|
46
|
+
# @param [String] remote_sidecar_host
|
47
|
+
# @param [Integer] remote_sidecar_port
|
48
|
+
# @return [Client]
|
49
|
+
def create_client(api_config, remote_sidecar_host: "localhost", remote_sidecar_port: 8443)
|
50
|
+
Client.new(api_config, remote_sidecar_host, remote_sidecar_port)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/project.json
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
3
|
+
"sourceRoot": "packages/sidecar-sdk-ruby/lib",
|
4
|
+
"projectType": "library",
|
5
|
+
"implicitDependencies": ["sidecar-schema"],
|
6
|
+
"targets": {
|
7
|
+
"generate": {
|
8
|
+
"executor": "nx:run-commands",
|
9
|
+
"options": {
|
10
|
+
"command": "./scripts/generate.sh",
|
11
|
+
"cwd": "packages/sidecar-sdk-ruby"
|
12
|
+
}
|
13
|
+
},
|
14
|
+
"publish": {
|
15
|
+
"executor": "nx:run-commands",
|
16
|
+
"options": {
|
17
|
+
"command": "./scripts/publish.sh {args.ver}",
|
18
|
+
"cwd": "packages/sidecar-sdk-ruby"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"test": {
|
22
|
+
"executor": "nx:run-commands",
|
23
|
+
"options": {
|
24
|
+
"command": "bundle exec rake spec",
|
25
|
+
"cwd": "packages/sidecar-sdk-ruby"
|
26
|
+
},
|
27
|
+
"dependsOn": [
|
28
|
+
{
|
29
|
+
"projects": "self",
|
30
|
+
"target": "generate"
|
31
|
+
}
|
32
|
+
]
|
33
|
+
}
|
34
|
+
},
|
35
|
+
"tags": []
|
36
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/stigg_sidecar_sdk/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "stigg-sidecar-sdk"
|
7
|
+
spec.version = Stigg::Sidecar::VERSION
|
8
|
+
spec.authors = ["Stigg"]
|
9
|
+
spec.email = ["support@stigg.io"]
|
10
|
+
|
11
|
+
spec.summary = "Stigg Sidecar SDK"
|
12
|
+
spec.description = "Stigg Sidecar SDK for Ruby"
|
13
|
+
spec.homepage = "https://stigg.io"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 3.0.0"
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
19
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
+
spec.files = Dir.chdir(__dir__) do
|
21
|
+
`git ls-files -z ; find lib/stigg -print0 ; find lib/stigg_sidecar_sdk/certs -print0`.split("\x0").reject do |f|
|
22
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|scripts)/|\.(?:git|travis|circleci)|appveyor)})
|
23
|
+
end
|
24
|
+
end
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_dependency "grpc", "1.62.0"
|
30
|
+
spec.add_dependency "stigg-api-client", "2.78.0"
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: stigg-sidecar-sdk
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.87.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stigg
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-08-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: grpc
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.62.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.62.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: stigg-api-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.78.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.78.0
|
41
|
+
description: Stigg Sidecar SDK for Ruby
|
42
|
+
email:
|
43
|
+
- support@stigg.io
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".rspec"
|
49
|
+
- ".rubocop.yml"
|
50
|
+
- Gemfile
|
51
|
+
- Gemfile.lock
|
52
|
+
- LICENSE
|
53
|
+
- README.md
|
54
|
+
- Rakefile
|
55
|
+
- lib/stigg/sidecar/v1/sidecar_pb.rb
|
56
|
+
- lib/stigg/sidecar/v1/sidecar_services_pb.rb
|
57
|
+
- lib/stigg_sidecar_sdk.rb
|
58
|
+
- lib/stigg_sidecar_sdk/certs/root-ca.pem
|
59
|
+
- lib/stigg_sidecar_sdk/client.rb
|
60
|
+
- lib/stigg_sidecar_sdk/version.rb
|
61
|
+
- project.json
|
62
|
+
- stigg-sidecar-sdk.gemspec
|
63
|
+
homepage: https://stigg.io
|
64
|
+
licenses:
|
65
|
+
- MIT
|
66
|
+
metadata:
|
67
|
+
homepage_uri: https://stigg.io
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options: []
|
70
|
+
require_paths:
|
71
|
+
- lib
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 3.0.0
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubygems_version: 3.4.19
|
84
|
+
signing_key:
|
85
|
+
specification_version: 4
|
86
|
+
summary: Stigg Sidecar SDK
|
87
|
+
test_files: []
|