Class ExpAsStringVisibilityLabelServiceImpl
java.lang.Object
org.apache.hadoop.hbase.security.visibility.ExpAsStringVisibilityLabelServiceImpl
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.hbase.security.visibility.VisibilityLabelService
@Private
public class ExpAsStringVisibilityLabelServiceImpl
extends Object
implements org.apache.hadoop.hbase.security.visibility.VisibilityLabelService
This is a VisibilityLabelService where labels in Mutation's visibility expression will be
persisted as Strings itself rather than ordinals in 'labels' table. Also there is no need to add
labels to the system, prior to using them in Mutations/Authorizations.
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configuration
private static final byte[]
private final org.apache.hadoop.hbase.security.visibility.ExpressionExpander
private final org.apache.hadoop.hbase.security.visibility.ExpressionParser
private org.apache.hadoop.hbase.regionserver.Region
private static final org.slf4j.Logger
private List<org.apache.hadoop.hbase.security.visibility.ScanLabelGenerator>
private static final byte
private static final org.apache.hadoop.hbase.Tag
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.hbase.regionserver.OperationStatus[]
private static boolean
checkForMatchingVisibilityTagsWithSortedOrder
(List<org.apache.hadoop.hbase.Tag> putVisTags, List<org.apache.hadoop.hbase.Tag> deleteVisTags) org.apache.hadoop.hbase.regionserver.OperationStatus[]
clearAuths
(byte[] user, List<byte[]> authLabels) private byte[]
createModifiedVisExpression
(List<org.apache.hadoop.hbase.Tag> tags) private org.apache.hadoop.hbase.Tag
createTag
(org.apache.hadoop.hbase.security.visibility.expression.ExpressionNode node) List<org.apache.hadoop.hbase.Tag>
createVisibilityExpTags
(String visExpression, boolean withSerializationFormat, boolean checkAuths) byte[]
encodeVisibilityForReplication
(List<org.apache.hadoop.hbase.Tag> tags, Byte serializationFormat) private void
extractLabels
(org.apache.hadoop.hbase.security.visibility.expression.ExpressionNode node, List<String> labels, List<String> notLabels) private void
org.apache.hadoop.conf.Configuration
getConf()
getGroupAuths
(String[] groups, boolean systemCall) private static short
getTagValuePartAsShort
(org.apache.hadoop.hbase.Tag t, int offset) private static String
getTagValuePartAsString
(org.apache.hadoop.hbase.Tag t, int offset, int length) getUserAuths
(byte[] user, boolean systemCall) org.apache.hadoop.hbase.security.visibility.VisibilityExpEvaluator
getVisibilityExpEvaluator
(org.apache.hadoop.hbase.security.visibility.Authorizations authorizations) boolean
havingSystemAuth
(org.apache.hadoop.hbase.security.User user) void
init
(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment e) protected boolean
listLabels
(String regex) boolean
matchVisibility
(List<org.apache.hadoop.hbase.Tag> putTags, Byte putTagsFormat, List<org.apache.hadoop.hbase.Tag> deleteTags, Byte deleteTagsFormat) org.apache.hadoop.hbase.regionserver.OperationStatus[]
void
setConf
(org.apache.hadoop.conf.Configuration conf)
-
Field Details
-
LOG
-
DUMMY_VALUE
-
STRING_SERIALIZATION_FORMAT
- See Also:
-
STRING_SERIALIZATION_FORMAT_TAG
-
expressionParser
-
expressionExpander
-
conf
-
labelsRegion
-
scanLabelGenerators
-
-
Constructor Details
-
ExpAsStringVisibilityLabelServiceImpl
-
-
Method Details
-
addLabels
public org.apache.hadoop.hbase.regionserver.OperationStatus[] addLabels(List<byte[]> labels) throws IOException - Specified by:
addLabels
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
setAuths
public org.apache.hadoop.hbase.regionserver.OperationStatus[] setAuths(byte[] user, List<byte[]> authLabels) throws IOException - Specified by:
setAuths
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
clearAuths
public org.apache.hadoop.hbase.regionserver.OperationStatus[] clearAuths(byte[] user, List<byte[]> authLabels) throws IOException - Specified by:
clearAuths
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
getUserAuths
- Specified by:
getUserAuths
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
getGroupAuths
- Specified by:
getGroupAuths
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
getAuths
private void getAuths(org.apache.hadoop.hbase.client.Get get, List<String> auths) throws IOException - Throws:
IOException
-
listLabels
- Specified by:
listLabels
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
createVisibilityExpTags
public List<org.apache.hadoop.hbase.Tag> createVisibilityExpTags(String visExpression, boolean withSerializationFormat, boolean checkAuths) throws IOException - Specified by:
createVisibilityExpTags
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
getVisibilityExpEvaluator
public org.apache.hadoop.hbase.security.visibility.VisibilityExpEvaluator getVisibilityExpEvaluator(org.apache.hadoop.hbase.security.visibility.Authorizations authorizations) throws IOException - Specified by:
getVisibilityExpEvaluator
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
isReadFromSystemAuthUser
- Throws:
IOException
-
createTag
private org.apache.hadoop.hbase.Tag createTag(org.apache.hadoop.hbase.security.visibility.expression.ExpressionNode node) throws IOException - Throws:
IOException
-
extractLabels
private void extractLabels(org.apache.hadoop.hbase.security.visibility.expression.ExpressionNode node, List<String> labels, List<String> notLabels) -
getConf
- Specified by:
getConf
in interfaceorg.apache.hadoop.conf.Configurable
-
setConf
- Specified by:
setConf
in interfaceorg.apache.hadoop.conf.Configurable
-
init
public void init(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment e) throws IOException - Specified by:
init
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
havingSystemAuth
- Specified by:
havingSystemAuth
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
matchVisibility
public boolean matchVisibility(List<org.apache.hadoop.hbase.Tag> putTags, Byte putTagsFormat, List<org.apache.hadoop.hbase.Tag> deleteTags, Byte deleteTagsFormat) throws IOException - Specified by:
matchVisibility
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
checkForMatchingVisibilityTagsWithSortedOrder
private static boolean checkForMatchingVisibilityTagsWithSortedOrder(List<org.apache.hadoop.hbase.Tag> putVisTags, List<org.apache.hadoop.hbase.Tag> deleteVisTags) -
encodeVisibilityForReplication
public byte[] encodeVisibilityForReplication(List<org.apache.hadoop.hbase.Tag> tags, Byte serializationFormat) throws IOException - Specified by:
encodeVisibilityForReplication
in interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService
- Throws:
IOException
-
createModifiedVisExpression
private byte[] createModifiedVisExpression(List<org.apache.hadoop.hbase.Tag> tags) throws IOException - Parameters:
tags
- - all the tags associated with the current Cell- Returns:
- - the modified visibility expression as byte[]
- Throws:
IOException
-
getTagValuePartAsShort
-
getTagValuePartAsString
private static String getTagValuePartAsString(org.apache.hadoop.hbase.Tag t, int offset, int length)
-