atlas_rb 1.29.9 → 1.29.10

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: 70d17a2c1a008d2472921d83a239c583c954adf6170747cb20c35411245c3230
4
- data.tar.gz: 38c3b7541876a8a45288fa3f751c42a5716bad78d76b6374acc868ed7aeae298
3
+ metadata.gz: a41cd3a20e9d87272ff866480fbdd650d9c9a286afa63ad0fe999a978342be6a
4
+ data.tar.gz: ed569b1627bdb06488a35fa4f7683fe4b82bfa4f674dcde6b603655f9e2a2082
5
5
  SHA512:
6
- metadata.gz: 0cca6024196cfba27a06712b51c39b0475e4f6622afeff68defa5173e3ee7a179716e9b058050c4705c9df0b0a363be78c03861dfc28e9b5b9d9b4e3100ae5ba
7
- data.tar.gz: d239bd7d76883f3c23135a1f63d8bc3b21b94cc5c24e96f584c974f6270036e8169c6e06df0a1a941e891126f3eafac7fa67cd0a7506ffa9f9fbe655afc55bfe
6
+ metadata.gz: 7473a5fb3a8a87d1176f8b8832df36bd4c952210d3ee52f027cecf96d0285673e27659e3d06e27c2d53eabe6a9949e45406965cdc5558fa22943206e3dc270fa
7
+ data.tar.gz: f145be9dc509c7c9bd01f93f1fd672dfd75fd07ff43edeeffee437b51b097609aaa7571a0e724850f2ba9ec55632a253ad03f01050577f58029822d6a76f310c
data/.version CHANGED
@@ -1 +1 @@
1
- 1.29.9
1
+ 1.29.10
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.29.10
4
+
5
+ ### Fixed — documentation that the code contradicts
6
+
7
+ No code changed. The README and YARD now describe what the bindings do:
8
+
9
+ - `Resource.history` and `Resource.mods_versions` raise
10
+ `AtlasRb::ResourceError` on a `401` or `403`. They do not return a raw
11
+ Faraday response.
12
+ - `AuditEvent.emit` authenticates as the actor through a signed assertion,
13
+ not with the system token. A `401` or `403` comes back parsed, unraised.
14
+ - `Resource.dwc_versions` returns `nil` for an id that is not a Work.
15
+ - `Resource.set_permissions` gets no error when the caller removes a grant
16
+ for a group it is not in. Atlas keeps that grant and saves the rest.
17
+
3
18
  ## 1.29.9
4
19
 
5
20
  ### Added — `config.request_id`, sent as `X-Request-Id`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.29.9)
4
+ atlas_rb (1.29.10)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.5)
7
7
  faraday-multipart (~> 1)
data/README.md CHANGED
@@ -405,8 +405,8 @@ result["resource_id"] # => "w-789"
405
405
  result["events"].first["action"] # => "update"
406
406
  ```
407
407
 
408
- Authorization errors (`401` / `403`) are not caught here — they surface as
409
- raw Faraday responses for the calling application's rescue layer.
408
+ A `401` or `403` raises `AtlasRb::ResourceError`, carrying Atlas's status and
409
+ body. A `404` returns `nil`.
410
410
 
411
411
  ### Session-scoped audit events
412
412
 
@@ -444,8 +444,8 @@ AtlasRb::AuditEvent.emit(
444
444
  `on_behalf_of_nuid`, `mode`, and `payload:` (free-form metadata) are
445
445
  omitted from the body when blank, so `emit` can also carry future,
446
446
  mode-less session events. Atlas stamps `occurred_at` server-side.
447
- Authorization errors (`401` / `403`) surface as raw Faraday responses,
448
- matching `Resource.history`.
447
+ `emit` is a POST, so the read guard does not apply: a `401` or `403` is not
448
+ raised, and Atlas's error envelope comes back parsed into a Mash.
449
449
 
450
450
  ### MODS version history
451
451
 
@@ -482,8 +482,9 @@ with `Work.mods` but XML is the only retained format.
482
482
  Version labels are **opaque, sortable OCFL `vN` strings**, not a 1-based
483
483
  counter — a Blob's preservation envelope occupies earlier versions, so the
484
484
  first MODS version is typically `v3`. Treat them as identifiers to feed back
485
- into `mods_version`. A resource with no MODS returns `{ "versions" => [] }`;
486
- `401` / `403` surface as raw Faraday responses, matching `Resource.history`.
485
+ into `mods_version`. A resource with no MODS returns `{ "versions" => [] }`.
486
+ A `401` or `403` raises `AtlasRb::ResourceError`, carrying Atlas's status and
487
+ body. A `404` returns `nil`.
487
488
 
488
489
  ### Re-parenting
489
490
 
@@ -60,16 +60,15 @@ module AtlasRb
60
60
  #
61
61
  # Wraps `POST /audit_events`. The principals and metadata travel in the
62
62
  # JSON body — not in request headers — so the recorded event does not
63
- # depend on the ambient {AtlasRb.config} identity. The request still
64
- # authenticates as the configured caller (system token + the admin
65
- # `User:` header); Atlas admin-gates the endpoint server-side.
63
+ # depend on the ambient {AtlasRb.config} identity. The request
64
+ # authenticates as the actor: atlas_rb signs an assertion for
65
+ # `actor_nuid`. Atlas lets admins and devolved admins create the event,
66
+ # and refuses `:system`.
66
67
  #
67
68
  # Atlas stamps `occurred_at` server-side, so it is not part of the body.
68
69
  #
69
- # Authorization errors (`401` / `403`) are intentionally **not** caught
70
- # here — they surface as raw Faraday responses for the calling
71
- # application's rescue layer to translate, matching
72
- # {AtlasRb::Resource.history}.
70
+ # `emit` is a POST, so the read guard does not apply: a `401` or `403` is
71
+ # not raised, and Atlas's error envelope comes back parsed into a Mash.
73
72
  #
74
73
  # @param action [String] the audit action, e.g. `"impersonation_started"`
75
74
  # or `"impersonation_ended"`.
@@ -366,9 +366,8 @@ module AtlasRb
366
366
  # The whole envelope is preserved so callers can confirm the events
367
367
  # belong to the requested resource; access events as `result["events"]`.
368
368
  #
369
- # Authorization errors (`401` / `403`) are intentionally **not** caught
370
- # here — they surface as raw Faraday responses for the calling
371
- # application's rescue layer to translate.
369
+ # A `401` or `403` raises {AtlasRb::ResourceError}, carrying Atlas's
370
+ # status and body. A `404` returns `nil`.
372
371
  #
373
372
  # @todo Add pagination support once Atlas's history endpoint exposes
374
373
  # page / per_page query params. Today the endpoint returns the full
@@ -521,8 +520,9 @@ module AtlasRb
521
520
  # List the retained versions of a Work's Darwin Core record.
522
521
  #
523
522
  # The same envelope as {mods_versions}, under the same admin gate, with
524
- # attribution drawn from the Darwin Core edits only. A Work with no record,
525
- # or an id that is not a Work, comes back as `{ "versions" => [] }`.
523
+ # attribution drawn from the Darwin Core edits only. A Work with no record
524
+ # comes back as `{ "versions" => [] }`. An id that is not a Work returns
525
+ # `nil`, as Atlas answers `404`.
526
526
  #
527
527
  # @param id [String] the Work's NOID.
528
528
  # @param nuid [String, nil] optional acting user's NUID.
@@ -119,9 +119,10 @@ module AtlasRb
119
119
  # header.
120
120
  # @return [AtlasRb::Mash] the resource, unwrapped from its type key.
121
121
  # @raise [AtlasRb::NotFoundError] on `404` — the write did not happen.
122
- # @raise [AtlasRb::ResourceError] on any other non-2xx, including the `403`
123
- # Atlas answers when a caller tries to remove a grant for a group it does
124
- # not belong to.
122
+ # @raise [AtlasRb::ResourceError] on any other non-2xx. A caller who removes
123
+ # a read or edit grant for a group it does not belong to gets no error:
124
+ # Atlas keeps that grant and saves the rest, so check the returned
125
+ # resource. Admins and devolved admins may remove any group.
125
126
  #
126
127
  # @example Publish, leaving every other key alone
127
128
  # AtlasRb::Resource.set_permissions("xsj3xmz", { "read" => ["public"] })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atlas_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.29.9
4
+ version: 1.29.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff