class Capsium::Package::Authentication
Loads a package’s authentication.json (ARCHITECTURE.md section 4b).
Attributes
path
[R]
String
Public Class Methods
(String path) → void
Source
# File lib/capsium/package/authentication.rb, line 15 def initialize(path) @path = path @config = File.exist?(path) ? AuthenticationConfig.from_json(File.read(path)) : nil end
Public Instance Methods
() → BasicAuthConfig?
Source
# File lib/capsium/package/authentication.rb, line 24 def basic_auth @config&.authentication&.basic_auth end
() → bool
Source
# File lib/capsium/package/authentication.rb, line 33 def enabled? !!(basic_auth&.enabled? || oauth2&.enabled?) end
Whether any authentication method is enabled.
() → OAuth2Config?
Source
# File lib/capsium/package/authentication.rb, line 28 def oauth2 @config&.authentication&.oauth2 end
() → bool
Source
# File lib/capsium/package/authentication.rb, line 20 def present? !@config.nil? end