Module: Castle

Defined in:
lib/castle.rb,
lib/castle/api.rb,
lib/castle/client.rb,
lib/castle/errors.rb,
lib/castle/logger.rb,
lib/castle/api/log.rb,
lib/castle/command.rb,
lib/castle/session.rb,
lib/castle/verdict.rb,
lib/castle/version.rb,
lib/castle/api/risk.rb,
lib/castle/api/track.rb,
lib/castle/api/filter.rb,
lib/castle/ips/extract.rb,
lib/castle/secure_mode.rb,
lib/castle/utils/clone.rb,
lib/castle/utils/merge.rb,
lib/castle/commands/log.rb,
lib/castle/commands/risk.rb,
lib/castle/configuration.rb,
lib/castle/context/merge.rb,
lib/castle/support/rails.rb,
lib/castle/api/get_device.rb,
lib/castle/commands/track.rb,
lib/castle/headers/filter.rb,
lib/castle/headers/format.rb,
lib/castle/support/hanami.rb,
lib/castle/commands/filter.rb,
lib/castle/context/prepare.rb,
lib/castle/headers/extract.rb,
lib/castle/payload/prepare.rb,
lib/castle/webhooks/verify.rb,
lib/castle/api/authenticate.rb,
lib/castle/context/sanitize.rb,
lib/castle/api/report_device.rb,
lib/castle/client_id/extract.rb,
lib/castle/core/send_request.rb,
lib/castle/failover/strategy.rb,
lib/castle/api/approve_device.rb,
lib/castle/validators/present.rb,
lib/castle/commands/get_device.rb,
lib/castle/context/get_default.rb,
lib/castle/core/get_connection.rb,
lib/castle/utils/get_timestamp.rb,
lib/castle/core/process_webhook.rb,
lib/castle/utils/secure_compare.rb,
lib/castle/api/end_impersonation.rb,
lib/castle/commands/authenticate.rb,
lib/castle/core/process_response.rb,
lib/castle/commands/report_device.rb,
lib/castle/api/start_impersonation.rb,
lib/castle/commands/approve_device.rb,
lib/castle/singleton_configuration.rb,
lib/castle/api/get_devices_for_user.rb,
lib/castle/validators/not_supported.rb,
lib/castle/failover/prepare_response.rb,
lib/castle/utils/clean_invalid_chars.rb,
lib/castle/utils/deep_symbolize_keys.rb,
lib/castle/commands/end_impersonation.rb,
lib/castle/commands/start_impersonation.rb,
lib/castle/commands/get_devices_for_user.rb

Overview

main sdk module

Defined Under Namespace

Modules: API, CastleClient, ClientId, Commands, Context, Core, Failover, Hanami, Headers, IPs, Logger, Payload, SecureMode, Session, Utils, Validators, Verdict, Webhooks Classes: ApiError, BadRequestError, Client, Command, Configuration, ConfigurationError, Error, ForbiddenError, ImpersonationFailed, InternalServerError, InvalidParametersError, InvalidRequestTokenError, NotFoundError, RequestError, SecurityError, SingletonConfiguration, UnauthorizedError, UserUnauthorizedError, WebhookVerificationError

Constant Summary collapse

VERSION =
'7.2.0'

Class Method Summary collapse

Class Method Details

.api_secret=(api_secret) ⇒ Object



81
82
83
# File 'lib/castle.rb', line 81

def api_secret=(api_secret)
  config.api_secret = api_secret
end

.configObject



77
78
79
# File 'lib/castle.rb', line 77

def config
  SingletonConfiguration.instance
end

.configure(config_hash = nil) {|config| ... } ⇒ Object

Yields:



69
70
71
72
73
74
75
# File 'lib/castle.rb', line 69

def configure(config_hash = nil)
  (config_hash || {}).each do |config_name, config_value|
    config.send("#{config_name}=", config_value)
  end

  yield(config) if block_given?
end