Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
com.github.dmillett:jig
Advanced tools
#jConfigMap (See LICENSE AND NOTICE):
Is a Java client configuration tool that uses Groovy (for now), to separate client configuration access from underlying config storage implementations. For example, it flattens XML and JSON configuration files into a key-value Map structure. Each key and value are stored as String values. Value retrieval is based upon applying regular expressions across the Map key set. The matching values are then returned in a new map. Or, if it is a simple key value property, then only the matching value is returned.
Currently jConfigMap supports XML and JSON configuration files during startup. Database connections maybe specified in XML/JSON files and retrieved in key-value form. A global config map (see java ConfigMap), can then be used statically for config access.
##Features
####installation See (https://github.com/dmillett/jConfigMap/wiki) ####easy to use
##Usage (additional examples in test directory)
###pojo examples
// Retrieve an exact value
ConfigLookup lookup = new ConfigLookup();
int value1 = lookup.getByKey("key.two.int", Integer.class);
// Retrieve a group where all key-value pairs where the key matches this pattern
ConfigLookup configHelper = new ConfigLookup();
Pattern stocks = PatternHelper.buildPattern("stocks");
// 4 results (all stocks #1 - 4)
Map<String, String> stocksMap = configHelper.get(stocks);
// 2 results (see #1, 2 -> values: 8.00, 8.32)
Map<String, String> fooStocks = configHelper.get(stocks, "FOO");
// 2 results (see #1, 3 -> values: 8.00, 4.50)
Map<String, String> lowStocks = configHelper.get(stocks, "low");
// 1 result (see #1 -> values: 8.00)
Map<String, String> lowFooStocks = configHelper.get(stocks, "FOO", "low");
###static access with enum (see test example package)
// A sample enum
public enum ConfigEnumExample {
// key:value pairs
ONE("key.one.string", String.class),
TWO("key.two.int", Integer.class),
THREE("key.three.double", Double.class),
FOUR("key.four.boolean", Boolean.class),
FIVE("key.five.list", List.class),
}
ConfigEnumExample.FOUR.get(Boolean.class));
// As a String or int
int test1 = Integer.parseInt(ConfigEnumExample.TWO.get(String.class));
int test2 = ConfigEnumExample.TWO.get(Integer.class);
assertTrue(test1 == test2);
// Values as a String or List<String>
String testList = ConfigEnumExample.FIVE.get(String.class);
List<String> testValues = ConfigEnumExample.FIVE.get(List.class);
###structured config code sample with lists/sorts and statistics
ConfigLookup configHelper = new ConfigLookup()
Pattern stocks = PatternHelper.buildPattern("bars");
// Gather statistics (off by default)
configHelper.getConfigStatistics().enableStatsCollection();
ConfigLookup configHelper = new ConfigLookup();
Pattern bars = PatternHelper.buildPattern("bars");
// All bar key-values (#1 - 4)
Map<String, String> allBars = configHelper.get(bars);
// Sorted bar key-values(#1-4)
Map<String, String> sortedBars = configHelper.getSortedResults(someComparator, bars);
// Chicago bars (#1, 2, 3) note the versions ("", "1", "2")
Map<String, String> chicagoBars = configHelper.get(bars, "chicago");
configHelper.getConfigStatistics().disableStatsCollection();
// Examine the stats
Map<String, StatsValue> stats = ConfigStatistics.getStats();
assertEquals(4, stats.size());
StatsValue value = stats.get("structures.cities.chicago.bars.bar");
assertTrue(value.getAverageLatency() > 0.0);
assertTrue(value.getLastAccessed() > 0);
assertEquals(2, value.getCount());
assertEquals(2, value.getAssociatedPatterns().size());
#####simple key-value config sample in XML
<config>
<keyValues>
<property name="key.one.string" value="first value" />
<property name="key.two.int">1</property>
<property name="key.three.double" value="2.0" />
<property name="key.four.list" value="AMD, INTC, WFMI, SCCO" />
</keyValues>
</config>
#####generates Map.Entry
1. "key.one.string, "first value"
2. "key.two.int", "1"
3. "key.three.double", "2.0"
4. "key.four.list", "AMD, INTC, WFMI, SCCO"
#####structured config sample
<config>
<structures>
<stocks>
<stock name="FOO">
<low>8.00</low>
<high>8.32</high>
</stock>
<stock name="BAR">
<low>4.50</low>
<high>4.65</high>
</stock>
</stocks>
</structures>
</config>
#####generates
1. "structures.stocks.stock.name.foo.low", "8.00"
2. "structures.stocks.stock.name.foo.high", "8.32"
3. "structures.stocks.stock.name.bar.low", "4.50"
4. "structures.stocks.stock.name.bar.high", "4.65"
#####structured config sample with list(s)
<config>
<structures>
<cities>
<Chicago>
<bars>
<bar>Sheffields</bar>
<bar>Map Room</bar>
<bar>Matilda</bar>
</bars>
</Chicago>
<Ann Arbor>
<bars>
<bar>Grizzly Peak</bar>
</bars>
</Ann Arbor>
</cities>
</structures>
</config>
#####generates
1. "structures.cities.chicago.bars.bar", "Sheffields"
2. "structures.cities.chicago.bars.bar.1", "Map Room"
3. "structures.cities.chicago.bars.bar.2", "Matilda"
4. "structures.cities.ann arbor.bars.bar", "Grizzly Peak"
###notes
##Future See (https://github.com/dmillett/jConfigMap/issues)
FAQs
A Java and Groovy configuration library.
We found that com.github.dmillett:jig demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.