Module: KeycloakAdmin

Defined in:
lib/keycloak-admin.rb,
lib/keycloak-admin/version.rb,
lib/keycloak-admin/client/client.rb,
lib/keycloak-admin/configuration.rb,
lib/keycloak-admin/client/role_client.rb,
lib/keycloak-admin/client/user_client.rb,
lib/keycloak-admin/client/group_client.rb,
lib/keycloak-admin/client/realm_client.rb,
lib/keycloak-admin/client/token_client.rb,
lib/keycloak-admin/client/client_client.rb,
lib/keycloak-admin/resource/user_resource.rb,
lib/keycloak-admin/resource/group_resource.rb,
lib/keycloak-admin/client/client_role_client.rb,
lib/keycloak-admin/client/role_mapper_client.rb,
lib/keycloak-admin/representation/camel_json.rb,
lib/keycloak-admin/client/attack_detection_client.rb,
lib/keycloak-admin/client/identity_provider_client.rb,
lib/keycloak-admin/client/configurable_token_client.rb,
lib/keycloak-admin/client/client_role_mappings_client.rb,
lib/keycloak-admin/representation/role_representation.rb,
lib/keycloak-admin/representation/user_representation.rb,
lib/keycloak-admin/representation/group_representation.rb,
lib/keycloak-admin/representation/realm_representation.rb,
lib/keycloak-admin/representation/token_representation.rb,
lib/keycloak-admin/representation/client_representation.rb,
lib/keycloak-admin/representation/session_representation.rb,
lib/keycloak-admin/resource/base_role_containing_resource.rb,
lib/keycloak-admin/representation/credential_representation.rb,
lib/keycloak-admin/representation/impersonation_representation.rb,
lib/keycloak-admin/representation/protocol_mapper_representation.rb,
lib/keycloak-admin/representation/attack_detection_representation.rb,
lib/keycloak-admin/representation/identity_provider_representation.rb,
lib/keycloak-admin/representation/federated_identity_representation.rb,
lib/keycloak-admin/representation/identity_provider_mapper_representation.rb,
lib/keycloak-admin/representation/impersonation_redirection_representation.rb

Defined Under Namespace

Modules: CamelJson Classes: AttackDetectionClient, AttackDetectionRepresentation, BaseRoleContainingResource, Client, ClientClient, ClientRepresentation, ClientRoleClient, ClientRoleMappingsClient, ConfigurableTokenClient, Configuration, CredentialRepresentation, FederatedIdentityRepresentation, GroupClient, GroupRepresentation, GroupResource, IdentityProviderClient, IdentityProviderMapperRepresentation, IdentityProviderRepresentation, ImpersonationRedirectionRepresentation, ImpersonationRepresentation, ProtocolMapperRepresentation, RealmClient, RealmRepresentation, RoleClient, RoleMapperClient, RoleRepresentation, SessionRepresentation, TokenClient, TokenRepresentation, UserClient, UserRepresentation, UserResource

Constant Summary collapse

VERSION =
"1.1.2"

Class Method Summary collapse

Class Method Details

.configObject



44
45
46
# File 'lib/keycloak-admin.rb', line 44

def self.config
  @configuration
end

.configure {|@configuration ||= KeycloakAdmin::Configuration.new| ... } ⇒ Object

Yields:



40
41
42
# File 'lib/keycloak-admin.rb', line 40

def self.configure
  yield @configuration ||= KeycloakAdmin::Configuration.new
end

.create_client(configuration, realm_name) ⇒ Object



52
53
54
# File 'lib/keycloak-admin.rb', line 52

def self.create_client(configuration, realm_name)
  RealmClient.new(configuration, realm_name)
end

.load_configurationObject



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/keycloak-admin.rb', line 60

def self.load_configuration
  configure do |config|
    config.server_url          = nil
    config.server_domain       = nil
    config.client_realm_name   = ""
    config.client_id           = "admin-cli"
    config.logger              = ::Logger.new(STDOUT)
    config. = true
    config.username            = nil
    config.password            = nil
    config.rest_client_options = {}
  end
end

.loggerObject



56
57
58
# File 'lib/keycloak-admin.rb', line 56

def self.logger
  config.logger
end

.realm(realm_name) ⇒ Object



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

def self.realm(realm_name)
  create_client(@configuration, realm_name)
end