fingerly 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.
data/sig/fingerly.rbs ADDED
@@ -0,0 +1,213 @@
1
+ # Type signatures for the Fingerly server SDK.
2
+ #
3
+ # RBS is Ruby's answer to a typed public surface: an editor, Steep or a
4
+ # consumer's own type check reads these without the SDK shipping a type
5
+ # checker. `signatures_test.rb` asserts that every method named here exists,
6
+ # so a reader that was added by metaprogramming cannot drift out of them.
7
+
8
+ module Fingerly
9
+ VERSION: String
10
+
11
+ class Error < StandardError
12
+ end
13
+
14
+ class ConfigurationError < ArgumentError
15
+ end
16
+
17
+ class APIError < Error
18
+ attr_reader status: Integer
19
+ attr_reader code: String?
20
+ attr_reader details: untyped
21
+ attr_reader request_id: String?
22
+ attr_reader retry_after: Integer?
23
+
24
+ def initialize: (
25
+ status: Integer,
26
+ ?code: String?,
27
+ ?details: untyped,
28
+ ?request_id: String?,
29
+ ?retry_after: Integer?
30
+ ) -> void
31
+ def event_not_found?: () -> bool
32
+ def pending?: () -> bool
33
+ end
34
+
35
+ class TimeoutError < Error
36
+ end
37
+
38
+ class ConnectionError < Error
39
+ end
40
+
41
+ class EventTrigger
42
+ attr_reader signal: String?
43
+ attr_reader weight: Integer
44
+ attr_reader confidence: String?
45
+
46
+ def initialize: (Hash[String, untyped]) -> void
47
+ end
48
+
49
+ class Event
50
+ STRING_FIELDS: Array[String]
51
+
52
+ attr_reader request_id: String?
53
+ attr_reader visitor_id: String?
54
+ attr_reader state: String?
55
+ attr_reader environment: String?
56
+ attr_reader platform: String?
57
+ attr_reader sdk_platform: String?
58
+ attr_reader sdk_version: String?
59
+ attr_reader origin: String?
60
+ attr_reader url_host: String?
61
+ attr_reader url_path: String?
62
+ attr_reader tag: String?
63
+ attr_reader ip_address: String?
64
+ attr_reader country_code: String?
65
+ attr_reader country_name: String?
66
+ attr_reader asn: String?
67
+ attr_reader asn_name: String?
68
+ attr_reader anonymity_network: String?
69
+ attr_reader agent: String?
70
+ attr_reader agent_version: String?
71
+ attr_reader os: String?
72
+ attr_reader device_kind: String?
73
+ attr_reader visitor_kind: String?
74
+ attr_reader suspect_level: String?
75
+
76
+ attr_reader occurred_at: Time
77
+ attr_reader suspect_score: Integer?
78
+ attr_reader triggers: Array[EventTrigger]
79
+ attr_reader document: Hash[String, untyped]?
80
+ attr_reader deferred_signals: Hash[String, untyped]?
81
+ attr_reader raw: Hash[String, untyped]
82
+
83
+ def initialize: (Hash[String, untyped]) -> void
84
+ def has_document?: () -> bool
85
+ def scored?: () -> bool
86
+ end
87
+
88
+ class EventPage
89
+ include Enumerable[Event]
90
+
91
+ attr_reader rows: Array[Event]
92
+ attr_reader page: Integer
93
+ attr_reader page_size: Integer
94
+ attr_reader raw: Hash[String, untyped]
95
+
96
+ def initialize: (Hash[String, untyped]) -> void
97
+ def each: () { (Event) -> void } -> Array[Event]
98
+ | () -> Enumerator[Event, Array[Event]]
99
+ end
100
+
101
+ class WebhookEvent
102
+ attr_reader id: String?
103
+ attr_reader type: String?
104
+ attr_reader version: Integer?
105
+ attr_reader organization_id: String?
106
+ attr_reader environment: String?
107
+ attr_reader created_at: Time?
108
+ attr_reader data: Hash[String, untyped]
109
+ attr_reader raw: Hash[String, untyped]
110
+
111
+ def initialize: (Hash[String, untyped]) -> void
112
+ end
113
+
114
+ class Client
115
+ DEFAULT_TIMEOUT: Integer
116
+ DEFAULT_API_VERSION: String
117
+ USER_AGENT: String
118
+ MAX_ERROR_BODY: Integer
119
+
120
+ attr_reader events: Events
121
+
122
+ def initialize: (
123
+ secret_key: String,
124
+ ?endpoint: String?,
125
+ ?api_version: String,
126
+ ?timeout: Numeric,
127
+ ?configure_http: (^(untyped) -> void)?
128
+ ) -> void
129
+ def close: () -> void
130
+ def get: (String) -> Hash[String, untyped]
131
+
132
+ def inspect: () -> String
133
+ end
134
+
135
+ class Events
136
+ def initialize: (Client) -> void
137
+ def get: (String) -> Event
138
+ def list: (
139
+ ?from: Time?,
140
+ ?to: Time?,
141
+ ?page: Integer?,
142
+ ?limit: Integer?,
143
+ ?visitor: String?,
144
+ ?level: String?
145
+ ) -> EventPage
146
+ def self.escape: (untyped) -> String
147
+ def self.instant: (Time) -> String
148
+
149
+ def inspect: () -> String
150
+ end
151
+
152
+ module Webhooks
153
+ DEFAULT_TOLERANCE: Integer
154
+ SIGNATURE: Regexp
155
+ TIMESTAMP: Regexp
156
+ PREFIX: String
157
+ MAX_SIGNATURES: Integer
158
+
159
+ def self.verify: (
160
+ secret: String?,
161
+ payload: String?,
162
+ timestamp: String?,
163
+ signature: String?,
164
+ ?tolerance: Numeric,
165
+ ?now: Time?
166
+ ) -> bool
167
+ def self.parse: (String) -> WebhookEvent
168
+ end
169
+
170
+ class ProxyRequest
171
+ attr_reader request_method: String
172
+ attr_reader path: String
173
+ attr_reader peer_host: String?
174
+
175
+ def initialize: (Hash[String, untyped], String) -> void
176
+ def header: (String) -> String?
177
+ def headers: () -> Hash[String, String]
178
+ def self.headers_from: (Hash[String, untyped]) -> Hash[String, String]
179
+
180
+ def inspect: () -> String
181
+ end
182
+
183
+ class Proxy
184
+ DEFAULT_MAX_BODY_BYTES: Integer
185
+ DEFAULT_TIMEOUT: Integer
186
+ USER_AGENT: String
187
+ PROXY_VERSION: String
188
+ BODILESS: Array[Integer]
189
+ RELAYED_HEADERS: Array[String]
190
+
191
+ attr_reader max_body_bytes: Integer
192
+ attr_reader path: String?
193
+ attr_reader api_version: String
194
+
195
+ def initialize: (
196
+ ?untyped app,
197
+ client_ip: ^(ProxyRequest) -> String?,
198
+ ?proxy_key: String?,
199
+ ?secret_key: String?,
200
+ ?path: String?,
201
+ ?api_version: String,
202
+ ?upstream: String?,
203
+ ?max_body_bytes: Integer,
204
+ ?timeout: Numeric,
205
+ ?configure_http: (^(untyped) -> void)?,
206
+ ?logger: untyped
207
+ ) -> void
208
+ def handles?: (String) -> bool
209
+ def call: (Hash[String, untyped]) -> [Integer, Hash[String, String], Array[String]]
210
+
211
+ def inspect: () -> String
212
+ end
213
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fingerly
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Fingerly
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: |
13
+ Reads stored identification events with a secret key, verifies signed
14
+ webhooks, and forwards the browser SDK's requests through a route on your
15
+ own domain as Rack middleware. No runtime dependencies.
16
+ email:
17
+ - support@fingerly.io
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - LICENSE
23
+ - README.md
24
+ - lib/fingerly.rb
25
+ - lib/fingerly/client.rb
26
+ - lib/fingerly/config.rb
27
+ - lib/fingerly/errors.rb
28
+ - lib/fingerly/models.rb
29
+ - lib/fingerly/proxy.rb
30
+ - lib/fingerly/redacted.rb
31
+ - lib/fingerly/transport.rb
32
+ - lib/fingerly/version.rb
33
+ - lib/fingerly/webhooks.rb
34
+ - sig/fingerly.rbs
35
+ homepage: https://docs.fingerly.io/docs/sdks/ruby
36
+ licenses:
37
+ - Apache-2.0
38
+ metadata:
39
+ documentation_uri: https://docs.fingerly.io/docs/sdks/ruby
40
+ source_code_uri: https://github.com/fingerly-io/sdk-ruby
41
+ rubygems_mfa_required: 'true'
42
+ allowed_push_host: https://rubygems.org
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 3.2.0
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubygems_version: 3.6.9
58
+ specification_version: 4
59
+ summary: 'Server-side Fingerly SDK: event reads, webhook verification and a same-origin
60
+ proxy'
61
+ test_files: []