atlas_rb 1.13.0 → 1.13.1

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: c55fceb9d85a211c8e28903ae67f1b8b98a9114c8ab403c63af68721bef76df4
4
- data.tar.gz: 2b0684c399abf35c57bb6aac6def417f6996126b5afec576295d5d57cd5f72d2
3
+ metadata.gz: 651cf253c9f27ae5b3f3a917e76d6c630d079623f971230080962d3abd966157
4
+ data.tar.gz: da553d3a5239463b46a80c1348c53a60dcce2c2b7cb92f2dafb76095f61c433b
5
5
  SHA512:
6
- metadata.gz: 46728839d509e41136a4a87f774c8f343055b0fd219d45e04732c6ef95ba635c5f13715e52b7f6dfd700ffe149e59debce03b77bf748e2c03b94f837540d24ff
7
- data.tar.gz: 3bcd0432f0eab0d5bba7d0f7e8da7d1f29b50a083631cfe357c00eaf1d6403ac526dcb9c3ca6ecd68d26b4459d64d7407aa3a2b926bf9585f433e316369cdcbc
6
+ metadata.gz: e1f8bde0b540dd884930a4d0d78fd5441726caccadda299127f0a2548845ec690698c95e4cc114c70e11645d9197b4c11e29782bdeb0cf3539b1553d82a592b2
7
+ data.tar.gz: a10278be702677b1939ddc8cbc41a5dbcde9b6854f9016d0df7ab5040e07bd23edac96f6116299e335b670ee74955623eca400c5ad092f909431666363967766
data/.version CHANGED
@@ -1 +1 @@
1
- 1.13.0
1
+ 1.13.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.13.1
4
+
5
+ ### Fixed — `Maintenance.read` could not name an acting principal
6
+
7
+ `AtlasRb::Maintenance.read` took no `nuid:`, unlike every other read binding,
8
+ so on the relay-signing path it had no NUID to sign into the assertion `sub`
9
+ and raised `ConfigurationError`. It worked only in BYO-JWT mode or when the
10
+ host configured `AtlasRb.config.default_nuid`. It now takes `nuid:` and
11
+ `on_behalf_of:` like its neighbours.
12
+
13
+ ```ruby
14
+ AtlasRb::Maintenance.read(nuid: current_user.nuid)
15
+ ```
16
+
17
+ `.write` is unchanged — it runs on the system connection, which deliberately
18
+ never consults ambient identity.
19
+
3
20
  ## 1.13.0
4
21
 
5
22
  ### Added — maintenance mode no longer passes through silently
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.13.0)
4
+ atlas_rb (1.13.1)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
data/README.md CHANGED
@@ -523,7 +523,7 @@ Read the flag to render a banner before a caller trips it. The read is answered
523
523
  even while the window is open, so a client can always see the flag it honours:
524
524
 
525
525
  ```ruby
526
- window = AtlasRb::Maintenance.read
526
+ window = AtlasRb::Maintenance.read(nuid: current_user.nuid)
527
527
  window["read_only"] # => true
528
528
  window["source"] # => "deploy" / "operator"
529
529
  window["message"] # => "Scheduled maintenance until 10:00"
@@ -33,11 +33,18 @@ module AtlasRb
33
33
  # Cheap and safe to poll behind a short-TTL cache; Cerberus renders its
34
34
  # banner and its client-side write gate from this.
35
35
  #
36
+ # @param nuid [String, nil] the acting NUID, signed into the assertion `sub`
37
+ # on the relay path. Optional only in BYO-JWT mode or when the host
38
+ # configures {AtlasRb.config#default_nuid}; the read sits behind Atlas's
39
+ # authenticated read floor, so it needs a principal like any other read.
40
+ # @param on_behalf_of [String, nil] optional NUID carried as a signed `obo`
41
+ # claim.
36
42
  # @return [AtlasRb::Mash] `read_only` (Boolean), `source`
37
43
  # (`"operator"` / `"deploy"` / nil), `since` (ISO-8601 or nil), `message`
38
44
  # (String or nil), and `retry_after` (Integer seconds).
39
- def self.read
40
- AtlasRb::Mash.new(JSON.parse(connection({}).get("/maintenance").body))
45
+ def self.read(nuid: nil, on_behalf_of: nil)
46
+ response = connection({}, nuid, on_behalf_of: on_behalf_of).get("/maintenance")
47
+ AtlasRb::Mash.new(JSON.parse(response.body))
41
48
  end
42
49
 
43
50
  # Open or close the window (`PUT /maintenance`). System-gated in Atlas.
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.13.0
4
+ version: 1.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff