GEODE-9740: require DATA:WRITE permission for WRITE redis ops and PUBLISH#7029
Conversation
jdeppe-pivotal
left a comment
There was a problem hiding this comment.
Looks good. Could you also add an integration test (maybe to AuthIntegrationTest) that exercises this with read and write commands.
...r-redis/src/test/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContextTest.java
Outdated
Show resolved
Hide resolved
upthewaterspout
left a comment
There was a problem hiding this comment.
Looks pretty good!
Looking through the flags in RedisCommandType, I think a few commands might need to be updated? Some commands are marked neither READONLY nor WRITE, so they default to requiring write permission in our scheme. But maybe that's not the right thing?
- PING
- ECHO
- COMMAND
- INFO
- LOLWUT
- SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, ??
- PUBSUB
- CLUSTER
That last one - cluster, means I think that a readonly client currently couldn't really work. This might have only worked because the AuthIntegrationTest is not using a clustered client. I think it probably should.
...e-for-redis/src/main/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContext.java
Show resolved
Hide resolved
...rationTest/java/org/apache/geode/redis/internal/executor/connection/AuthIntegrationTest.java
Show resolved
Hide resolved
all others check for write permission
5c48896 to
22911d6
Compare
are those with the WRITE flag and the PUBLISH command. All others need READ permission.
nonbinaryprogrammer
left a comment
There was a problem hiding this comment.
looks good but I'd like a couple more tests
Redis commands with the WRITE flag and the PUBLISH command will require DATA:WRITE.
All other commands will require DATA:READ.
Options
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Has your PR been rebased against the latest commit within the target branch (typically
develop)?Is your initial contribution a single, squashed commit?
Does
gradlew buildrun cleanly?Have you written or updated unit tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?