Sha256: 29ac45c1135abfc896d3171d6c5ce16529c2619ad5c19f7c4a866faad231debb

Contents?: true

Size: 1.08 KB

Versions: 13

Compression:

Stored size: 1.08 KB

Contents

# typed: true
# frozen_string_literal: true

require 'securerandom'
require 'active_support/core_ext/class/attribute'

module Workato
  module Connector
    module Sdk
      module Dsl
        module ExecutionContext
          extend T::Sig
          extend T::Helpers
          extend ActiveSupport::Concern

          included do
            T.bind(self, Class)

            # encrypted safe recipe_id
            class_attribute :recipe_id, instance_predicate: false, default: SecureRandom.hex(32)
          end

          sig { returns(T::Hash[Symbol, T.untyped]) }
          def execution_context
            @execution_context ||= {
              recipe_id: recipe_id
            }.compact
          end

          # mock unencrypted recipe_id for testing only
          def recipe_id!
            recipe_id.reverse
          end

          module ClassMethods
            # mock unencrypted recipe_id for testing only
            def recipe_id!
              T.unsafe(self).recipe_id.reverse
            end
          end

          private_constant :ClassMethods
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
workato-connector-sdk-1.3.13 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.12 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.11 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.10 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.9 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.8 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.7 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.6 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.5 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.4 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.3 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.2 lib/workato/connector/sdk/dsl/execution_context.rb
workato-connector-sdk-1.3.1 lib/workato/connector/sdk/dsl/execution_context.rb