booth 0.1.0 → 0.1.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/CHANGELOG.md +4 -0
- data/lib/booth/adminland/incognitos/generate_secret_key.rb +20 -0
- data/lib/booth/version.rb +1 -1
- 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: dcf27bfc6c4f636766ee1764457f067d7a5c55d081f192735514ba2580e7a5db
|
|
4
|
+
data.tar.gz: 67b1e4f7bb2dbebfca56ffdea115eb1b035bb894f8a2b49ef3afd55312c79211
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 65900f930895224c41eb582731d43b7faad4780a92e4bd319d6a692e4148c6a733620406fa3f295d059e0661c44304a45b87f695e623e48230ef5af3b89c6e4b
|
|
7
|
+
data.tar.gz: c9301b3babf34c6e40b2dc23e2501d2fc0c3d543872fc37614771b0c7fbd75f2d6905fab4a0a4a07d88dc01590fc83083409bf4e070f76326f5ff98f6995ca52
|
data/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,7 @@ module Booth
|
|
|
14
14
|
def call
|
|
15
15
|
do_check_impersonator_logged_in
|
|
16
16
|
.on_success { do_find_target_credential }
|
|
17
|
+
.on_success { do_revoke_existing_incognito }
|
|
17
18
|
.on_success { do_create_session }
|
|
18
19
|
.on_success { do_audit }
|
|
19
20
|
.on_success { do_return_key }
|
|
@@ -42,6 +43,25 @@ module Booth
|
|
|
42
43
|
Tron.success :target_credential_found
|
|
43
44
|
end
|
|
44
45
|
|
|
46
|
+
# incognito_credential_id has a unique index — only one active incognito
|
|
47
|
+
# per impersonator. Revoke any existing one before creating a new session.
|
|
48
|
+
def do_revoke_existing_incognito
|
|
49
|
+
existing = ::Booth::Models::Session.find_by(
|
|
50
|
+
incognito_credential_id: impersonator_credential_id,
|
|
51
|
+
revoked_at: nil,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
return Tron.success(:no_existing_incognito) unless existing
|
|
55
|
+
|
|
56
|
+
log { "Revoking existing incognito session ##{existing.id}" }
|
|
57
|
+
existing.update!(
|
|
58
|
+
incognito_credential_id: nil,
|
|
59
|
+
revoked_at: Time.current,
|
|
60
|
+
revoke_reason: :incognito_replaced,
|
|
61
|
+
)
|
|
62
|
+
Tron.success :existing_incognito_revoked
|
|
63
|
+
end
|
|
64
|
+
|
|
45
65
|
def do_create_session
|
|
46
66
|
self.secret_key = SecureRandom.hex(32)
|
|
47
67
|
|
data/lib/booth/version.rb
CHANGED