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 +4 -4
- data/.version +1 -1
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/atlas_rb/maintenance.rb +9 -2
- 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: 651cf253c9f27ae5b3f3a917e76d6c630d079623f971230080962d3abd966157
|
|
4
|
+
data.tar.gz: da553d3a5239463b46a80c1348c53a60dcce2c2b7cb92f2dafb76095f61c433b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e1f8bde0b540dd884930a4d0d78fd5441726caccadda299127f0a2548845ec690698c95e4cc114c70e11645d9197b4c11e29782bdeb0cf3539b1553d82a592b2
|
|
7
|
+
data.tar.gz: a10278be702677b1939ddc8cbc41a5dbcde9b6854f9016d0df7ab5040e07bd23edac96f6116299e335b670ee74955623eca400c5ad092f909431666363967766
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.13.
|
|
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
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"
|
data/lib/atlas_rb/maintenance.rb
CHANGED
|
@@ -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
|
-
|
|
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.
|