|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.security.visibility.DefaultVisibilityLabelServiceImpl
@InterfaceAudience.Private public class DefaultVisibilityLabelServiceImpl
| Constructor Summary | |
|---|---|
DefaultVisibilityLabelServiceImpl()
|
|
| Method Summary | |
|---|---|
OperationStatus[] |
addLabels(List<byte[]> labels)
Adds the set of labels into the system. |
protected void |
addSystemLabel(HRegion region,
Map<String,Integer> labels,
Map<String,List<Integer>> userAuths)
|
OperationStatus[] |
clearAuths(byte[] user,
List<byte[]> authLabels)
Removes given labels from user's globally authorized list of labels. |
List<Tag> |
createVisibilityExpTags(String visExpression,
boolean withSerializationFormat,
boolean checkAuths)
Creates tags corresponding to given visibility expression. |
byte[] |
encodeVisibilityForReplication(List<Tag> tags,
Byte serializationFormat)
Provides a way to modify the visibility tags of type TagType
.VISIBILITY_TAG_TYPE, that are part of the cell created from the WALEdits
that are prepared for replication while calling
ReplicationEndpoint
.replicate(). |
protected Pair<Map<String,Integer>,Map<String,List<Integer>>> |
extractLabelsAndAuths(List<List<Cell>> labelDetails)
|
List<String> |
getAuths(byte[] user,
boolean systemCall)
Deprecated. |
org.apache.hadoop.conf.Configuration |
getConf()
|
protected List<List<Cell>> |
getExistingLabelsWithAuths()
|
List<String> |
getGroupAuths(String[] groups,
boolean systemCall)
Retrieve the visibility labels for the groups. |
List<String> |
getUserAuths(byte[] user,
boolean systemCall)
Retrieve the visibility labels for the user. |
VisibilityExpEvaluator |
getVisibilityExpEvaluator(Authorizations authorizations)
Creates VisibilityExpEvaluator corresponding to given Authorizations. |
boolean |
havingSystemAuth(byte[] user)
Deprecated. |
boolean |
havingSystemAuth(User user)
System checks for user auth during admin operations. |
void |
init(RegionCoprocessorEnvironment e)
System calls this after opening of regions. |
protected boolean |
isReadFromSystemAuthUser()
|
List<String> |
listLabels(String regex)
Retrieve the list of visibility labels defined in the system. |
boolean |
matchVisibility(List<Tag> putVisTags,
Byte putTagsFormat,
List<Tag> deleteVisTags,
Byte deleteTagsFormat)
System uses this for deciding whether a Cell can be deleted by matching visibility expression in Delete mutation and the cell in consideration. |
OperationStatus[] |
setAuths(byte[] user,
List<byte[]> authLabels)
Sets given labels globally authorized for the user. |
void |
setConf(org.apache.hadoop.conf.Configuration conf)
|
protected void |
updateZk(boolean labelAddition)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultVisibilityLabelServiceImpl()
| Method Detail |
|---|
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurablepublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurable
public void init(RegionCoprocessorEnvironment e)
throws IOException
VisibilityLabelService
init in interface VisibilityLabelServicee - the region coprocessor env
IOException
protected List<List<Cell>> getExistingLabelsWithAuths()
throws IOException
IOExceptionprotected Pair<Map<String,Integer>,Map<String,List<Integer>>> extractLabelsAndAuths(List<List<Cell>> labelDetails)
protected void addSystemLabel(HRegion region,
Map<String,Integer> labels,
Map<String,List<Integer>> userAuths)
throws IOException
IOException
public OperationStatus[] addLabels(List<byte[]> labels)
throws IOException
VisibilityLabelService
addLabels in interface VisibilityLabelServicelabels - Labels to add to the system.
IOException
public OperationStatus[] setAuths(byte[] user,
List<byte[]> authLabels)
throws IOException
VisibilityLabelService
setAuths in interface VisibilityLabelServiceuser - The authorizing userauthLabels - Labels which are getting authorized for the user
IOException
public OperationStatus[] clearAuths(byte[] user,
List<byte[]> authLabels)
throws IOException
VisibilityLabelService
clearAuths in interface VisibilityLabelServiceuser - The user whose authorization to be removedauthLabels - Labels which are getting removed from authorization set
IOException
@Deprecated
public List<String> getAuths(byte[] user,
boolean systemCall)
throws IOException
VisibilityLabelService
getAuths in interface VisibilityLabelServiceuser - Name of the user whose authorization to be retrievedsystemCall - Whether a system or user originated call.
IOException
public List<String> getUserAuths(byte[] user,
boolean systemCall)
throws IOException
VisibilityLabelService
getUserAuths in interface VisibilityLabelServiceuser - Name of the user whose authorization to be retrievedsystemCall - Whether a system or user originated call.
IOException
public List<String> getGroupAuths(String[] groups,
boolean systemCall)
throws IOException
VisibilityLabelService
getGroupAuths in interface VisibilityLabelServicegroups - Name of the groups whose authorization to be retrievedsystemCall - Whether a system or user originated call.
IOException
public List<String> listLabels(String regex)
throws IOException
VisibilityLabelService
listLabels in interface VisibilityLabelServiceregex - The regular expression to filter which labels are returned.
IOException
public List<Tag> createVisibilityExpTags(String visExpression,
boolean withSerializationFormat,
boolean checkAuths)
throws IOException
VisibilityLabelService
createVisibilityExpTags in interface VisibilityLabelServicevisExpression - The Expression for which corresponding Tags to be created.withSerializationFormat - specifies whether a tag, denoting the serialization version
of the tags, to be added in the list. When this is true make sure to add the
serialization format Tag also. The format tag value should be byte type.checkAuths - denotes whether to check individual labels in visExpression against user's
global auth label.
IOException
protected void updateZk(boolean labelAddition)
throws IOException
IOException
public VisibilityExpEvaluator getVisibilityExpEvaluator(Authorizations authorizations)
throws IOException
VisibilityLabelService
getVisibilityExpEvaluator in interface VisibilityLabelServiceauthorizations - Authorizations for the read request
IOException
protected boolean isReadFromSystemAuthUser()
throws IOException
IOException
@Deprecated
public boolean havingSystemAuth(byte[] user)
throws IOException
VisibilityLabelService
havingSystemAuth in interface VisibilityLabelServiceuser - User for whom system auth check to be done.
IOException
public boolean havingSystemAuth(User user)
throws IOException
VisibilityLabelService
havingSystemAuth in interface VisibilityLabelServiceuser - User for whom system auth check to be done.
IOException
public boolean matchVisibility(List<Tag> putVisTags,
Byte putTagsFormat,
List<Tag> deleteVisTags,
Byte deleteTagsFormat)
throws IOException
VisibilityLabelService
matchVisibility in interface VisibilityLabelServiceputVisTags - The visibility tags present in the Put mutationputTagsFormat - The serialization format for the Put visibility tags. A null value for
this format means the tags are written with unsorted label ordinalsdeleteVisTags - - The visibility tags in the delete mutation (the specified Cell Visibility)deleteTagsFormat - The serialization format for the Delete visibility tags. A null value for
this format means the tags are written with unsorted label ordinals
IOExceptionVisibilityConstants.SORTED_ORDINAL_SERIALIZATION_FORMAT
public byte[] encodeVisibilityForReplication(List<Tag> tags,
Byte serializationFormat)
throws IOException
VisibilityLabelServiceTagType
.VISIBILITY_TAG_TYPE, that are part of the cell created from the WALEdits
that are prepared for replication while calling
ReplicationEndpoint
.replicate().
VisibilityReplicationEndpoint
calls this API to provide an opportunity to modify the visibility tags
before replicating.
encodeVisibilityForReplication in interface VisibilityLabelServicetags - the visibility tags associated with the cellserializationFormat - the serialization format associated with the tag
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||