dlmarion commented on code in PR #3746:
URL: https://github.com/apache/accumulo/pull/3746#discussion_r1668581806
##########
core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java:
##########
@@ -496,13 +510,34 @@ public ColumnVisibility(Text expression) {
}
/**
- * Creates a column visibility for a Mutation from a string already encoded
in UTF-8 bytes.
+ * Creates a column visibility for a Mutation from bytes already encoded in
UTF-8.
*
* @param expression visibility expression, encoded as UTF-8 bytes
* @see #ColumnVisibility(String)
*/
public ColumnVisibility(byte[] expression) {
- validate(expression);
+ this.expression = expression;
Review Comment:
Wondering if we should add a preconditions check here to make sure that
length is > 0
##########
core/src/main/java/org/apache/accumulo/core/security/Authorizations.java:
##########
@@ -385,4 +385,21 @@ public String serialize() {
return sb.toString();
}
+
+ /**
+ * Converts to an Accumulo Access Authorizations object.
+ *
+ * @since 3.1.0
+ */
+ public org.apache.accumulo.access.Authorizations toAccessAuthorizations() {
+ if (auths.isEmpty()) {
+ return org.apache.accumulo.access.Authorizations.of(Set.of());
Review Comment:
If `org.apache.accumulo.access.Authorizations.EMPTY` is not made public in
apache/accumulo-access#70, then we should get a reference to an empty
authorizations object and return it here instead of calling `Set.of` here.
Considering this is called from the VisibilityFilter, we should make this as
optimized as possible.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]