atlas_rb 1.27.3 → 1.27.4

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: 57da54874f04fe2d2b07757c8c062fe5a4e95aae8d843de69ed7bd53158b8122
4
- data.tar.gz: af25098d8000917fac7e65121fc575dd38460ed23c2515e6309d2d230c9389ce
3
+ metadata.gz: 98ed27c0812607ce56681c0dd9b3ab4c17fc1224c7e3c36bf0aa5b4deb7527e9
4
+ data.tar.gz: 401ebcc7d93621d999c2b6441f0e470ee6b68c2081e0eb104e5f059330310004
5
5
  SHA512:
6
- metadata.gz: 228ce5a5c9c2746628bea89760fd5b623d017a3511e2d8f59ce22401aa58499a2e82500da0fd76ba12dacd5e3d5fd772694f717b7312e98b0c2b8fec43c94ca2
7
- data.tar.gz: 3b92e9cf2b59e766276a7654fa2769d5339b9b511f146aa429692b8f7d84dfa3a96b5575659b6ee923d64bc3b08bc1291f8245de75922b419ba9b276629a7043
6
+ metadata.gz: 604f5e4183097244b9759cbf0caf188abf45ca936a7f9a07f3a476a4cb05dee0aa23f65357114bbdd9525e85d2c6ae746f0dba330f05cc4f3b978ae077778900
7
+ data.tar.gz: e9d53ba6883acc6decc743d4e480a682918c7f6db19e550e97d5455836a31250a29430ba846df03fab075cd410cff11b6c01ffe257522898c47c9f27d708b723
data/.version CHANGED
@@ -1 +1 @@
1
- 1.27.3
1
+ 1.27.4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.27.4
4
+
5
+ Requires an Atlas that serves `GET /works/:id/health_check` (0.6.232 or later).
6
+
7
+ ### Added — `AtlasRb::Work.health_check`
8
+
9
+ Reads a Work's green/yellow/red health grade and the findings behind it, each
10
+ with a severity, a machine-readable code, the NOID it is about and a message.
11
+ Atlas never re-hashes the bytes for this call, so `fixity_checked` is always
12
+ false. Admin and devolved-admin tiers only; anyone else gets a
13
+ `ResourceError` with status 403. `nil` on a 404.
14
+
3
15
  ## 1.27.3
4
16
 
5
17
  ### Changed — `Metrics.latency` documentation
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.27.3)
4
+ atlas_rb (1.27.4)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
@@ -16,24 +16,24 @@ GEM
16
16
  base64 (0.3.0)
17
17
  connection_pool (2.5.5)
18
18
  diff-lcs (1.6.1)
19
- faraday (2.14.4)
20
- faraday-net_http (>= 2.0, < 3.5)
19
+ faraday (2.15.0)
20
+ faraday-net_http (>= 2.0, < 3.6)
21
21
  json
22
22
  logger
23
23
  faraday-follow_redirects (0.3.0)
24
24
  faraday (>= 1, < 3)
25
25
  faraday-multipart (1.2.0)
26
26
  multipart-post (~> 2.0)
27
- faraday-net_http (3.4.4)
27
+ faraday-net_http (3.5.0)
28
28
  net-http (~> 0.5)
29
29
  faraday-net_http_persistent (2.3.1)
30
30
  faraday (~> 2.5)
31
31
  net-http-persistent (>= 4.0.4, < 5)
32
32
  faraday-retry (2.4.0)
33
33
  faraday (~> 2.0)
34
- hashie (5.1.0)
34
+ hashie (5.2.0)
35
35
  logger
36
- json (3.0.2)
36
+ json (3.1.0)
37
37
  jwt (2.10.3)
38
38
  base64
39
39
  logger (1.7.0)
data/lib/atlas_rb/work.rb CHANGED
@@ -512,6 +512,48 @@ module AtlasRb
512
512
  end
513
513
  end
514
514
 
515
+ # Grade a Work's health green, yellow or red.
516
+ #
517
+ # Wraps `GET /works/<id>/health_check` (Atlas 0.6.232 or later). `grade` is
518
+ # `"green"` (viable), `"yellow"` (broken or degraded, nothing lost, so
519
+ # repairable in place) or `"red"` (bytes missing or corrupt, so it needs a
520
+ # restore or a re-deposit). Each of `findings` carries `severity`
521
+ # (`"advisory"`, `"repairable"` or `"fatal"`), a machine-readable `code`,
522
+ # the `subject` NOID it is about and a `message`. The codes are an open
523
+ # vocabulary: show one you do not recognise rather than failing on it.
524
+ #
525
+ # Atlas never re-hashes the bytes for this call, so `fixity_checked` is
526
+ # always `false`: a green means nothing is missing, not that the bytes
527
+ # were verified. Atlas allows it for the admin and devolved-admin tiers
528
+ # only; edit rights on the Work do not reach it.
529
+ #
530
+ # @param id [String] the Work ID.
531
+ # @param nuid [String, nil] optional acting user's NUID. On the relay-signing
532
+ # path it is signed into the assertion `sub`; on the BYO-JWT (`ATLAS_JWT`)
533
+ # path it is ignored (identity lives in the token).
534
+ # @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
535
+ # header. Falls through to {AtlasRb.config}.default_on_behalf_of when
536
+ # omitted.
537
+ # @return [AtlasRb::Mash, nil] the report: `noid`, `grade`,
538
+ # `fixity_checked` and `findings`.
539
+ #
540
+ # `nil` when Atlas answers `404` — no such Work, or, with a misconfigured
541
+ # `ATLAS_URL`, the route is not Atlas's at all.
542
+ # @raise [AtlasRb::ResourceError] on any non-2xx other than `404` / `410`
543
+ # (a `403` for a caller below the delegate tier, a `5xx`, a proxy's
544
+ # `503`), carrying Atlas's status and body so the failure is attributable
545
+ # at the boundary.
546
+ # @example Show what needs repair
547
+ # report = AtlasRb::Work.health_check("w-789", nuid: admin_nuid)
548
+ # report.findings.reject { |f| f.severity == "advisory" }.each do |f|
549
+ # puts "#{f.severity} #{f.code}: #{f.message}"
550
+ # end
551
+ def self.health_check(id, nuid: nil, on_behalf_of: nil)
552
+ read_body(connection({}, nuid, on_behalf_of: on_behalf_of).get("#{ROUTE}#{id}/health_check")) do |body|
553
+ AtlasRb::Mash.new(body)
554
+ end
555
+ end
556
+
515
557
  # List a Work's page FileSets in order, each with its assets.
516
558
  #
517
559
  # Wraps `GET /works/<id>/file_sets` — the ordered, grouped sibling of
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atlas_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.3
4
+ version: 1.27.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-10-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday
@@ -136,7 +135,6 @@ dependencies:
136
135
  - - "~>"
137
136
  - !ruby/object:Gem::Version
138
137
  version: '0.9'
139
- description:
140
138
  email:
141
139
  - david.g.cliff@gmail.com
142
140
  executables: []
@@ -191,12 +189,10 @@ files:
191
189
  - lib/atlas_rb/version.rb
192
190
  - lib/atlas_rb/work.rb
193
191
  - sig/atlas_rb.rbs
194
- homepage:
195
192
  licenses:
196
193
  - MIT
197
194
  metadata:
198
195
  rubygems_mfa_required: 'false'
199
- post_install_message:
200
196
  rdoc_options: []
201
197
  require_paths:
202
198
  - lib
@@ -211,8 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
207
  - !ruby/object:Gem::Version
212
208
  version: '0'
213
209
  requirements: []
214
- rubygems_version: 3.2.33
215
- signing_key:
210
+ rubygems_version: 3.6.9
216
211
  specification_version: 4
217
212
  summary: Ruby gem for Atlas API.
218
213
  test_files: []