Module: Keycloak

Extended by:
Base
Defined in:
lib/keycloak.rb,
lib/keycloak/version.rb,
lib/keycloak/exceptions.rb,
lib/generators/keycloak/config/config_generator.rb

Defined Under Namespace

Modules: Admin, Base, Client, Generators, Internal Classes: Config, InstallationFileNotFound, KeycloakException, ProcCookieTokenNotDefined, ProcExternalAttributesNotDefined, UserLoginNotFound

Constant Summary collapse

OLD_KEYCLOAK_JSON_FILE =
'keycloak.json'.freeze
KEYCLOAK_JSON_FILE =
'config/keycloak.json'.freeze
VERSION =
'3.3.0'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Base

config, proc_cookie_token, proc_cookie_token=, proc_external_attributes, proc_external_attributes=

Class Attribute Details

.auth_server_urlObject

Returns the value of attribute auth_server_url.



48
49
50
# File 'lib/keycloak.rb', line 48

def auth_server_url
  @auth_server_url
end

.generate_request_exceptionObject

Returns the value of attribute generate_request_exception.



48
49
50
# File 'lib/keycloak.rb', line 48

def generate_request_exception
  @generate_request_exception
end

.keycloak_controllerObject

Returns the value of attribute keycloak_controller.



48
49
50
# File 'lib/keycloak.rb', line 48

def keycloak_controller
  @keycloak_controller
end

.proxyObject

Returns the value of attribute proxy.



48
49
50
# File 'lib/keycloak.rb', line 48

def proxy
  @proxy
end

.realmObject

Returns the value of attribute realm.



48
49
50
# File 'lib/keycloak.rb', line 48

def realm
  @realm
end

.resourceObject

Returns the value of attribute resource.



48
49
50
# File 'lib/keycloak.rb', line 48

def resource
  @resource
end

.secretObject

Returns the value of attribute secret.



48
49
50
# File 'lib/keycloak.rb', line 48

def secret
  @secret
end

.validate_token_when_call_has_roleObject

Returns the value of attribute validate_token_when_call_has_role.



48
49
50
# File 'lib/keycloak.rb', line 48

def validate_token_when_call_has_role
  @validate_token_when_call_has_role
end

Class Method Details

.explode_exceptionObject



53
54
55
56
# File 'lib/keycloak.rb', line 53

def self.explode_exception
  Keycloak.generate_request_exception = true if Keycloak.generate_request_exception.nil?
  Keycloak.generate_request_exception
end

.installation_fileObject



58
59
60
61
62
63
64
# File 'lib/keycloak.rb', line 58

def self.installation_file
  @installation_file ||= if File.exist?(KEYCLOAK_JSON_FILE)
                           KEYCLOAK_JSON_FILE
                         else
                           OLD_KEYCLOAK_JSON_FILE
                         end
end

.installation_file=(file = nil) ⇒ Object



66
67
68
69
# File 'lib/keycloak.rb', line 66

def self.installation_file=(file = nil)
  raise InstallationFileNotFound unless file.instance_of?(String) && File.exist?(file)
  @installation_file = file || KEYCLOAK_JSON_FILE
end