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

feat: Use URL escape for device command name and resource name #806

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

weichou1229
Copy link
Member

@weichou1229 weichou1229 commented Feb 20, 2023

Remove the constraint of device command name and resource name, and use URL escape in client API.

Close #773

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-core-contracts/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?) not impact

Testing Instructions

  • Run core service and device service
  • Verify the escape URL works, eg, escape the commandName device-a/test:value and put into the URL like /api/v2/device/name/Modbus-TCP-Device/device-a%2Ftest%3Avalue

New Dependency Instructions (If applicable)

@codecov-commenter
Copy link

Codecov Report

Merging #806 (309e93d) into main (1bb5704) will not change coverage.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main     #806   +/-   ##
=======================================
  Coverage   64.46%   64.46%           
=======================================
  Files          80       80           
  Lines        3079     3079           
=======================================
  Hits         1985     1985           
  Misses        905      905           
  Partials      189      189           
Impacted Files Coverage Δ
dtos/devicecommand.go 53.57% <ø> (ø)
dtos/deviceresource.go 50.00% <ø> (ø)
dtos/event.go 84.61% <ø> (ø)
dtos/reading.go 78.83% <ø> (ø)
clients/http/command.go 74.46% <100.00%> (ø)
clients/http/deviceprofile.go 73.97% <100.00%> (ø)
clients/http/deviceservicecommand.go 52.50% <100.00%> (ø)
clients/http/reading.go 79.79% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@weichou1229 weichou1229 force-pushed the issue-773 branch 3 times, most recently from 0aa6460 to abb2fde Compare February 21, 2023 12:01
@weichou1229 weichou1229 marked this pull request as ready for review February 21, 2023 12:03
clients/http/reading_test.go Outdated Show resolved Hide resolved
clients/http/utils/common.go Show resolved Hide resolved
dtos/corecommand.go Outdated Show resolved Hide resolved
lenny-goodell
lenny-goodell previously approved these changes Feb 22, 2023
Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also be handled

path := path.Join(common.ApiEventRoute, serviceName, req.Event.ProfileName, req.Event.DeviceName, req.Event.SourceName)

Remove the constraint of device command name and resource name, and use URL escape in client API.

Close edgexfoundry#773

Signed-off-by: bruce <weichou1229@gmail.com>
@weichou1229
Copy link
Member Author

this should also be handled

path := path.Join(common.ApiEventRoute, serviceName, req.Event.ProfileName, req.Event.DeviceName, req.Event.SourceName)

Updated.

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use URL escape for device command name and resource name
5 participants