fortnox-api 1.0.0.rc5 → 1.0.0.rc6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d9ec48a070723310f19f5c87fa23c64e3c92c0e3a04d9e000a6390f0d6e2f65
4
- data.tar.gz: 7b95b905d0d908bee63b1130cede763d7a0697de0ef8d008e92b710580457674
3
+ metadata.gz: 42db7fb64630302bc5d10e1ea99f03586a6d6927ed09a33bdbce1408fb820684
4
+ data.tar.gz: a98ed1b9a2380a48044f1b6f29f99ef4da35d92b9b4a7d70a260a0e82f244f60
5
5
  SHA512:
6
- metadata.gz: fc85ca3a86615ab6d329091fcdf1ec565d03325bf2b98776602e32fa74e9c440081f9e8f37c4ee4baf759cdcdd29e339c0abe0eeaae777abe52ef162e382eced
7
- data.tar.gz: 5b01d27ef5d0d7d61961378ada0ed97356c8e2f17412bc191b711c902cda18c754058bafd86ec3409bec895da890fdda425ca6274a097c51061835eb2ede4889
6
+ metadata.gz: 67396cd4f4f0609671f11d30195446514208e3e57a244071a144151daca2b40d988167bf2ea73e4cb256d425feaa20e7b92c2450cbbc6d85fbb2cea61e7112ae
7
+ data.tar.gz: ebd081caa219cb82d91a15ba6c6f58c62f6e19f4fc789ffe8963bca9ae533f1138766bbb1ec7fe6f4f1550fa2a0416bf6d7a37fa63ea0642833ed45d4d91f3c7
data/CHANGELOG.md CHANGED
@@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to
7
7
  [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [1.0.0.rc6] - 2026-05-18
10
+
11
+ ### Added
12
+
13
+ - HTTP wire logging via `Fortnox.configure { logger ... }`, with an
14
+ optional `log_bodies` toggle for request/response bodies. Standard
15
+ auth headers are redacted automatically. Inherited from `rest-easy`
16
+ 1.2.
17
+
18
+ ### Changed
19
+
20
+ - Upgraded `rest-easy` dependency to `~> 1.2.0`.
21
+
9
22
  ## [1.0.0.rc5] - 2026-05-15
10
23
 
11
24
  ### Changed
data/README.md CHANGED
@@ -16,7 +16,7 @@ Adding more resources is quick and easy, see the
16
16
  ## Status
17
17
 
18
18
  Version 1.0 is a complete rewrite, currently in release candidate
19
- (`1.0.0.rc5`). It is built on
19
+ (`1.0.0.rc6`). It is built on
20
20
  [rest-easy](https://github.com/accodeing/rest-easy), replacing the old
21
21
  HTTParty + Data Mapper architecture with a single resource class per entity.
22
22
  Authorization uses the Fortnox client credentials flow.
@@ -322,6 +322,55 @@ Some resources support server-side filters:
322
322
  Fortnox::Invoice.only('unpaid')
323
323
  ```
324
324
 
325
+ ### Debugging
326
+
327
+ The gem exposes two independent debugging knobs from rest-easy.
328
+
329
+ #### HTTP wire logging
330
+
331
+ Set a `Logger`-compatible instance on the gem-level config to log every
332
+ HTTP request and response. Faraday's built-in logger middleware is attached
333
+ only when this setting is non-nil — no overhead when unset:
334
+
335
+ ```ruby
336
+ require 'logger'
337
+
338
+ Fortnox.configure do
339
+ logger Logger.new($stdout)
340
+ end
341
+ ```
342
+
343
+ By default only request/response lines and headers are logged, with the
344
+ standard auth headers (`Authorization`, `Proxy-Authorization`, `Cookie`,
345
+ `Set-Cookie`) filtered to `[FILTERED]`. To also log bodies, opt in:
346
+
347
+ ```ruby
348
+ Fortnox.configure do
349
+ logger Logger.new($stdout)
350
+ log_bodies true
351
+ end
352
+ ```
353
+
354
+ The Faraday connection is built once on the first request and cached for
355
+ the life of the process, so changes to `logger` or `log_bodies` after that
356
+ take effect only on restart.
357
+
358
+ The `fortnox-setup` and `fortnox-update-env` executables talk directly to
359
+ the OAuth token endpoint and are not routed through this logger.
360
+
361
+ #### Per-resource response-shape validation
362
+
363
+ Set `debug true` on a resource to have rest-easy warn whenever an API
364
+ response contains fields the resource doesn't declare with `attr` or
365
+ `ignore`, or is missing a declared (non-required) attribute. Useful for
366
+ catching schema drift when Fortnox adds or renames fields:
367
+
368
+ ```ruby
369
+ Fortnox::Customer.configure do
370
+ debug true
371
+ end
372
+ ```
373
+
325
374
  ### Gotchas
326
375
 
327
376
  See [docs/gotchas.md](docs/gotchas.md) for known quirks and edge cases in the
data/fortnox.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency 'countries', '~> 7.1'
25
25
  spec.add_dependency 'dry-struct', '~> 1.5'
26
- spec.add_dependency 'rest-easy', '~> 1.1.2'
26
+ spec.add_dependency 'rest-easy', '~> 1.2.0'
27
27
 
28
28
  spec.metadata['rubygems_mfa_required'] = 'true'
29
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fortnox
4
- VERSION = '1.0.0.rc5'
4
+ VERSION = '1.0.0.rc6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortnox-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc5
4
+ version: 1.0.0.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Schubert Erlandsson
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2026-05-15 00:00:00.000000000 Z
14
+ date: 2026-05-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: countries
@@ -47,14 +47,14 @@ dependencies:
47
47
  requirements:
48
48
  - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: 1.1.2
50
+ version: 1.2.0
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: 1.1.2
57
+ version: 1.2.0
58
58
  description: Fortnox F3 REST API library, based on rest-easy.
59
59
  email:
60
60
  - info@accodeing.com