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 +4 -4
- data/.version +1 -1
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +1 -1
- data/README.md +7 -6
- data/lib/atlas_rb/audit_event.rb +6 -7
- data/lib/atlas_rb/resource.rb +5 -5
- data/lib/atlas_rb/resource_writes.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a41cd3a20e9d87272ff866480fbdd650d9c9a286afa63ad0fe999a978342be6a
|
|
4
|
+
data.tar.gz: ed569b1627bdb06488a35fa4f7683fe4b82bfa4f674dcde6b603655f9e2a2082
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7473a5fb3a8a87d1176f8b8832df36bd4c952210d3ee52f027cecf96d0285673e27659e3d06e27c2d53eabe6a9949e45406965cdc5558fa22943206e3dc270fa
|
|
7
|
+
data.tar.gz: f145be9dc509c7c9bd01f93f1fd672dfd75fd07ff43edeeffee437b51b097609aaa7571a0e724850f2ba9ec55632a253ad03f01050577f58029822d6a76f310c
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.29.
|
|
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
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
|
-
|
|
409
|
-
|
|
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
|
-
|
|
448
|
-
|
|
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`
|
|
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
|
|
data/lib/atlas_rb/audit_event.rb
CHANGED
|
@@ -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
|
|
64
|
-
# authenticates as the
|
|
65
|
-
# `
|
|
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
|
-
#
|
|
70
|
-
#
|
|
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"`.
|
data/lib/atlas_rb/resource.rb
CHANGED
|
@@ -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
|
-
#
|
|
370
|
-
#
|
|
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
|
-
#
|
|
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
|
|
123
|
-
#
|
|
124
|
-
#
|
|
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"] })
|