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

server: handle foo%2fbar in path (#695) #702

Merged
merged 2 commits into from
Apr 12, 2018

Conversation

srenatus
Copy link
Contributor

Now, GET /v1/data/foo%2fbar will construct a query string of

data["foo/bar"]

allowing to retrieve the key mentioned in issue #695.

However, I believe further work would be necessary, as the code path for
POST/PATCH/DELETE is different. (That has also blocked added a test for
this change, unfortunately.)

I also couldn't get this to work with POST /v0/data/foo%2fbar. (But I also
haven't tried very long, to be honest.)

Signed-off-by: Stephan Renatus <srenatus@chef.io>
Now, GET /v1/data/foo%2fbar will construct a query string of

    data["foo/bar"]

allowing to retrieve the key mentioned in issue open-policy-agent#695.

However, I believe further work would be necessary, as the code path for
POST/PATCH/DELETE is different. (That has also blocked added a test for
this change, unfortunately.)

I also couldn't get this to work with POST /v0/data/foo%2fbar. (But I also
haven't tried very long, to be honest.)

Signed-off-by: Stephan Renatus <srenatus@chef.io>
@tsandall
Copy link
Member

This works for the reads. I will submit a follow up PR that does the same for writes.

@tsandall tsandall merged commit 33b125e into open-policy-agent:master Apr 12, 2018
tsandall added a commit to tsandall/opa that referenced this pull request Apr 12, 2018
These changes extend open-policy-agent#702 to include writes. If the path segments are
escaped, the should be unescaped during parsing. This allows callers to
write keys like "foo/bar" into storage.

Fixes open-policy-agent#695

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
tsandall added a commit that referenced this pull request Apr 13, 2018
These changes extend #702 to include writes. If the path segments are
escaped, the should be unescaped during parsing. This allows callers to
write keys like "foo/bar" into storage.

Fixes #695

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
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.

2 participants