You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "DomGarguilo (via GitHub)" <gi...@apache.org> on 2024/02/20 20:38:35 UTC
[PR] Replace `Authorizer` with `Predicate` [accumulo-access]
DomGarguilo opened a new pull request, #64:
URL: https://github.com/apache/accumulo-access/pull/64
Fixes #57
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `Authorizer` with `Predicate` [accumulo-access]
Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #64:
URL: https://github.com/apache/accumulo-access/pull/64#discussion_r1497692856
##########
src/main/java/org/apache/accumulo/access/AccessEvaluator.java:
##########
@@ -88,12 +90,12 @@ static AccessEvaluator of(Authorizations authorizations) {
}
/**
- * Creates an AccessEvaluator from an Authorizer object
+ * Creates an AccessEvaluator from a Predicate<String>
Review Comment:
Added to the javadoc in 4e80d25 to try to address this.
##########
src/main/java/org/apache/accumulo/access/AccessEvaluator.java:
##########
@@ -159,13 +161,4 @@ static AccessEvaluator of(String... authorizations) {
return new AccessEvaluatorImpl(AccessEvaluatorImpl.convert(authorizations));
}
- /**
- * An interface that is used to check if an authorization seen in an access expression is
Review Comment:
Added to the javadoc in 4e80d25 to try to address this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `Authorizer` with `Predicate` [accumulo-access]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on PR #64:
URL: https://github.com/apache/accumulo-access/pull/64#issuecomment-1956834915
Looking at the amount of code that has changed in this PR, it's not much at all. I think all we have done here is remove an interface which makes clear based on the name of the method and argument how it's used and replaced it with a generic object that is unclear. Because of that we have to try and explain to the user what they should implement in javadoc based on how it's going to be used. I'm not sold on the fact that we should make this change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `Authorizer` with `Predicate` [accumulo-access]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on PR #64:
URL: https://github.com/apache/accumulo-access/pull/64#issuecomment-1957193856
If Authorizer is kept, then it should have the `@FunctionalInterface` annotation to signify intent and make sure that intent is not changed in the future. Since Authorizer is currently a functional interface its very easy to assign a predicate to it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `Authorizer` with `Predicate` [accumulo-access]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #64:
URL: https://github.com/apache/accumulo-access/pull/64#discussion_r1496546145
##########
src/main/java/org/apache/accumulo/access/AccessEvaluator.java:
##########
@@ -159,13 +161,4 @@ static AccessEvaluator of(String... authorizations) {
return new AccessEvaluatorImpl(AccessEvaluatorImpl.convert(authorizations));
}
- /**
- * An interface that is used to check if an authorization seen in an access expression is
Review Comment:
This javadoc should be moved (with rewording) to the method that now takes a predicate. Need to explain what the purpose of the predicate is, which this javadoc kinda does.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `Authorizer` with `Predicate` [accumulo-access]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #64:
URL: https://github.com/apache/accumulo-access/pull/64#discussion_r1496539569
##########
src/main/java/org/apache/accumulo/access/AccessEvaluator.java:
##########
@@ -88,12 +90,12 @@ static AccessEvaluator of(Authorizations authorizations) {
}
/**
- * Creates an AccessEvaluator from an Authorizer object
+ * Creates an AccessEvaluator from a Predicate<String>
Review Comment:
I wonder if we need a little more verbiage to explain when the predicate should return true vs false. Given that this is part of the public API we may want to explain that the AccessEvaluator implementation is going to call `test` passing in a single Authorization and it should return true if the exact String matches.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `Authorizer` with `Predicate` [accumulo-access]
Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii closed pull request #64: Replace `Authorizer` with `Predicate<String>`
URL: https://github.com/apache/accumulo-access/pull/64
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `Authorizer` with `Predicate` [accumulo-access]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on PR #64:
URL: https://github.com/apache/accumulo-access/pull/64#issuecomment-1957108040
@DomGarguilo - I'm going to take @keith-turner 's thumbs up to my comment to mean that he agrees with me. Given that the issue was created by @ctubbsii, maybe leave this open and un-merged to see if he has any thoughts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `Authorizer` with `Predicate` [accumulo-access]
Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on PR #64:
URL: https://github.com/apache/accumulo-access/pull/64#issuecomment-1957002320
> Looking at the amount of code that has changed in this PR, it's not much at all. I think all we have done here is remove an interface which makes clear based on the name of the method and argument how it's used and replaced it with a generic object that is unclear. Because of that we have to try and explain to the user what they should implement in javadoc based on how it's going to be used. I'm not sold on the fact that we should make this change.
Makes sense to me. I can go ahead and close this PR for now.
The ticket also mentioned:
> could at least extend Predicate<String> with a default method, so either way of calling could be used
Does anyone have an opinion on whether this might be worth it or not? I am fine with just closing this PR and the ticket but just wanted to explore all the ideas mentioned in the ticket.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `Authorizer` with `Predicate` [accumulo-access]
Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on PR #64:
URL: https://github.com/apache/accumulo-access/pull/64#issuecomment-4035282231
Superseded by #107
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org