fmrest 0.16.0 → 0.18.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -10
- data/README.md +52 -6
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce71d7e802aceef004532f990c829754203bc9ce81387a1980071d664ef27934
|
4
|
+
data.tar.gz: 0e738865034eef0fe9c733a4574643b52e8a283be1ea4258d18ad89be5140fc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30bcd6e31da102be7b5bf285d4a612551503bc6ee1a6d0e9efd0bb356f148acf8be206205474ad216c362d59df414a5ab92b1345de738f0d18a699a249888164
|
7
|
+
data.tar.gz: f2c94a675d31cb8e72804e9c7dee19f73467f5837a1272fb25a0c17c42745125996f9a0784df07e4c08227029fba71b0e7db0f0c7a99a7b2d0595caaa22ff535
|
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,29 @@
|
|
1
1
|
## Changelog
|
2
2
|
|
3
|
+
### 0.18.0
|
4
|
+
|
5
|
+
* Better support for portals with mismatching field qualifiers
|
6
|
+
* Defining an attribute on a model that would collide with an existing method
|
7
|
+
now raises an error
|
8
|
+
|
9
|
+
### 0.17.1
|
10
|
+
|
11
|
+
* Fixed crash when `fmid_token` is set but `username` isn't
|
12
|
+
|
13
|
+
### 0.17.0
|
14
|
+
|
15
|
+
* Added support for Claris ID token login
|
16
|
+
* Added ability to use procs in settings
|
17
|
+
* Added `Rescuable` mixin
|
18
|
+
|
3
19
|
### 0.16.0
|
4
20
|
|
5
|
-
*
|
21
|
+
* Added `FmRest.logger=`
|
6
22
|
* Handle serialization of `nil`, `true` and `false` values
|
7
23
|
|
8
24
|
### 0.15.2
|
9
25
|
|
10
|
-
*
|
26
|
+
* Fixed autoloading of `FmRest::Layout`
|
11
27
|
|
12
28
|
### 0.15.0
|
13
29
|
|
@@ -23,13 +39,13 @@
|
|
23
39
|
|
24
40
|
### 0.13.1
|
25
41
|
|
26
|
-
*
|
42
|
+
* Fixed downloading of container field data from FMS19+
|
27
43
|
|
28
44
|
### 0.13.0
|
29
45
|
|
30
46
|
* Split `fmrest` gem into `fmrest-core` and `fmrest-spyke`. `fmrest` becomes a
|
31
47
|
wrapper for the two new gems.
|
32
|
-
*
|
48
|
+
* Fixed bug preventing connection databases with spaces in their names.
|
33
49
|
* Improved portal support with ability to delete portal records, and better
|
34
50
|
refreshing of portal records after saving the parent.
|
35
51
|
* `FmRest::Spyke::Base#__record_id` and `FmRest::Spyke::Base#__mod_id` now
|
@@ -44,7 +60,7 @@
|
|
44
60
|
|
45
61
|
### 0.11.1
|
46
62
|
|
47
|
-
*
|
63
|
+
* Fixed a couple crashes due to missing constants
|
48
64
|
|
49
65
|
### 0.11.0
|
50
66
|
|
@@ -59,7 +75,7 @@
|
|
59
75
|
|
60
76
|
### 0.10.1
|
61
77
|
|
62
|
-
*
|
78
|
+
* Fixed `URI.escape` obsolete warning messages in Ruby 2.7 by replacing it with
|
63
79
|
`URI.encode_www_form_component`
|
64
80
|
([PR#40](https://github.com/beezwax/fmrest-ruby/pull/40))
|
65
81
|
|
@@ -133,20 +149,20 @@
|
|
133
149
|
|
134
150
|
### 0.3.2
|
135
151
|
|
136
|
-
*
|
152
|
+
* Fixed support for ActiveSupport < 5.2
|
137
153
|
([#27](https://github.com/beezwax/fmrest-ruby/issues/27))
|
138
154
|
|
139
155
|
### 0.3.0
|
140
156
|
|
141
|
-
*
|
157
|
+
* Added Moneta token store
|
142
158
|
|
143
159
|
### 0.2.5
|
144
160
|
|
145
|
-
*
|
161
|
+
* Fixed crash in `fetch_container_data` when no proxy options were set
|
146
162
|
|
147
163
|
### 0.2.4
|
148
164
|
|
149
165
|
* Use `String#=~` instead of `String#match?` for Ruby <2.4 compatibility (Fixes
|
150
166
|
[#26](https://github.com/beezwax/fmrest-ruby/issues/26))
|
151
|
-
*
|
167
|
+
* Deprecated `FmRest.config` in favor of `FmRest.default_connection_settings`
|
152
168
|
* Honor Faraday SSL and proxy settings when fetching container files
|
data/README.md
CHANGED
@@ -125,6 +125,10 @@ The minimum required connection settings are `:host`, `:database`, `:username`
|
|
125
125
|
and `:password`, but fmrest-ruby has many other options you can pass when
|
126
126
|
setting up a connection (see [full list](#full-list-of-available-options) below).
|
127
127
|
|
128
|
+
If you're using FileMaker Cloud you may need to pass `:fmid_token` instead
|
129
|
+
of the regular `:username` and `:password`. See the [main document on
|
130
|
+
connecting to FileMaker Cloud](docs/FileMakerCloud.md) for more info.
|
131
|
+
|
128
132
|
`:ssl` and `:proxy` are forwarded to the underlying
|
129
133
|
[Faraday](https://github.com/lostisland/faraday) connection. You can use this
|
130
134
|
to, for instance, disable SSL verification:
|
@@ -149,6 +153,7 @@ Option | Description | Format
|
|
149
153
|
`:username` | A Data API-ready account | String | None
|
150
154
|
`:password` | Your password | String | None
|
151
155
|
`:account_name` | Alias of `:username` | String | None
|
156
|
+
`:fmid_token` | Claris ID token (only needed for FileMaker Cloud) | String | None
|
152
157
|
`:ssl` | SSL options to be forwarded to Faraday | Faraday SSL options | None
|
153
158
|
`:proxy` | Proxy options to be forwarded to Faraday | Faraday proxy options | None
|
154
159
|
`:log` | Log JSON responses to STDOUT | Boolean | `false`
|
@@ -283,10 +288,12 @@ Also, if not set, your model will try to use
|
|
283
288
|
#### Connection settings overlays
|
284
289
|
|
285
290
|
There may be cases where you want to use a different set of connection settings
|
286
|
-
depending on context
|
287
|
-
provided by the user in a web
|
288
|
-
|
289
|
-
|
291
|
+
depending on context, or simply change the connection settings over time. For
|
292
|
+
example, if you want to use username and password provided by the user in a web
|
293
|
+
application, or if you're connecting using an expiring Claris ID token. Since
|
294
|
+
`.fmrest_config` is set at the class level, changing the username/password for
|
295
|
+
the model in one context would also change it in all other contexts, leading to
|
296
|
+
security issues.
|
290
297
|
|
291
298
|
To solve this scenario, fmrest-ruby provides a way of defining thread-local and
|
292
299
|
reversible connection settings overlays through
|
@@ -323,7 +330,7 @@ Requests a Data API session token using the connection settings in
|
|
323
330
|
|
324
331
|
You normally don't need to use this method as fmrest-ruby will automatically
|
325
332
|
request and store session tokens for you (provided that `:autologin` is
|
326
|
-
`true`).
|
333
|
+
`true` in the connection settings, which it is by default).
|
327
334
|
|
328
335
|
### FmRest::Layout.logout
|
329
336
|
|
@@ -452,6 +459,41 @@ field values on the database that model is configured for.
|
|
452
459
|
See the [main document on setting global field values](docs/GlobalFields.md)
|
453
460
|
for details.
|
454
461
|
|
462
|
+
### Rescuable mixin
|
463
|
+
|
464
|
+
Sometimes you may want to handle Data API errors at the model level. For
|
465
|
+
instance, if you're logging in to a file hosted by FileMaker Cloud using a
|
466
|
+
Claris ID token, and you want to be able to renew said token when it fails to
|
467
|
+
log you in. For such cases fmrest-ruby provides an off-by-default mixin called
|
468
|
+
`Rescuable` that provides convenience macros for that. If you've used Ruby on
|
469
|
+
Rails you may be familiar with its syntax from controllers. E.g.
|
470
|
+
|
471
|
+
```ruby
|
472
|
+
class BeeBase < FmRest::Layout
|
473
|
+
include FmRest::Spyke::Model::Rescuable
|
474
|
+
|
475
|
+
rescue_from FmRest::APIError::SystemError, with: :notify_admin_of_system_error
|
476
|
+
|
477
|
+
# Shorthand for rescue_with FmRest::APIError::AccountError, ...
|
478
|
+
rescue_account_error { ClarisIDTokenManager.expire_token }
|
479
|
+
|
480
|
+
def self.notify_admin_of_system_error(e)
|
481
|
+
# Shoot an email to the FM admin...
|
482
|
+
end
|
483
|
+
end
|
484
|
+
```
|
485
|
+
|
486
|
+
Since `Rescuable` uses `ActiveSupport::Rescuable` internally, you may want to
|
487
|
+
check [Rails'
|
488
|
+
documentation](https://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html)
|
489
|
+
too for details on how it works.
|
490
|
+
|
491
|
+
One caveat of using `rescue_from` is that it always catches exceptions at the
|
492
|
+
class level, so if you pass a method name to `with:` that method has to be a
|
493
|
+
class method. Also note that this will only catch exceptions raised during an
|
494
|
+
API call to the Data API server (in other words, only on actions that perform
|
495
|
+
an HTTP request).
|
496
|
+
|
455
497
|
## Logging
|
456
498
|
|
457
499
|
If using `fmrest-spyke` with Rails then pretty log output will be set up for
|
@@ -501,6 +543,10 @@ class LoggyBee < FmRest::Layout
|
|
501
543
|
end
|
502
544
|
```
|
503
545
|
|
546
|
+
## Gotchas
|
547
|
+
|
548
|
+
Read about unexpected scenarios in the [gotchas doc](docs/Gotchas.md).
|
549
|
+
|
504
550
|
## API implementation completeness table
|
505
551
|
|
506
552
|
FM Data API reference: https://fmhelp.filemaker.com/docs/18/en/dataapi/
|
@@ -510,7 +556,7 @@ FM Data API reference: https://fmhelp.filemaker.com/docs/18/en/dataapi/
|
|
510
556
|
| Log in using HTTP Basic Auth | Yes | Yes |
|
511
557
|
| Log in using OAuth | No | No |
|
512
558
|
| Log in to an external data source | No | No |
|
513
|
-
| Log in using
|
559
|
+
| Log in using Claris ID account | Yes | Yes |
|
514
560
|
| Log out | Yes | Yes |
|
515
561
|
| Get product information | Manual* | No |
|
516
562
|
| Get database names | Manual* | No |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fmrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Carbajal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fmrest-core
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.18.0.rc1
|
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.
|
26
|
+
version: 0.18.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fmrest-spyke
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.18.0.rc1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.18.0.rc1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -273,11 +273,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
273
273
|
version: '0'
|
274
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
275
275
|
requirements:
|
276
|
-
- - "
|
276
|
+
- - ">"
|
277
277
|
- !ruby/object:Gem::Version
|
278
|
-
version:
|
278
|
+
version: 1.3.1
|
279
279
|
requirements: []
|
280
|
-
rubygems_version: 3.
|
280
|
+
rubygems_version: 3.2.3
|
281
281
|
signing_key:
|
282
282
|
specification_version: 4
|
283
283
|
summary: FileMaker Data API client
|