Skip to content

Commit

Permalink
Merge branch '0.75-SNAPSHOT'
Browse files Browse the repository at this point in the history
Change-Id: I82145593b8e3c6d054f1c5034134ea17fc696f14
  • Loading branch information
margaretha committed Sep 24, 2024
2 parents dd57337 + 3fc1db7 commit d65eaa6
Show file tree
Hide file tree
Showing 94 changed files with 3,095 additions and 4,299 deletions.
23 changes: 23 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# version 0.75-SNAPSHOT

- Alter role and remove privilege database tables (#763)
- Update user-group and user-group member web-services (#763)
- Remove edit member role web-service (#763)
- Remove query access table (#763)
- Remove query access admin, merged with user-group admin (#763)
- Update share-query and query-access web-services (#763)
- Add new web-service: delete role by query and group (#763)
- Remove soft delete group and group status deleted (#765)
- Remove soft delete group member and member status deleted (#765)
- Removed SearchResourceFilters and UserGroupJson
- Removed deleted_by from user_group and user_group_member tables (#764)
- Removed created_by, status and status_date from user_group_member table (#764)
- Removed GroupMemberStatus (#764)
- Replace invite and subscribe to add member (#764)
- Remove unsubscribe member (#764)
- Added deprecation messages to deprecated services
- Removed mail configuration (#764)
- Deprecate VC access deletion.
- Change default port to 8089.
- Disallow scope all for non super clients.

# version 0.74.1-SNAPSHOT

- Switch Docker image to temurin (diewald).
Expand Down
40 changes: 1 addition & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.ids-mannheim.korap.kustvakt</groupId>
<artifactId>Kustvakt</artifactId>
<version>0.74.1-SNAPSHOT</version>
<version>0.75-SNAPSHOT</version>
<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -139,8 +139,6 @@
<exclude>com.novell.ldap</exclude>
<exclude>com.unboundid</exclude>
<exclude>org.glassfish.jersey.test-framework*</exclude>
<exclude>org.apache.velocity*</exclude>
<exclude>com.sun.mail</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
Expand Down Expand Up @@ -417,11 +415,6 @@
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
Expand Down Expand Up @@ -620,37 +613,6 @@
<version>6.0.11</version>
</dependency>

<!-- velocity -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.apache.velocity.tools</groupId>
<artifactId>velocity-tools-generic</artifactId>
<version>3.1</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Mail -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>2.0.1</version>
</dependency>

<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<version>2.1.2</version>
</dependency>

<!-- OAuth -->
<dependency>
<groupId>com.nimbusds</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,4 @@ public String providerList () {
return "provider list: " + this.providers.toString();
}

public abstract User getUser (String username, String method)
throws KustvaktException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,4 @@ public void setAccessAndLocation (User user, HttpHeaders headers) {
// TODO Auto-generated method stub

}

@Override
public User getUser (String username, String method)
throws KustvaktException {
// TODO Auto-generated method stub
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,6 @@ public User getUser (String username) throws KustvaktException {
// return entHandler.getAccount(username);
}

@Override
public User getUser (String username, String method)
throws KustvaktException {
KorAPUser user = new KorAPUser();
user.setUsername(username);
String email = null;
switch (method.toLowerCase()) {
case "ldap":
email = config.getTestEmail();
break;
default:
email = config.getTestEmail();
break;
}
user.setEmail(email);
return user;
}

public TokenContext refresh (TokenContext context)
throws KustvaktException {
AuthenticationIface provider = getProvider(context.getTokenType(),
Expand Down Expand Up @@ -315,6 +297,7 @@ private User authenticateShib (Map<String, Object> attributes)
return user;
}

@Deprecated
// todo: what if attributes null?
private User authenticate (String username, String password,
Map<String, Object> attr) throws KustvaktException {
Expand Down
105 changes: 0 additions & 105 deletions src/main/java/de/ids_mannheim/korap/config/FullConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@

public class FullConfiguration extends KustvaktConfiguration {
public static Logger jlog = LogManager.getLogger(FullConfiguration.class);
// mail configuration
private boolean isMailEnabled;
private String testEmail;
private String noReply;
private String emailAddressRetrieval;

private String groupInvitationTemplate;

private String ldapConfig;

Expand All @@ -47,10 +40,6 @@ public class FullConfiguration extends KustvaktConfiguration {

private String authenticationScheme;

private boolean isSoftDeleteAutoGroup;
private boolean isSoftDeleteGroup;
private boolean isSoftDeleteGroupMember;

private EncryptionIface.Encryption secureHashAlgorithm;

private AuthenticationMethod OAuth2passwordAuthentication;
Expand Down Expand Up @@ -89,8 +78,6 @@ public void load (Properties properties) throws Exception {

// EM: pattern for matching availability in Krill matches
setLicensePatterns(properties);
setDeleteConfiguration(properties);
setMailConfiguration(properties);
ldapConfig = properties.getProperty("ldap.config");

setSecurityConfiguration(properties);
Expand Down Expand Up @@ -154,34 +141,6 @@ private void setOAuth2Configuration (Properties properties) {
.getProperty("oauth2.refresh.token.long.expiry", "365D")));
}

private void setMailConfiguration (Properties properties) {
setMailEnabled(Boolean
.valueOf(properties.getProperty("mail.enabled", "false")));
if (isMailEnabled) {
// other properties must be set in the kustvakt.conf
setTestEmail(
properties.getProperty("mail.receiver", "test@localhost"));
setNoReply(properties.getProperty("mail.sender"));
setGroupInvitationTemplate(
properties.getProperty("template.group.invitation"));
setEmailAddressRetrieval(
properties.getProperty("mail.address.retrieval", "test"));
}
}

private void setDeleteConfiguration (Properties properties) {
setSoftDeleteGroup(
parseDeleteConfig(properties.getProperty("delete.group", "")));
setSoftDeleteAutoGroup(parseDeleteConfig(
properties.getProperty("delete.auto.group", "")));
setSoftDeleteGroupMember(parseDeleteConfig(
properties.getProperty("delete.group.member", "")));
}

private boolean parseDeleteConfig (String deleteConfig) {
return deleteConfig.equals("soft") ? true : false;
}

private void setLicensePatterns (Properties properties) {
setFreeLicensePattern(compilePattern(getFreeOnlyRegex()));
setPublicLicensePattern(compilePattern(
Expand Down Expand Up @@ -311,70 +270,6 @@ public void setAllOnlyRegex (String allOnlyRegex) {
this.allOnlyRegex = allOnlyRegex;
}

public boolean isSoftDeleteGroup () {
return isSoftDeleteGroup;
}

public void setSoftDeleteGroup (boolean isSoftDeleteGroup) {
this.isSoftDeleteGroup = isSoftDeleteGroup;
}

public boolean isSoftDeleteGroupMember () {
return isSoftDeleteGroupMember;
}

public void setSoftDeleteGroupMember (boolean isSoftDeleteGroupMember) {
this.isSoftDeleteGroupMember = isSoftDeleteGroupMember;
}

public boolean isSoftDeleteAutoGroup () {
return isSoftDeleteAutoGroup;
}

public void setSoftDeleteAutoGroup (boolean isSoftDeleteAutoGroup) {
this.isSoftDeleteAutoGroup = isSoftDeleteAutoGroup;
}

public String getTestEmail () {
return testEmail;
}

public void setTestEmail (String testEmail) {
this.testEmail = testEmail;
}

public boolean isMailEnabled () {
return isMailEnabled;
}

public void setMailEnabled (boolean isMailEnabled) {
this.isMailEnabled = isMailEnabled;
}

public String getNoReply () {
return noReply;
}

public void setNoReply (String noReply) {
this.noReply = noReply;
}

public String getGroupInvitationTemplate () {
return groupInvitationTemplate;
}

public void setGroupInvitationTemplate (String groupInvitationTemplate) {
this.groupInvitationTemplate = groupInvitationTemplate;
}

public String getEmailAddressRetrieval () {
return emailAddressRetrieval;
}

public void setEmailAddressRetrieval (String emailAddressRetrieval) {
this.emailAddressRetrieval = emailAddressRetrieval;
}

public EncryptionIface.Encryption getSecureHashAlgorithm () {
return secureHashAlgorithm;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public class KustvaktConfiguration {
private int returnhits;
private String keystoreLocation;
private String keystorePassword;
private Properties mailProperties;
private String host;
private String shibUserMapping;
private String userConfig;
Expand All @@ -71,10 +70,6 @@ public class KustvaktConfiguration {
private long loginAttemptNum;
private boolean allowMultiLogIn;
private int loadFactor;
@Deprecated
private int validationStringLength;
@Deprecated
private int validationEmaillength;

// EM: determine if search and match info services restricted
// to logged in users. This replaces @SearchResourceFilters
Expand Down Expand Up @@ -134,7 +129,7 @@ public KustvaktConfiguration (Properties properties) throws Exception {
public KustvaktConfiguration () {}

public void loadBasicProperties (Properties properties) {
port = Integer.valueOf(properties.getProperty("server.port", "8095"));
port = Integer.valueOf(properties.getProperty("server.port", "8089"));
baseURL = properties.getProperty("kustvakt.base.url", "/api/*");
setSecureRandomAlgorithm(
properties.getProperty("security.secure.random.algorithm", ""));
Expand Down Expand Up @@ -212,10 +207,6 @@ protected void load (Properties properties) throws Exception {

loadFactor = Integer.valueOf(
properties.getProperty("security.encryption.loadFactor", "15"));
validationStringLength = Integer.valueOf(properties
.getProperty("security.validation.stringLength", "150"));
validationEmaillength = Integer.valueOf(properties
.getProperty("security.validation.emailLength", "40"));

sharedSecret = properties.getProperty("security.sharedSecret", "")
.getBytes();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public enum OAuth2Scope {

DELETE_USER_GROUP_MEMBER, ADD_USER_GROUP_MEMBER,

EDIT_USER_GROUP_MEMBER_ROLE, ADD_USER_GROUP_MEMBER_ROLE, DELETE_USER_GROUP_MEMBER_ROLE,
ADD_USER_GROUP_MEMBER_ROLE, DELETE_USER_GROUP_MEMBER_ROLE,

CREATE_VC, VC_INFO, EDIT_VC, DELETE_VC,

Expand Down
Loading

0 comments on commit d65eaa6

Please sign in to comment.