fingerly 0.2.0 → 0.3.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 CHANGED
@@ -30,6 +30,42 @@ module Fingerly
30
30
  ) -> void
31
31
  def event_not_found?: () -> bool
32
32
  def pending?: () -> bool
33
+ def event_already_consumed?: () -> bool
34
+ end
35
+
36
+ class EventAlreadyConsumedError < APIError
37
+ CODE: String
38
+
39
+ attr_reader consumed_at: String?
40
+
41
+ def initialize: (
42
+ status: Integer,
43
+ ?code: String?,
44
+ ?details: untyped,
45
+ ?request_id: String?,
46
+ ?retry_after: Integer?,
47
+ ?consumed_at: String?
48
+ ) -> void
49
+ end
50
+
51
+ class DeviceCheckError < APIError
52
+ NOT_HELD: String
53
+ SPENT: String
54
+ BUSY: String
55
+ CREDENTIAL_UNAVAILABLE: String
56
+ BITS_REQUIRED: String
57
+ APPLE_REJECTED: String
58
+ UNAVAILABLE: String
59
+
60
+ attr_reader apple_status: Integer?
61
+
62
+ def not_held?: () -> bool
63
+ def spent?: () -> bool
64
+ def busy?: () -> bool
65
+ def credential_unavailable?: () -> bool
66
+ def bits_required?: () -> bool
67
+ def apple_rejected?: () -> bool
68
+ def unavailable?: () -> bool
33
69
  end
34
70
 
35
71
  class TimeoutError < Error
@@ -39,7 +75,23 @@ module Fingerly
39
75
  end
40
76
 
41
77
  class EventTrigger
78
+ SIGNAL_ATTESTATION_FAILED: String
79
+ SIGNAL_ATTESTATION_MISSING: String
80
+ SIGNAL_ATTESTATION_DOWNGRADE: String
81
+ SIGNAL_DEVICE_INCONSISTENT: String
82
+ SIGNAL_REPORT_INCOMPLETE: String
83
+ SIGNAL_PROBE_ERRORS: String
84
+ SIGNAL_FETCH_METADATA_MISSING: String
85
+ SIGNAL_WEB_TICKET_MISSING: String
86
+ SIGNAL_WEB_TICKET_INVALID: String
87
+ SIGNAL_TAMPERING: String
88
+ SIGNAL_BROWSER_TAMPERING: String
89
+ SIGNAL_CUSTOM_ROOT_CA: String
90
+ SIGNAL_SECONDARY_USER_PROFILE: String
91
+ V3_SIGNALS: Array[String]
92
+
42
93
  attr_reader signal: String?
94
+ attr_reader group: String?
43
95
  attr_reader weight: Integer
44
96
  attr_reader confidence: String?
45
97
 
@@ -53,6 +105,7 @@ module Fingerly
53
105
  attr_reader project_id: String?
54
106
  attr_reader visitor_id: String?
55
107
  attr_reader state: String?
108
+ attr_reader reason: String?
56
109
  attr_reader environment: String?
57
110
  attr_reader platform: String?
58
111
  attr_reader sdk_platform: String?
@@ -74,13 +127,13 @@ module Fingerly
74
127
  attr_reader visitor_kind: String?
75
128
  attr_reader suspect_level: String?
76
129
 
77
- attr_reader occurred_at: Time
130
+ attr_reader occurred_at: Time?
78
131
  attr_reader suspect_score: Integer?
79
132
  attr_reader triggers: Array[EventTrigger]
80
133
  attr_reader document: Hash[String, untyped]?
81
134
  attr_reader raw: Hash[String, untyped]
82
135
 
83
- def initialize: (Hash[String, untyped]) -> void
136
+ def initialize: (Hash[String, untyped], ?lenient_time: bool) -> void
84
137
  def has_document?: () -> bool
85
138
  def scored?: () -> bool
86
139
  end
@@ -98,6 +151,52 @@ module Fingerly
98
151
  | () -> Enumerator[Event, Array[Event]]
99
152
  end
100
153
 
154
+ class EventConsumption
155
+ attr_reader request_id: String?
156
+ attr_reader consumed_at: String?
157
+ attr_reader first: bool
158
+ attr_reader raw: Hash[String, untyped]
159
+
160
+ def initialize: (Hash[String, untyped]) -> void
161
+ def first?: () -> bool
162
+ end
163
+
164
+ class EventVerification
165
+ NOT_FOUND: String
166
+ TOO_OLD: String
167
+ TAG_MISMATCH: String
168
+ UNIDENTIFIABLE: String
169
+ UNSCORED: String
170
+ ALREADY_CONSUMED: String
171
+ REASONS: Array[String]
172
+
173
+ attr_reader ok: bool
174
+ attr_reader reason: String
175
+ attr_reader event: Event?
176
+
177
+ def initialize: (reason: String, event: Event?) -> void
178
+ def ok?: () -> bool
179
+ end
180
+
181
+ class DeviceCheckBits
182
+ attr_reader found: bool
183
+ attr_reader bit0: bool
184
+ attr_reader bit1: bool
185
+ attr_reader last_update: String?
186
+ attr_reader raw: Hash[String, untyped]
187
+
188
+ def initialize: (Hash[String, untyped]) -> void
189
+ def found?: () -> bool
190
+ end
191
+
192
+ class DeviceCheckWrite
193
+ attr_reader bit0: bool?
194
+ attr_reader bit1: bool?
195
+ attr_reader raw: Hash[String, untyped]
196
+
197
+ def initialize: (Hash[String, untyped]) -> void
198
+ end
199
+
101
200
  class WebhookEvent
102
201
  attr_reader id: String?
103
202
  attr_reader type: String?
@@ -117,17 +216,33 @@ module Fingerly
117
216
  USER_AGENT: String
118
217
  MAX_ERROR_BODY: Integer
119
218
 
219
+ DEVICE_CHECK_ATTEMPTS: Integer
220
+ DEVICE_CHECK_BACKOFF: Array[Float]
221
+ DEVICE_CHECK_MAX_WAIT: Integer
222
+
120
223
  attr_reader events: Events
224
+ attr_reader device_check: DeviceCheck
121
225
 
122
226
  def initialize: (
123
227
  secret_key: String,
124
228
  ?endpoint: String?,
125
229
  ?api_version: String,
126
230
  ?timeout: Numeric,
127
- ?configure_http: (^(untyped) -> void)?
231
+ ?configure_http: (^(untyped) -> void)?,
232
+ ?allow_insecure_loopback: bool
128
233
  ) -> void
129
234
  def close: () -> void
130
235
  def get: (String) -> Hash[String, untyped]
236
+ def spend_device_check: (untyped, String, String?) -> Hash[String, untyped]
237
+ def post_consume: (String) -> Hash[String, untyped]
238
+
239
+ def inspect: () -> String
240
+ end
241
+
242
+ class DeviceCheck
243
+ def initialize: (Client) -> void
244
+ def query: (String) -> DeviceCheckBits
245
+ def write: (String, ?bit0: bool?, ?bit1: bool?) -> DeviceCheckWrite
131
246
 
132
247
  def inspect: () -> String
133
248
  end
@@ -143,6 +258,18 @@ module Fingerly
143
258
  ?visitor: String?,
144
259
  ?level: String?
145
260
  ) -> EventPage
261
+ DEFAULT_MAX_AGE_SECONDS: Integer
262
+
263
+ def consume: (String) -> EventConsumption
264
+ def verify: (
265
+ String,
266
+ ?max_age_seconds: Integer,
267
+ ?tag: String?,
268
+ ?consume: bool
269
+ ) -> EventVerification
270
+ def self.verify_options: (untyped, untyped, untyped) -> void
271
+ def self.failed_check: (Event, Integer, String?) -> String?
272
+ def self.segment: (untyped) -> String
146
273
  def self.escape: (untyped) -> String
147
274
  def self.instant: (Time) -> String
148
275
 
@@ -185,25 +312,31 @@ module Fingerly
185
312
  DEFAULT_TIMEOUT: Integer
186
313
  USER_AGENT: String
187
314
  PROXY_VERSION: String
315
+ NO_CLIENT_IP: String
316
+ MISSING_ORIGIN_JSON: String
317
+ ALLOWED_PLATFORMS: Regexp
318
+ FORWARDED_CLIENT_HEADERS: Array[String]
319
+ RELAYABLE_STATUS: Range[Integer]
188
320
  BODILESS: Array[Integer]
189
321
  RELAYED_HEADERS: Array[String]
190
322
 
191
323
  attr_reader max_body_bytes: Integer
192
- attr_reader path: String?
324
+ attr_reader path: String
193
325
  attr_reader api_version: String
194
326
 
195
327
  def initialize: (
196
328
  ?untyped app,
197
329
  client_ip: ^(ProxyRequest) -> String?,
198
- ?proxy_key: String?,
199
- ?secret_key: String?,
200
- ?path: String?,
330
+ path: String,
331
+ proxy_key: String,
332
+ ?allowed_origins: Array[String]?,
201
333
  ?api_version: String,
202
334
  ?upstream: String?,
203
335
  ?max_body_bytes: Integer,
204
336
  ?timeout: Numeric,
205
337
  ?configure_http: (^(untyped) -> void)?,
206
- ?logger: untyped
338
+ ?logger: untyped,
339
+ ?allow_insecure_loopback: bool
207
340
  ) -> void
208
341
  def handles?: (String) -> bool
209
342
  def call: (Hash[String, untyped]) -> [Integer, Hash[String, String], Array[String]]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fingerly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fingerly