Skip to content

Commit

Permalink
Merge pull request #55 from italiangrid/develop
Browse files Browse the repository at this point in the history
Merge 3.7.0 changes into master
  • Loading branch information
andreaceccanti authored Aug 31, 2017
2 parents a214126 + 9d7ccda commit 7c87557
Show file tree
Hide file tree
Showing 66 changed files with 2,095 additions and 310 deletions.
37 changes: 37 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
pipeline {
agent { label 'maven' }
parameters {
booleanParam(name: 'BUILD_DOCKER_IMAGES', defaultValue: false,
description: 'Triggers the building of docker images required for development')
}
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '5'))
}

stages{

stage('build') {
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 }
}
steps {
sh '''
pushd docker/voms-admin-server
sh build-image.sh && sh push-image.sh
popd
push docker/voms/centos6
sh build-image.sh && sh push-image.sh
popd'''
}
}
}
}
13 changes: 9 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ services:
- ~/yourkit:/yourkit:ro
- ~/git/voms-admin-server/docker/voms-admin-server/setup:/scripts:ro
- ~/git/orgdb-fake-users/:/orgdb-fake-users:ro
- ~/orgdb:/orgdb:ro
- ~/git/voms-migrate:/migrate:ro
# - ~/orgdb:/orgdb:ro

ports:
# 20001 is the default yourkit port
# - "20001:20001"
Expand All @@ -59,7 +61,7 @@ services:

# This is the VOMS Admin configuration
#
VOMS_VO_COUNT: 0 # 0 creates 1 VO, 1 two VOs, ...
VOMS_VO_COUNT: 1 # 0 creates 1 VO, 1 two VOs, ...
VOMS_HOSTNAME: dev.local.io
MAILHOST: mail
MYSQL_ROOT_PASSWORD: pwd
Expand All @@ -71,13 +73,13 @@ services:
VOMS_DEPLOY_TARBALL: y

# VOMS_ADMIN_SERVER_PACKAGE_URL: http://ci-01.cnaf.infn.it/download/voms/versions/jenkins-release_voms_packages-13/sl6/x86_64/voms-admin-server-3.5.1-1.el6.centos.noarch.rpm
VOMS_ADMIN_SERVER_VERSION: 3.3.3
# VOMS_ADMIN_SERVER_VERSION: 3.3.3
# VOMS_DEBUG_SUSPEND: y
VOMS_PRE_CONFIGURE: y
# VOMS_SKIP_CONFIGURE: y
VOMS_UPGRADE_DB: y

VOMS_LOAD_DB_DUMP: y
# VOMS_LOAD_DB_DUMP: y
VOMS_DEV_MODE: y

VOMS_CONFIGURE_OPTIONS: --skip-ca-check --admin-skip-ca-check
Expand All @@ -88,6 +90,9 @@ services:
# ENABLE_JMX: y
# HIBERNATE_LOG_LEVEL: DEBUG
# STRUTS_LOG_LEVEL: DEBUG

extra_hosts:
- "voms.local.io:192.168.99.101"

voms:
image: italiangrid/voms-dev:centos6
Expand Down
4 changes: 3 additions & 1 deletion docker/voms-admin-server/build-image.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

docker build --no-cache=true -t italiangrid/voms-admin-server .
VOMS_ADMIN_SERVER_IMAGE=${VOMS_ADMIN_SERVER_IMAGE:-"italiangrid/voms-admin-server"}

docker build --no-cache=true -t ${VOMS_ADMIN_SERVER_IMAGE} .
15 changes: 15 additions & 0 deletions docker/voms-admin-server/push-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -ex

VOMS_ADMIN_SERVER_IMAGE=${VOMS_ADMIN_SERVER_IMAGE:-"italiangrid/voms-admin-server"}

# The current script directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${DIR}

if [ -n ${DOCKER_REGISTRY_HOST} ]; then
docker tag ${VOMS_ADMIN_SERVER_IMAGE} ${DOCKER_REGISTRY_HOST}/${VOMS_ADMIN_SERVER_IMAGE}
docker push ${DOCKER_REGISTRY_HOST}/${VOMS_ADMIN_SERVER_IMAGE}
else
docker push ${VOMS_ADMIN_SERVER_IMAGE}
fi
3 changes: 2 additions & 1 deletion docker/voms/centos6/build-image.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash

docker build -t italiangrid/voms-dev:centos6 .
VOMS_IMAGE=${VOMS_IMAGE:-"italiangrid/voms-dev:centos6"}
docker build -t ${VOMS_IMAGE} .
15 changes: 15 additions & 0 deletions docker/voms/centos6/push-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -ex

VOMS_IMAGE=${VOMS_IMAGE:-"italiangrid/voms-dev:centos6"}

# The current script directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${DIR}

if [ -n ${DOCKER_REGISTRY_HOST} ]; then
docker tag ${VOMS_IMAGE} ${DOCKER_REGISTRY_HOST}/${VOMS_IMAGE}
docker push ${DOCKER_REGISTRY_HOST}/${VOMS_IMAGE}
else
docker push ${VOMS_IMAGE}
fi
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.italiangrid</groupId>
<artifactId>voms-admin-parent</artifactId>

<version>3.6.0</version>
<version>3.7.0</version>

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

<artifactId>voms-admin-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion voms-admin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.italiangrid</groupId>
<artifactId>voms-admin-parent</artifactId>
<version>3.6.0</version>
<version>3.7.0</version>
</parent>

<artifactId>voms-admin-server</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

VOMS_ADMIN_JAR=${VOMS_ADMIN_JAR:-/usr/share/java/voms-admin.jar}

java -cp ${VOMS_ADMIN_JAR}':/var/lib/voms-admin/lib/*:/var/lib/voms-admin/tools' \
org.glite.security.voms.admin.util.migration.MigrateVo $@
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ def setup_cl_options():
help="Skips the check on the certificate issuer when authenticating VOMS Admin clients",
default=False)



admin_opt_group.add_option("--disable-permission-cache",
dest="permission_cache_disable",
action="store_true",
help="Disables permission cache for the configured VO",
default="False")

parser.add_option_group(admin_opt_group)

Expand Down
3 changes: 3 additions & 0 deletions voms-admin-server/resources/templates/service.properties
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,7 @@ voms.csrf.log_only = $csrf_log_only
## Skip CA checks when authenticating clients
voms.skip_ca_check = $admin_skip_ca_check

## Disable permission cache
voms.permission_cache.disable = $permission_cache_disable

#### Add other options after this line
7 changes: 7 additions & 0 deletions voms-admin-server/src/assemble/tarball.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@
<destName>voms-audit-log-util</destName>
<fileMode>0755</fileMode>
</file>

<file>
<source>resources/scripts/configure/voms-migrate-vo-util</source>
<outputDirectory>/usr/sbin</outputDirectory>
<destName>voms-migrate-vo-util</destName>
<fileMode>0755</fileMode>
</file>

<file>
<source>resources/scripts/configure/voms_shared.py</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class AUPAcceptanceRecordJSON {
String aupVersion;
Date lastAcceptanceDate;
long daysBeforeExpiration;
boolean valid;

public AUPAcceptanceRecordJSON() {

Expand Down Expand Up @@ -59,11 +60,22 @@ public void setDaysBeforeExpiration(long daysBeforeExpiration) {
this.daysBeforeExpiration = daysBeforeExpiration;
}


public boolean isValid() {
return valid;
}

public void setValid(boolean valid) {
this.valid = valid;
}

public static AUPAcceptanceRecordJSON from(AUPAcceptanceRecord rec) {

AUPAcceptanceRecordJSON r = new AUPAcceptanceRecordJSON();

r.setAupVersion(rec.getAupVersion().getVersion());
r.setValid(rec.getValid());

if (rec.getDaysBeforeExpiration() < 0){
r.setDaysBeforeExpiration(0);
}else{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* Copyright (c) Istituto Nazionale di Fisica Nucleare (INFN). 2006-2016
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.glite.security.voms.admin.apiv2;

import java.util.Date;

import org.glite.security.voms.admin.persistence.model.AUPVersion;

public class AUPVersionJSON {

String version;

String url;

String text;

Date creationTime;

Date lastForcedReacceptanceTime;

Boolean active;

public String getVersion() {
return version;
}

public void setVersion(String version) {
this.version = version;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public String getText() {
return text;
}

public void setText(String text) {
this.text = text;
}

public Date getCreationTime() {
return creationTime;
}

public void setCreationTime(Date creationTime) {
this.creationTime = creationTime;
}

public Date getLastForcedReacceptanceTime() {
return lastForcedReacceptanceTime;
}

public void setLastForcedReacceptanceTime(Date lastForcedReacceptanceTime) {
this.lastForcedReacceptanceTime = lastForcedReacceptanceTime;
}

public Boolean getActive() {
return active;
}

public void setActive(Boolean active) {
this.active = active;
}

public static AUPVersionJSON fromAUPVersion(AUPVersion v){
AUPVersionJSON aupVersion = new AUPVersionJSON();
aupVersion.setActive(v.getActive());
aupVersion.setCreationTime(v.getCreationTime());
aupVersion.setLastForcedReacceptanceTime(v.getLastForcedReacceptanceTime());
aupVersion.setText(v.getText());
aupVersion.setUrl(v.getUrl());
aupVersion.setVersion(v.getVersion());

return aupVersion;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.glite.security.voms.admin.apiv2;

import java.util.Date;

import org.glite.security.voms.admin.persistence.model.Certificate;

public class CertificateJSON {
Expand All @@ -25,6 +27,8 @@ public class CertificateJSON {
Boolean suspended;
String suspensionReason;

Date creationTime;

public Boolean getSuspended() {

return suspended;
Expand Down Expand Up @@ -65,13 +69,23 @@ public void setIssuerString(String issuerString) {
this.issuerString = issuerString;
}


public Date getCreationTime() {
return creationTime;
}

public void setCreationTime(Date creationTime) {
this.creationTime = creationTime;
}

public static CertificateJSON fromCertificate(Certificate cert) {

CertificateJSON c = new CertificateJSON();
c.setSubjectString(cert.getSubjectString());
c.setIssuerString(cert.getCa().getSubjectString());
c.setSuspended(cert.isSuspended());
c.setSuspensionReason(cert.getSuspensionReason());
c.setCreationTime(cert.getCreationTime());

return c;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static VOMSUserJSON serialize(VOMSUser user) {
json.fqansFrom(user);
json.attributesFrom(user);
json.personalInformationFrom(user);
json.cernHrIdFrom(user);

} else {

Expand All @@ -62,6 +63,7 @@ public static VOMSUserJSON serialize(VOMSUser user) {

if (admin.hasPermissions(VOMSContext.getVoContext(), PI_READ_PERMISSIONS)) {
json.personalInformationFrom(user);
json.cernHrIdFrom(user);
}

}
Expand Down
Loading

0 comments on commit 7c87557

Please sign in to comment.