class Capsium::Reactor::Deploy
Reactor-side deployment configuration (deploy.json): everything that must NOT ship in the package β OAuth2 client secrets, the session signing secret, role assignments, an alternate htpasswd file, the public base URL. Shape:
{
"baseUrl": "http://localhost:8864",
"authentication": {
"basicAuth": { "passwdFile": "/secure/.htpasswd" },
"oauth2": { "clientSecret": "..." },
"sessionSecret": "...",
"roles": { "alice": ["admin"] }
}
}
Loaded from an explicit path, an already-parsed Hash, or the CAPSIUM_DEPLOY environment variable; empty when unconfigured.
Constants
- ENV_VAR
- FILE
Attributes
config
[R]
Hash[String, untyped]
Public Class Methods
(Hash[String, untyped] | String? source) → Deploy
Source
# File lib/capsium/reactor/deploy.rb, line 30 def self.load(source) return new(source) if source.is_a?(Hash) path = source || ENV.fetch(ENV_VAR, nil) return new({}) if path.nil? || path.to_s.empty? raise Error, "deploy configuration not found: #{path}" unless File.file?(path) new(JSON.parse(File.read(path))) end
(Hash[String, untyped] config) → void
Source
# File lib/capsium/reactor/deploy.rb, line 40 def initialize(config) @config = config end
Public Instance Methods
() → Hash[String, untyped]
Source
# File lib/capsium/reactor/deploy.rb, line 44 def authentication config["authentication"] || {} end
() → String?
Source
# File lib/capsium/reactor/deploy.rb, line 48 def base_url config["baseUrl"] end
() → String?
Source
# File lib/capsium/reactor/deploy.rb, line 52 def client_secret authentication.dig("oauth2", "clientSecret") end
() → String?
Source
# File lib/capsium/reactor/deploy.rb, line 60 def passwd_file authentication.dig("basicAuth", "passwdFile") end
() → Hash[String, Array[String]]
Source
# File lib/capsium/reactor/deploy.rb, line 66 def roles authentication["roles"] || {} end
Role assignments keyed by identity name (basic-auth username, OAuth2 email or subject): {βaliceβ: [βadminβ, βuserβ]}.
() → String?
Source
# File lib/capsium/reactor/deploy.rb, line 56 def session_secret authentication["sessionSecret"] end