Skip to content

Commit

Permalink
Merge pull request #75 from italiangrid/upgrade-struts
Browse files Browse the repository at this point in the history
VOMS Admin v3.9.0 release
enricovianello authored Jun 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 26fdc5f + 434b98c commit 5602fab
Showing 16 changed files with 13 additions and 422 deletions.
11 changes: 3 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -3,14 +3,7 @@ def kubeLabel = getKubeLabel()

pipeline {

agent {
kubernetes {
label "${kubeLabel}"
cloud 'Kube mwdevel'
defaultContainer 'runner'
inheritFrom 'ci-template'
}
}
agent none

parameters {
booleanParam(name: 'BUILD_DOCKER_IMAGES', defaultValue: false,
@@ -27,13 +20,15 @@ pipeline {
stages{

stage('build') {
agent { label 'java11' }
steps {
git(url: 'https://github.com/italiangrid/voms-admin-server.git', branch: env.BRANCH_NAME)
sh 'mvn -B -U -P prod,EMI clean package'
}
}

stage('build-docker-images') {
agent { label 'docker' }
when {
expression { return params.BUILD_DOCKER_IMAGES }
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
<artifactId>voms-admin-parent</artifactId>


<version>3.8.1</version>
<version>3.9.0</version>

<packaging>pom</packaging>
<name>VOMS Admin Parent POM</name>
2 changes: 1 addition & 1 deletion voms-admin-api/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.italiangrid</groupId>
<artifactId>voms-admin-parent</artifactId>
<version>3.8.1</version>
<version>3.9.0</version>
</parent>

<artifactId>voms-admin-api</artifactId>
6 changes: 3 additions & 3 deletions voms-admin-server/pom.xml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
<parent>
<groupId>org.italiangrid</groupId>
<artifactId>voms-admin-parent</artifactId>
<version>3.8.1</version>
<version>3.9.0</version>
</parent>

<artifactId>voms-admin-server</artifactId>
@@ -38,7 +38,7 @@
<api.version>${project.version}</api.version>
<interface-version>2.0.2</interface-version>

<struts.version>2.5.26</struts.version>
<struts.version>2.5.33</struts.version>
<struts.bootstrap.plugin.version>2.5.2</struts.bootstrap.plugin.version>
<struts.jquery.plugin.version>4.0.3</struts.jquery.plugin.version>
<hibernate.version>5.2.17.Final</hibernate.version>
@@ -316,7 +316,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>1.1</version>
<version>1.5</version>
</dependency>

<dependency>
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@
*/
package org.glite.security.voms.admin.configuration;

import static org.glite.security.voms.admin.configuration.VOMSConfigurationConstants.PERMISSION_CACHE_DISABLE;
import static org.glite.security.voms.admin.configuration.VOMSConfigurationConstants.PI_REQUIRED_FIELDS;
import static org.glite.security.voms.admin.util.SysconfigUtil.SYSCONFIG_CONF_DIR;
import static org.glite.security.voms.admin.util.SysconfigUtil.SYSCONFIG_DEFAULT_FILE_PATH;
@@ -1039,10 +1038,6 @@ public PEMCredential getServiceCredential() {
return serviceCredential;
}

public boolean permissionCacheDisabled() {
return config.getBoolean(PERMISSION_CACHE_DISABLE, false);
}

public Set<String> getRequiredPersonalInfoFields() {
String requiredFields =
config.getString(PI_REQUIRED_FIELDS, VOMSConfigurationConstants.PI_REQUIRED_FIELDS_DEFAULT);
Original file line number Diff line number Diff line change
@@ -197,11 +197,6 @@ public interface VOMSConfigurationConstants {
*/
public static final String SKIP_CA_CHECK = "voms.skip_ca_check";

/**
* Should permission cache be disabled?
*/
public static final String PERMISSION_CACHE_DISABLE = "voms.permission_cache.disable";

/**
* comma-separated list of the personal information fields required at registration
*/
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@
import org.glite.security.voms.admin.configuration.VOMSConfigurationException;
import org.glite.security.voms.admin.core.tasks.CancelSignAUPTasksForExpiredUsersTask;
import org.glite.security.voms.admin.core.tasks.ExpiredRequestsPurgerTask;
import org.glite.security.voms.admin.core.tasks.PermissionCacheStatsLogger;
import org.glite.security.voms.admin.core.tasks.PrintX509AAStatsTask;
import org.glite.security.voms.admin.core.tasks.SignAUPReminderCheckTask;
import org.glite.security.voms.admin.core.tasks.SystemTimeProvider;
@@ -52,9 +51,6 @@
import org.glite.security.voms.admin.event.DebugEventLogListener;
import org.glite.security.voms.admin.event.EventManager;
import org.glite.security.voms.admin.event.auditing.AuditLog;
import org.glite.security.voms.admin.event.permission_cache.AclEventsCleanPermissionCacheListener;
import org.glite.security.voms.admin.event.permission_cache.MembershipEventsCleanPermissionCacheListener;
import org.glite.security.voms.admin.event.permission_cache.UserEventsCleanPermissionCacheListener;
import org.glite.security.voms.admin.integration.PluginManager;
import org.glite.security.voms.admin.integration.cern.HrDbConfigurator;
import org.glite.security.voms.admin.integration.orgdb.OrgDBConfigurator;
@@ -169,9 +165,6 @@ protected static void configureEventManager() {
manager.register(CertificateRequestsNotificationDispatcher.instance());
manager.register(MembershipRemovalNotificationDispatcher.instance());
manager.register(SignAUPReminderDispatcher.instance());
manager.register(AclEventsCleanPermissionCacheListener.instance());
manager.register(UserEventsCleanPermissionCacheListener.instance());
manager.register(MembershipEventsCleanPermissionCacheListener.instance());

}

@@ -212,8 +205,6 @@ protected static void startBackgroundTasks() {
VOMSConfigurationConstants.MONITORING_USER_STATS_UPDATE_PERIOD,
UserStatsTask.DEFAULT_PERIOD_IN_SECONDS);

es.scheduleAtFixedRate(new PermissionCacheStatsLogger(true), 1, 60, TimeUnit.SECONDS);

int expiredUserCleanupBatchSize =
conf.getInt(VOMSConfigurationConstants.EXPIRED_USER_CLEANUP_TASK_BATCH_SIZE, 10);

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -18,12 +18,9 @@
import java.security.cert.X509Certificate;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.glite.security.voms.admin.configuration.VOMSConfiguration;
import org.glite.security.voms.admin.operations.util.CurrentAdminPermissionCache;
import org.glite.security.voms.admin.persistence.dao.VOMSAdminDAO;
import org.glite.security.voms.admin.persistence.dao.VOMSRoleDAO;
import org.glite.security.voms.admin.persistence.dao.VOMSUserDAO;
@@ -48,16 +45,14 @@ public class CurrentAdmin {
private static ThreadLocal<CurrentAdmin> currentAdmin = new ThreadLocal<>();

private final VOMSAdmin admin;
private final boolean permissionCacheDisabled;

public VOMSAdmin getAdmin() {

return admin;
}

protected CurrentAdmin(VOMSAdmin a, boolean permissionCacheDisabled) {
protected CurrentAdmin(VOMSAdmin a) {
this.admin = a;
this.permissionCacheDisabled = permissionCacheDisabled;
}

private static VOMSAdmin lookupAdmin() {
@@ -79,9 +74,8 @@ public static CurrentAdmin instance() {
if (admin == null) {
admin = VOMSAdminDAO.instance().getAnyAuthenticatedUserAdmin();
}

VOMSConfiguration configuration = VOMSConfiguration.instance();
currentAdmin.set(new CurrentAdmin(admin, configuration.permissionCacheDisabled()));

currentAdmin.set(new CurrentAdmin(admin));
return currentAdmin.get();

}
@@ -313,20 +307,7 @@ public boolean checkPermission(VOMSContext c, VOMSPermission p) {

public boolean hasPermissions(VOMSContext c, VOMSPermission p) {

boolean result = false;

if (permissionCacheDisabled){
return checkPermission(c, p);
}

try {
result = CurrentAdminPermissionCache.INSTANCE.hasPermission(this, c, p);
} catch (ExecutionException e) {
log.error("Error loading permission check result from cache: " + e.getMessage(), e);
result = checkPermission(c, p);
}

return result;
return checkPermission(c, p);
}

public String getRealSubject() {

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion voms-container/pom.xml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
<parent>
<groupId>org.italiangrid</groupId>
<artifactId>voms-admin-parent</artifactId>
<version>3.8.1</version>
<version>3.9.0</version>
</parent>

<artifactId>voms-container</artifactId>

0 comments on commit 5602fab

Please sign in to comment.