-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
etcdctl/ctlv3: auth: wildcard terminated paths specify ranges #6371
Conversation
What if other people ask for |
I don't need them or find them compelling. But maybe I don't understand what the situations they would be used to model. Could you elaborate on the first one in particular -- what is having two slashes as the first two runes trying to do? Under the current PR, it would receive no special consideration, as it neither ends in I think this simple PR is perfectly defensible. nats.io and many other pub/sub systems have used similar (filesystem) semantics. |
@glycerine Sorry. Github messed up the format. I updated my previous reply. |
My answer stays the same. : ) |
My implementation is flawed in some way, as tests would have shown. Where is not obvious... gets seem to work, but put does not. When I track it down, it is because the Hints appreciated. |
Yes, I'm mightily confused. Still trying to debug why I have no writes going through. I have a role,
And yet: inside isRangeOpPermitted(), even if I force a call to getMergedPerms() every time, I still get back no write permissions (at https://github.com/coreos/etcd/blob/master/auth/range_perm_cache.go#L168; with the
UPDATE: never mind, I didn't assign the role to the user. |
a87eb85
to
d84d4c8
Compare
mostly working now. more testing needed. |
5457876
to
aa12666
Compare
arg, had to track down of number of insidious bugs in the existing range and range-merging code. those are fixed now, but I still need tests for the new functionality. |
f4ecbeb
to
641ee54
Compare
If somebody could help out with getting a test that does the following (in library/code rather than shell outs to etcdctl of couse) I would very much appreciate it. I'm out of time for a while to figure out how to write these tests, it would be nice get these fixes and additions in place, and I'm sure somebody is more familiar with the testing facilities already available than I am. test plan:
|
} | ||
} | ||
|
||
func rangeIsPrefix(a *rangePerm) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is simply the inverse of expandPrefixToRange(). Not in use at the moment, but likely to be needed in the near future, possibly in the tests that are TBD. By the way, any pointers re the test plan would be appreciated; e.g. what api calls would accomplish the steps outlined?
It looks like this breaks for any key with a |
@heyitsanthony what would be acceptable for handing the presence of special characters like We're used to bash/filesystem interfaces that treat certain characters specially, spaces and Does escaping a star |
with the latest:
|
Added a test file. @xiang90, @heyitsanthony -- I think this is in good shape. Please take a look. |
6fc1671
to
c4ffe53
Compare
Implement wildcard '*' for get and del. When '*' is the last symbol in a key, the key is converted to a prefix range. The wildcard may only appear as the last symbol in a key. Also: fix several fencepost bugs fixed in the range sorting/merge code, including one incorrect test in auth/range_perm_cache_test.go Fixes etcd-io#6359
@glycerine anything that imposes special structure on the keys can't be part of the base KV API. Expecting people to escape This really should be done with a proxy. |
conclusion was that this won't be the way to go. Closing this, and opening a separate pr with the bug fixes to range handling. |
Still needs tests, but creating pull request to facilitate the discussion in #6359