Module: Temporalio::Internal::Bridge

Defined in:
lib/temporalio/internal/bridge.rb,
lib/temporalio/internal/bridge/client.rb,
lib/temporalio/internal/bridge/worker.rb,
lib/temporalio/internal/bridge/runtime.rb,
lib/temporalio/internal/bridge/testing.rb,
lib/temporalio/internal/bridge/api/nexus/nexus.rb,
lib/temporalio/internal/bridge/api/common/common.rb,
lib/temporalio/internal/bridge/api/core_interface.rb,
lib/temporalio/internal/bridge/api/activity_task/activity_task.rb,
lib/temporalio/internal/bridge/api/external_data/external_data.rb,
lib/temporalio/internal/bridge/api/child_workflow/child_workflow.rb,
lib/temporalio/internal/bridge/api/activity_result/activity_result.rb,
lib/temporalio/internal/bridge/api/workflow_commands/workflow_commands.rb,
lib/temporalio/internal/bridge/api/workflow_activation/workflow_activation.rb,
lib/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rb

Defined Under Namespace

Modules: Api, Testing Classes: Client, Runtime, Worker

Class Method Summary collapse

Class Method Details

.assert_fiber_compatibility!Object



21
22
23
24
25
26
# File 'lib/temporalio/internal/bridge.rb', line 21

def self.assert_fiber_compatibility!
  return unless Fiber.current_scheduler && !fibers_supported

  raise 'Temporal SDK only supports fibers with Ruby 3.3 and newer, ' \
        'see https://github.com/temporalio/sdk-ruby/issues/162'
end

.assert_fips_compatibility!Object

On FIPS builds the native crypto backend (aws-lc-rs) is FIPS-validated, but the SDK still relies on Ruby's own OpenSSL for SecureRandom (request IDs) and the default worker build id digest. Those are only FIPS-backed if Ruby was built against a FIPS-enabled OpenSSL with FIPS mode active. If not, warn once rather than raise. No-op on non-FIPS builds.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/temporalio/internal/bridge.rb', line 32

def self.assert_fips_compatibility!
  return unless FIPS
  return if @fips_compatibility_checked

  @fips_compatibility_checked = true
  require 'openssl'
  return if OpenSSL.fips_mode

  warn 'temporalio: built for FIPS (aws-lc-rs) but Ruby OpenSSL is not in FIPS mode; SecureRandom and the ' \
       'default worker build id will not use a FIPS-validated module. Build Ruby against a FIPS-enabled ' \
       'OpenSSL and enable FIPS mode for full compliance.'
rescue StandardError
  # Some OpenSSL builds cannot report fips_mode; do not block usage over an unanswerable check.
  nil
end

.fibers_supportedObject



48
49
50
51
52
53
# File 'lib/temporalio/internal/bridge.rb', line 48

def self.fibers_supported
  # We do not allow fibers on < 3.3 due to a bug we still need to dig
  # into: https://github.com/temporalio/sdk-ruby/issues/162
  major, minor = RUBY_VERSION.split('.').take(2).map(&:to_i)
  !major.nil? && !minor.nil? && (major > 3 || (major == 3 && minor >= 3))
end