@Test public void testEnforcingScanLabelGenerator() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); SUPERUSER.runAs(new PrivilegedExceptionAction<Void>() { public Void run() throws Exception { HTable table = TEST_UTIL.createTable(tableName, CF); try { Put put = new Put(ROW_1); put.add(CF, Q1, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); put = new Put(ROW_1); put.add(CF, Q2, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(ROW_1); put.add(CF, Q3, HConstants.LATEST_TIMESTAMP, value); table.put(put); return null; } finally { table.close(); } } }); TESTUSER.runAs(new PrivilegedExceptionAction<Void>() { public Void run() throws Exception { HTable table = new HTable(conf, tableName); try { Get get = new Get(ROW_1); get.setAuthorizations(new Authorizations(new String[] { SECRET, CONFIDENTIAL })); Result result = table.get(get); assertFalse("Inappropriate authorization", result.containsColumn(CF, Q1)); assertTrue("Missing authorization", result.containsColumn(CF, Q2)); assertTrue("Inappropriate filtering", result.containsColumn(CF, Q3)); get = new Get(ROW_1); result = table.get(get); assertFalse("Inappropriate authorization", result.containsColumn(CF, Q1)); assertTrue("Missing authorization", result.containsColumn(CF, Q2)); assertTrue("Inappropriate filtering", result.containsColumn(CF, Q3)); return null; } finally { table.close(); } } }); }
public EnforcingScanLabelGenerator() { this.labelsManager = VisibilityLabelsManager.get(); }
EnforcingScanLabelGenerator implements ScanLabelGenerator { public EnforcingScanLabelGenerator() { this.labelsManager = VisibilityLabelsManager.get(); } }
EnforcingScanLabelGenerator implements ScanLabelGenerator { public EnforcingScanLabelGenerator() { this.labelsManager = VisibilityLabelsManager.get(); } EnforcingScanLabelGenerator(); }
EnforcingScanLabelGenerator implements ScanLabelGenerator { public EnforcingScanLabelGenerator() { this.labelsManager = VisibilityLabelsManager.get(); } EnforcingScanLabelGenerator(); @Override void setConf(Configuration conf); @Override Configuration getConf(); @Override List<String> getLabels(User user, Authorizations authorizations); }
EnforcingScanLabelGenerator implements ScanLabelGenerator { public EnforcingScanLabelGenerator() { this.labelsManager = VisibilityLabelsManager.get(); } EnforcingScanLabelGenerator(); @Override void setConf(Configuration conf); @Override Configuration getConf(); @Override List<String> getLabels(User user, Authorizations authorizations);  }