Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle delimiters passed through as text into the web service #5491

Closed
wants to merge 1 commit into from

Conversation

syncrou
Copy link
Contributor

@syncrou syncrou commented Nov 17, 2015

https://bugzilla.redhat.com/show_bug.cgi?id=1277734

Modified the parse_ws_string method to handle input
that includes delimiters.

A customer can now include a delimiter (namely '|' (pipes))
as text passed into the web service and the string will no
longer be mangled.

@syncrou
Copy link
Contributor Author

syncrou commented Nov 17, 2015

@gmcculloug - Please review

@syncrou
Copy link
Contributor Author

syncrou commented Nov 17, 2015

@miq-bot add_label provisioning

@miq-bot
Copy link
Member

miq-bot commented Nov 17, 2015

Checked commit syncrou@52a8091 with ruby 1.9.3, rubocop 0.34.2, and haml-lint 0.13.0
3 files checked, 1 offense detected

app/models/miq_request_workflow.rb

  • 🔹 - Line 357, Col 3 - Metrics/AbcSize - Assignment Branch Condition size for sanitized_join is too high. [15.26/15]

@syncrou
Copy link
Contributor Author

syncrou commented Nov 17, 2015

@miq-bot add_label enhancement

@gmcculloug
Copy link
Member

@syncrou Need to look into the test failures.

@gmcculloug
Copy link
Member

@jeffwarnica No, nothing wrong with those but this makes me realize that we might be able to bypass string parsing completely and just pass arrays or hashes here. The string implementation was based around a SOAP API which is no longer in the product. If the call is coming from Rest or Automate it would be easy to allow the caller to send objects instead of a string that requires parsing.

@syncrou Let's pair and see if this approach is viable.

@gmcculloug
Copy link
Member

Thanks to @abellotti and the work he did for the REST API passing a hash is already supported based on PR #260 (REST API Enhancement to support Provisioning). The change to parsing accepts a hash and converts it into the expected format. This is already used by REST and can be passed for automate as well.

parse_ws_string always accepted arguments as a hash
And in the case of this bug: sending multiple '|' delimited
arguments as a hash solves the original problem.  This fix
adds deprecation warnings to parse_ws_string when arguments
are sent as a string - noting the solution in the warning text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants