studio-engine 0.69.2 → 0.69.3
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/lib/studio/s3.rb +22 -0
- data/lib/studio/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: 5ade07348f1d55403ac332ea2a030b8af81ff8b9b8d4a49b637326eb40168847
|
|
4
|
+
data.tar.gz: e5ee5053749871945628e8f522fffee01569e0ae3052016b9388c79b98be59d4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: baf91b4f29446f4cc53ef15890ba67e9691046c769af46ac3beec04f9ad530ad3f67ee9d4d686d85d37ed3b0f7e78c1e453eec0476e4146eaa97bbd8fdf4fd68
|
|
7
|
+
data.tar.gz: 5ae6368f5e8c1ba95081f8608acc3193e3b82436e42e6a2cef059a6e979fb1b025da56058f980bc544f7d0add642d2972d7aefcc5b37c1fda22ca65c71c269cf
|
data/lib/studio/s3.rb
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
# The QA signal lives in EnvironmentBanner (pure Ruby, unit-tested). Required
|
|
2
|
+
# EXPLICITLY rather than leaned on: s3.rb is loadable on its own — the unit suite
|
|
3
|
+
# requires it directly without lib/studio.rb — so an implicit dependency here
|
|
4
|
+
# resolves in the app and raises NoMethodError in a test.
|
|
5
|
+
require_relative "environment_banner"
|
|
6
|
+
|
|
1
7
|
module Studio
|
|
2
8
|
module S3
|
|
3
9
|
class Error < StandardError; end
|
|
@@ -100,7 +106,23 @@ module Studio
|
|
|
100
106
|
|
|
101
107
|
private
|
|
102
108
|
|
|
109
|
+
# WHICH BUCKET HALF THIS APP OWNS. Rails.env alone cannot answer it: no QA app
|
|
110
|
+
# sets RAILS_ENV, so every QA app boots as `production` exactly like real
|
|
111
|
+
# production. QA_ENV is the signal that separates them, and it is the one
|
|
112
|
+
# config/storage.yml (Active Storage), Studio::EnvironmentBanner and
|
|
113
|
+
# turf-monster's AppFlags already read — so consulting it here makes BOTH S3
|
|
114
|
+
# writers agree instead of resolving different buckets from the same process.
|
|
115
|
+
#
|
|
116
|
+
# Before this, a QA app holding the DEV key was handed the PRODUCTION bucket:
|
|
117
|
+
# every write took an IAM AccessDenied (uncaught — the knowledge_docs
|
|
118
|
+
# controller rescues only NotConfigured/MissingTable), and a LIST returned
|
|
119
|
+
# production's confidential objects to a review environment.
|
|
120
|
+
#
|
|
121
|
+
# `Studio.qa_environment?` delegates to EnvironmentBanner.truthy?, so
|
|
122
|
+
# `QA_ENV=false` correctly reads as production rather than as mere presence.
|
|
103
123
|
def environment
|
|
124
|
+
return "dev" if EnvironmentBanner.qa_environment?
|
|
125
|
+
|
|
104
126
|
defined?(Rails) && Rails.env.production? ? "production" : "dev"
|
|
105
127
|
end
|
|
106
128
|
end
|
data/lib/studio/version.rb
CHANGED