Skip to content

Commit

Permalink
Merge pull request #51 from Bernardo-MG/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Bernardo-MG authored Oct 15, 2017
2 parents f881043 + a32a8ec commit 54b19d4
Show file tree
Hide file tree
Showing 192 changed files with 1,535 additions and 1,248 deletions.
15 changes: 4 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,20 @@
# @link https://travis-ci.org/

# Using Java for the project
sudo: required
dist: precise
language: java
jdk:
# JDK 8 is not supported
# - oraclejdk8
# JDK 7 is set to deploy the docs in the configuration matrix
# - oraclejdk7
- openjdk7
env:
- SERVER=jetty
- SERVER=tomcat7
matrix:
include:
# Documentation deployed with JDK7
# Documentation deployed with Open JDK7
- jdk: oraclejdk7
env: SERVER=jetty DEPLOY_DOCS=true
- jdk: oraclejdk7
env: SERVER=tomcat7

before_install:
# Gets scripts
- git clone -b v0.4.1 --single-branch https://github.com/Bernardo-MG/ci-shell-scripts.git ~/.scripts
- git clone -b v1.0.0 --single-branch https://github.com/Bernardo-MG/ci-shell-scripts.git ~/.scripts
# Sets scripts as executable
- chmod -R +x ~/.scripts/*
# Prepares CI environment
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Bernardo Martínez Garrido
Copyright (c) 2015-2017 Bernardo Martínez Garrido

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
57 changes: 36 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>com.wandrell.maven</groupId>
<artifactId>base-pom</artifactId>
<version>1.1.3</version>
<version>1.1.6</version>
</parent>

<!-- ********************************************** -->
Expand All @@ -24,7 +24,7 @@

<groupId>com.wandrell.example</groupId>
<artifactId>swss-soap-example</artifactId>
<version>1.2.5</version>
<version>1.2.6</version>
<packaging>war</packaging>

<name>Spring Web Services WS-Security Example</name>
Expand Down Expand Up @@ -145,7 +145,7 @@
<profile>
<!-- Release site deployment profile -->
<!-- Sets the site repository to point to the releases repo -->
<id>deploy-site-release</id>
<id>deployment-release</id>
<activation>
<!-- Active by default so the repository appears in the reports -->
<activeByDefault>true</activeByDefault>
Expand All @@ -161,7 +161,7 @@
<profile>
<!-- Development site deployment profile -->
<!-- Sets the site repository to point to the development repo -->
<id>deploy-site-development</id>
<id>deployment-development</id>
<distributionManagement>
<site>
<id>site-development</id>
Expand Down Expand Up @@ -302,47 +302,48 @@
<ant.version>1.9.7</ant.version>
<commons.codec.version>1.10</commons.codec.version>
<commons.logging.version>1.2</commons.logging.version>
<ehcache.version>2.10.3</ehcache.version>
<ehcache.version>2.10.4</ehcache.version>
<freemarker.version>2.3.23</freemarker.version>
<guava.version>20.0</guava.version>
<h2.version>1.4.193</h2.version>
<h2.version>1.4.196</h2.version>
<hibernate.jpa.version>1.0.0.Final</hibernate.jpa.version>
<hibernate.version>5.1.3.Final</hibernate.version>
<hikari.version>2.4.7</hikari.version>
<testng.version>6.9.10</testng.version>
<javax.activation.version>1.1.1</javax.activation.version>
<javax.stax.api.version>1.0-2</javax.stax.api.version>
<jaxb.api.version>2.2.12</jaxb.api.version>
<jaxb.version>2.2.11</jaxb.version>
<joda.time.version>2.9.7</joda.time.version>
<log4j.version>2.7</log4j.version>
<jaxb.version>2.3.0</jaxb.version>
<joda.time.version>2.9.9</joda.time.version>
<junit.version>4.12</junit.version>
<liquibase.version>3.5.3</liquibase.version>
<log4j.version>2.9.1</log4j.version>
<mockito.version>1.10.19</mockito.version>
<saaj.api.version>1.3.5</saaj.api.version>
<saaj.impl.version>1.3.25</saaj.impl.version>
<slf4j.version>1.7.22</slf4j.version>
<slf4j.version>1.7.25</slf4j.version>
<spring.data.version>1.10.6.RELEASE</spring.data.version>
<spring.version>4.3.5.RELEASE</spring.version>
<spring.security.version>4.2.1.RELEASE</spring.security.version>
<spring.ws.version>2.4.0.RELEASE</spring.ws.version>
<stax.api.version>1.0.1</stax.api.version>
<stax.impl.version>1.2.0</stax.impl.version>
<testng.version>6.10</testng.version>
<wsdl4j.version>1.6.3</wsdl4j.version>
<wss4j.version>2.1.8</wss4j.version>
<xmlapis.version>2.0.2</xmlapis.version>
<xmlsec.version>2.0.8</xmlsec.version>
<xwssecurity.version>3.0</xwssecurity.version>
<!-- Plugins versions -->
<plugin.buildhelp.version>3.0.0</plugin.buildhelp.version>
<plugin.jaxb2.version>0.13.1</plugin.jaxb2.version>
<plugin.jaxb2.version>0.13.2</plugin.jaxb2.version>
<plugin.jetty.version>9.1.6.v20160112</plugin.jetty.version>
<plugin.tomcat7.version>2.2</plugin.tomcat7.version>
<plugin.war.version>3.0.0</plugin.war.version>
<plugin.war.version>3.2.0</plugin.war.version>
<!-- Spring is using the Repeatable annotation, which breaks the Javadoc
generation with an error -->
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
<!-- Maven Site -->
<site.skin.version>0.6.0</site.skin.version>
<site.skin.version>1.0.0</site.skin.version>
<!-- Testing server -->
<server.test.path>/swss</server.test.path>
</properties>
Expand Down Expand Up @@ -424,6 +425,12 @@
<artifactId>HikariCP</artifactId>
<version>${hikari.version}</version>
</dependency>
<dependency>
<!-- Liquibase -->
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>${liquibase.version}</version>
</dependency>
<!-- ============================================== -->
<!-- ================ HIBERNATE =================== -->
<!-- ============================================== -->
Expand Down Expand Up @@ -591,6 +598,13 @@
<version>${freemarker.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Junit -->
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Mockito -->
<groupId>org.mockito</groupId>
Expand Down Expand Up @@ -625,13 +639,6 @@
<version>${stax.impl.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- TestNG -->
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<!-- ********************************************** -->
Expand Down Expand Up @@ -803,6 +810,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<links>
<link>http://docs.oracle.com/javaee/7/api/</link>
<link>http://docs.spring.io/spring-data/commons/docs/current/api/</link>
<link>http://docs.spring.io/spring-data/jpa/docs/current/api/</link>
<link>http://docs.spring.io/spring-data/commons/docs/current/api/</link>
<link>http://docs.spring.io/spring-framework/docs/current/javadoc-api/</link>
<link>http://docs.spring.io/spring-ws/site/apidocs/</link>
</links>
<!-- Excludes generated code -->
<excludePackageNames>*.generated.*</excludePackageNames>
</configuration>
Expand Down
1 change: 0 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ The application is coded in Java, using Maven to manage the project.

The project has been tested on the following Java versions:
* JDK 7
* OpenJDK 7

All other dependencies are handled through Maven, and noted in the included POM file. This includes the plugins used for running the example in an embedded web server.

Expand Down
20 changes: 20 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,25 @@
Updated base POM and project configuration.
</action>
</release>
<release version="1.2.6" date="2017-04-24" description="Updated configuration">
<action dev="bmg" type="add">
Using persisted authentication data.
</action>
<action dev="bmg" type="add">
Using JUnit for the tests instead of TestNG.
</action>
<action dev="bmg" type="fix">
Corrections to tests.
</action>
<action dev="bmg" type="fix">
Corrections to logger templates.
</action>
<action dev="bmg" type="update">
Linked Javadocs to the dependencies Javadocs.
</action>
<action dev="bmg" type="update">
Updated base POM and project configuration.
</action>
</release>
</body>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
/**
* The MIT License (MIT)
* <p>
* Copyright (c) 2015-2017 the original author or authors.
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package com.wandrell.example.swss.auth.model;

import java.util.Collection;
import java.util.Objects;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.springframework.security.core.GrantedAuthority;

import com.google.common.base.MoreObjects;

/**
* Persistent implementation of {@code GrantedAuthority}.
*
* @author Bernardo Mart&iacute;nez Garrido
*
*/
@Entity(name = "GrantedAuthority")
@Table(name = "authorities")
public class PersistentGrantedAuthority implements GrantedAuthority {

/**
* Serialization id.
*/
private static final long serialVersionUID = 8513041662486312372L;

/**
* Authority name.
*/
@Column(name = "authority", nullable = false, unique = true)
private String authority;

/**
* Entity id.
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false, unique = true)
private Long id;

/**
* Users with the authority.
*/
@ManyToMany(mappedBy = "authorities")
private Collection<PersistentUserDetails> users;

/**
* Default constructor.
*/
public PersistentGrantedAuthority() {
super();
}

@Override
public final boolean equals(final Object obj) {
if (this == obj) {
return true;
}

if (obj == null) {
return false;
}

if (getClass() != obj.getClass()) {
return false;
}

final PersistentGrantedAuthority other = (PersistentGrantedAuthority) obj;
return Objects.equals(authority, other.authority);
}

@Override
public String getAuthority() {
return authority;
}

/**
* Returns the user id.
*
* @return the user id
*/
public Long getId() {
return id;
}

/**
* Returns the users with the authority.
*
* @return the users with the authority
*/
public Collection<PersistentUserDetails> getUsers() {
return users;
}

@Override
public final int hashCode() {
return Objects.hash(authority);
}

/**
* Sets the authority name.
*
* @param auth
* new authority
*/
public void setAuthority(final String auth) {
authority = auth;
}

/**
* Sets the user id.
*
* @param identifier
* the new id
*/
public void setId(final Long identifier) {
id = identifier;
}

/**
* Sets the users with the authority.
*
* @param users
* the users with the authority
*/
public void setUsers(final Collection<PersistentUserDetails> users) {
this.users = users;
}

@Override
public final String toString() {
return MoreObjects.toStringHelper(this).add("authority", authority)
.toString();
}

}
Loading

0 comments on commit 54b19d4

Please sign in to comment.