Sha256: 9574f41653267ec5e6ec5a7e0a85d44ec5e33acdd935bc74576b7c92d5488238
Contents?: true
Size: 1.23 KB
Versions: 6
Compression:
Stored size: 1.23 KB
Contents
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true require 'contrast/utils/string_utils' require 'contrast/utils/assess/tracking_util' require 'base64' module Contrast module Api module Decorators # Used to decorate the {Contrast::Api::Dtm::UserInput} protobuf model. module UserInput UNKNOWN_USER_INPUT = Contrast::Api::Dtm::UserInput.new.tap do |user_input| user_input.input_type = :UNKNOWN end.cs__freeze def self.included klass klass.extend(ClassMethods) end # Used to add class methods to UserInput module ClassMethods def build_from_ia_result ia_result return UNKNOWN_USER_INPUT.dup unless ia_result user_input = new user_input.input_type = ia_result.input_type.to_i user_input.matcher_ids = ia_result.ids user_input.path = ia_result.path.to_s user_input.key = ia_result.key.to_s user_input.value = ia_result.value.to_s user_input end end end end end end Contrast::Api::Dtm::UserInput.include(Contrast::Api::Decorators::UserInput)
Version data entries
6 entries across 6 versions & 1 rubygems