Skip to content

Commit

Permalink
Dependabot alerts fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
astrapi69 committed Aug 30, 2023
1 parent 07c9967 commit f0d599b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
java-version: '17'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v2.8.0
with:
arguments: build
env:
Expand Down
24 changes: 12 additions & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ projectRepositoriesPasswordKey=ossrhPassword
###########################
gradlePluginVersionsVersion=0.47.0
licenseGradlePluginVersion=0.16.1
gradlePluginLombokVersion=8.2.2
gradlePluginLombokVersion=8.3
gradleIzpackPluginVersion=3.2
grgitGradlePluginVersion=5.2.0
spotlessGradlePluginVersion=6.20.0
spotlessGradlePluginVersion=6.21.0
############################
# IzPackInstaller property #
############################
createIzPackInstaller=false
#########################
# dependencies versions #
#########################
izpackVersion=5.1.3
izpackVersion=5.2.0
lombokVersion=1.18.28
modelDataVersion=2.1
swingComponentsVersion=8.1
Expand All @@ -67,8 +67,8 @@ bouncycastleVersion=1.70
checksumUpVersion=2.2
xmlExtensionsVersion=8.2
guavaVersion=32.1.2-jre
fileWorkerVersion=11.6
sillyCollectionVersion=21
fileWorkerVersion=17
sillyCollectionVersion=27
sillyBeanVersion=2
randomizerVersion=9
gsonExtensionsVersion=2.1
Expand All @@ -81,11 +81,11 @@ commonsCodecVersion=1.16.0
netExtensionsVersion=5.2
genTreeVersion=8.4
treeApiVersion=1.5
iconImgExtensionsVersion=2.2
iconImgExtensionsVersion=3
jremixIconVersion=1.1
batikVersion=1.16
batikVersion=1.17
imgscalrLibVersion=4.2
sqliteJdbcVersion=3.42.0.0
sqliteJdbcVersion=3.43.0.0
commonsLang3Version=3.13.0
sillyIoVersion=2.2
designPatternObserverVersion=6
Expand All @@ -106,7 +106,7 @@ autoBrowserVersion=2.0.6
##############################
# test dependencies versions #
##############################
keePassJava2Version=2.1.4
keePassJava2Version=2.2.1
testObjectVersion=7.2
junitJupiterExtensionsVersion=1.1
assertjSwingVersion=3.17.1
Expand All @@ -123,9 +123,9 @@ mysticCryptStoreType=release.mystic-crypt.store.type
mysticCryptStorePassword=release.mystic-crypt.store.password
mysticCryptKeyPassword=release.mystic-crypt.key.password
mysticCryptKeyAlias=release.mystic-crypt.key.alias
##########################
# for deploy on sonatype #
##########################
##############################
# for deployment on sonatype #
##############################
systemProp.org.gradle.internal.publish.checksums.insecure=true
org.gradle.caching=true
org.gradle.parallel=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

import io.github.astrapi69.collection.list.ListExtensions;
import io.github.astrapi69.collection.pair.KeySetPair;
import io.github.astrapi69.collection.set.SetExtensions;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down Expand Up @@ -69,35 +68,42 @@ public class MysticCryptEntryModelBean
@Builder.Default
List<KeyValuePair<String, String>> properties = new ArrayList<>();

public String getProperty(String name) {
String property = KeyValuePair.toMap(properties).get(name);
return property;
public String getProperty(String name)
{
return KeyValuePair.toMap(properties).get(name);
}

public void setProperty(String name, String value){
properties.add(KeyValuePair.<String, String>builder().key(name).value(value).build());
public void setProperty(String name, String value)
{
properties.add(KeyValuePair.<String, String> builder().key(name).value(value).build());
}

public boolean removeProperty(String name) {
public boolean removeProperty(String name)
{
String value = getProperty(name);
KeyValuePair<String, String> remove = KeyValuePair.<String, String>builder().key(name).value(value).build();
KeyValuePair<String, String> remove = KeyValuePair.<String, String> builder().key(name)
.value(value).build();
int indexToRemove = properties.indexOf(remove);
if(-1 < indexToRemove) {
if (-1 < indexToRemove)
{
properties.remove(indexToRemove);
return true;
}
return false;
}

public List<String> getPropertyNames() {
public List<String> getPropertyNames()
{
return ListExtensions.toList(KeyValuePair.toMap(properties).keySet());
}

public KeySetPair<String, LocalDateTime> getKeySetPair(){
public KeySetPair<String, LocalDateTime> getKeySetPair()
{
return null;
}

public String getPath(){
public String getPath()
{
return "";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,41 @@
import java.util.List;

import org.junit.jupiter.api.Test;
import org.linguafranca.pwdb.Database;
import org.linguafranca.pwdb.Entry;
import org.linguafranca.pwdb.Group;
import org.linguafranca.pwdb.kdbx.KdbxCreds;
import org.linguafranca.pwdb.kdbx.simple.SimpleDatabase;
import org.linguafranca.pwdb.kdbx.simple.SimpleEntry;
import org.linguafranca.pwdb.kdbx.simple.SimpleGroup;

public class KeePass2Test
{


@Test
public void testKeePass2() throws Exception {
public void testKeePass2() throws Exception
{
KdbxCreds credentials = new KdbxCreds("foo-secret-bar-1969-?".getBytes());
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("test-db.kdbx");
Database database = SimpleDatabase.load(credentials, inputStream);
Group rootGroup = database.getRootGroup();
SimpleDatabase database = SimpleDatabase.load(credentials, inputStream);
SimpleGroup rootGroup = database.getRootGroup();

List<Group> allGroups = getAllGroups(rootGroup);
List<SimpleGroup> allGroups = getAllGroups(rootGroup);
allGroups.add(rootGroup);
for (Group currentGroup: allGroups){
List<Entry> currentEntries = currentGroup.getEntries();
for (Entry currentEntry: currentEntries) {
for (SimpleGroup currentGroup : allGroups)
{
List<SimpleEntry> currentEntries = currentGroup.getEntries();
for (SimpleEntry currentEntry : currentEntries)
{
System.out.println(currentEntry);
}
}

}

public static List<Group> getAllGroups(Group group) {
List<Group> returnList = new ArrayList<>();
returnList.addAll(group.getGroups());

for(Object currentGroup: group.getGroups()) {
returnList.addAll(getAllGroups((Group)currentGroup));
public static List<SimpleGroup> getAllGroups(SimpleGroup group)
{
List<SimpleGroup> returnList = new ArrayList<>(group.getGroups());
for (SimpleGroup currentGroup : group.getGroups())
{
returnList.addAll(getAllGroups(currentGroup));
}

return returnList;
}

Expand Down

0 comments on commit f0d599b

Please sign in to comment.