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
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configurationprivate static final byte[]private final org.apache.hadoop.hbase.security.visibility.ExpressionExpanderprivate final org.apache.hadoop.hbase.security.visibility.ExpressionParserprivate org.apache.hadoop.hbase.regionserver.Regionprivate static final org.slf4j.Loggerprivate List<org.apache.hadoop.hbase.security.visibility.ScanLabelGenerator>private static final byteprivate static final org.apache.hadoop.hbase.Tag -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.hbase.regionserver.OperationStatus[]private static booleancheckForMatchingVisibilityTagsWithSortedOrder(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.TagcreateTag(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 voidextractLabels(org.apache.hadoop.hbase.security.visibility.expression.ExpressionNode node, List<String> labels, List<String> notLabels) private voidorg.apache.hadoop.conf.ConfigurationgetConf()getGroupAuths(String[] groups, boolean systemCall) private static shortgetTagValuePartAsShort(org.apache.hadoop.hbase.Tag t, int offset) private static StringgetTagValuePartAsString(org.apache.hadoop.hbase.Tag t, int offset, int length) getUserAuths(byte[] user, boolean systemCall) org.apache.hadoop.hbase.security.visibility.VisibilityExpEvaluatorgetVisibilityExpEvaluator(org.apache.hadoop.hbase.security.visibility.Authorizations authorizations) booleanhavingSystemAuth(org.apache.hadoop.hbase.security.User user) voidinit(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment e) protected booleanlistLabels(String regex) booleanmatchVisibility(List<org.apache.hadoop.hbase.Tag> putTags, Byte putTagsFormat, List<org.apache.hadoop.hbase.Tag> deleteTags, Byte deleteTagsFormat) org.apache.hadoop.hbase.regionserver.OperationStatus[]voidsetConf(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:
addLabelsin 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:
setAuthsin 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:
clearAuthsin interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService- Throws:
IOException
-
getUserAuths
- Specified by:
getUserAuthsin interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService- Throws:
IOException
-
getGroupAuths
- Specified by:
getGroupAuthsin 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:
listLabelsin 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:
createVisibilityExpTagsin 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:
getVisibilityExpEvaluatorin 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:
getConfin interfaceorg.apache.hadoop.conf.Configurable
-
setConf
- Specified by:
setConfin interfaceorg.apache.hadoop.conf.Configurable
-
init
public void init(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment e) throws IOException - Specified by:
initin interfaceorg.apache.hadoop.hbase.security.visibility.VisibilityLabelService- Throws:
IOException
-
havingSystemAuth
- Specified by:
havingSystemAuthin 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:
matchVisibilityin 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:
encodeVisibilityForReplicationin 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)
-