Sha256: 7b6baf7c3f6806c8d8b6ae656a59b353dc4402f22e9e7df72edb6c047ca71a5b

Contents?: true

Size: 1.18 KB

Versions: 26

Compression:

Stored size: 1.18 KB

Contents

module Foobara
  module CommandConnectors
    module Transformers
      # This behavior is hard-coded but this is here to update the error classes in the manifest
      class AuthErrorsTransformer < Value::Transformer
        class << self
          # Feels awkward to have to do this for a few reasons. Passing self and also not
          # adhering to processor interface. Not sure how best to address this.
          def transform_error_context_type_map(transformed_command, map)
            if transformed_command.requires_authentication
              possible_error = PossibleError.new(CommandConnector::UnauthenticatedError)
              map = map.merge(possible_error.key.to_s => possible_error)
            end

            if transformed_command.allowed_rule
              possible_error = PossibleError.new(CommandConnector::NotAllowedError)
              map = map.merge(possible_error.key.to_s => possible_error)
            end

            map
          end
        end
        def applicable?(_request)
          false
        end

        def transform(_request)
          # :nocov:
          raise "Not expected to be called"
          # :nocov:
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.25 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.24 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.23 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.22 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.21 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.20 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.19 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.18 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.17 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.16 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.15 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.14 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.13 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.12 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.11 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.10 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.9 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.8 projects/command_connectors/src/transformers/auth_errors_transformer.rb
foobara-0.0.7 projects/command_connectors/src/transformers/auth_errors_transformer.rb