Skip to content

Commit

Permalink
Prepared configuration for releasing to Maven Central repository
Browse files Browse the repository at this point in the history
Added and fixed most of the JavaDoc documentation
  • Loading branch information
Petr Dvorak committed Mar 24, 2016
1 parent f35da2a commit b0c699e
Show file tree
Hide file tree
Showing 96 changed files with 2,147 additions and 191 deletions.
189 changes: 152 additions & 37 deletions pom.xml
@@ -1,40 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.getlime.security</groupId>
<artifactId>powerauth-parent</artifactId>
<version>0.0.8</version>
<packaging>pom</packaging>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

<name>powerauth-parent</name>
<description>PowerAuth 2.0</description>

<modules>
<module>powerauth-android</module>
<module>powerauth-java-prov</module>
<module>powerauth-java</module>
<module>powerauth-java-http</module>
<module>powerauth-java-server</module>
<module>powerauth-java-client</module>
<module>powerauth-java-cmd</module>
<module>powerauth-restful-model</module>
<module>powerauth-restful-security</module>
<module>powerauth-restful-server</module>
<module>powerauth-admin</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<name>powerauth-parent</name>
<description>PowerAuth 2.0</description>

<groupId>io.getlime.security</groupId>
<artifactId>powerauth-parent</artifactId>
<version>0.0.8</version>
<packaging>pom</packaging>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

<inceptionYear>2016</inceptionYear>
<url>http://powerauth.com/</url>

<organization>
<name>Lime - HighTech Solutions Inc.</name>
<url>http://getlime.io/</url>
</organization>

<licenses>
<license>
<name>Apache 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>Petr Dvorak</name>
<email>petr@lime-company.eu</email>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/lime-company/lime-security-powerauth.git</connection>
<developerConnection>scm:git:https://github.com/lime-company/lime-security-powerauth.git</developerConnection>
<url>https://github.com/lime-company/lime-security-powerauth</url>
</scm>

<issueManagement>
<system>Github</system>
<url>https://github.com/lime-company/lime-security-powerauth/issues</url>
</issueManagement>

<modules>
<module>powerauth-android</module>
<module>powerauth-java-prov</module>
<module>powerauth-java</module>
<module>powerauth-java-http</module>
<module>powerauth-java-server</module>
<module>powerauth-java-client</module>
<module>powerauth-java-cmd</module>
<module>powerauth-restful-model</module>
<module>powerauth-restful-security</module>
<module>powerauth-restful-server</module>
<module>powerauth-admin</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<failOnError>false</failOnError>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

</project>
7 changes: 7 additions & 0 deletions powerauth-admin/pom.xml
Expand Up @@ -70,6 +70,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Expand Up @@ -8,20 +8,35 @@

import io.getlime.security.soap.client.PowerAuthServiceClient;

/**
* PowerAuth SOAP WebService Configuration
*
* @author Petr Dvorak
*
*/
@Configuration
@ComponentScan(basePackages = {"io.getlime.rest"})
public class PowerAuthWebServiceConfiguration {

@Value("${powerauth.service.url}")
private String powerAuthServiceUrl;

/**
* Return SOAP service marshaller.
* @return Marshaller instance with a correct context path.
*/
@Bean
public Jaxb2Marshaller marshaller() {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath("io.getlime.powerauth.soap");
return marshaller;
}

/**
* Return a correctly configured PowerAuthServiceClient instance.
* @param marshaller SOAP service marshaller.
* @return Correctly configured PowerAuthServiceClient instance.
*/
@Bean
public PowerAuthServiceClient powerAuthClient(Jaxb2Marshaller marshaller) {
PowerAuthServiceClient client = new PowerAuthServiceClient();
Expand Down
Expand Up @@ -3,9 +3,16 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* Spring Boot application main class
*/
@SpringBootApplication
public class PowerauthAdminApplication {

/**
* Spring boot - main method
* @param args Arguments
*/
public static void main(String[] args) {
SpringApplication.run(PowerauthAdminApplication.class, args);
}
Expand Down
Expand Up @@ -3,6 +3,9 @@
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;

/**
* Spring Boot servlet initializer.
*/
public class ServletInitializer extends SpringBootServletInitializer {

@Override
Expand Down
Expand Up @@ -30,12 +30,25 @@
import io.getlime.security.soap.client.PowerAuthServiceClient;
import io.getlime.security.util.QRUtil;

/**
* Controller class related to PowerAuth activation management.
*
* @author Petr Dvorak
*
*/
@Controller
public class ActivationController {

@Autowired
private PowerAuthServiceClient client;

/**
* Return the list of activations for given users.
* @param userId User ID to lookup the activations for.
* @param showAll Indicates if activations in REMOVED state should be returned.
* @param model Model with passed parameters.
* @return "activations" view.
*/
@RequestMapping(value = "/activation/list")
public String activationList(@RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "showAll", required = false) Boolean showAll, Map<String, Object> model) {
if (userId != null) {
Expand All @@ -59,6 +72,12 @@ public int compare(GetActivationListForUserResponse.Activations o1, GetActivatio
return "activations";
}

/**
* Get detail of a given activation.
* @param id Activation ID.
* @param model Model with passed parameters.
* @return "activationDetail" view.
*/
@RequestMapping(value = "/activation/detail/{id}")
public String activationDetail(@PathVariable(value = "id") String id, Map<String, Object> model) {
GetActivationStatusResponse activation = client.getActivationStatus(id);
Expand Down Expand Up @@ -101,6 +120,13 @@ public String activationDetail(@PathVariable(value = "id") String id, Map<String
return "activationDetail";
}

/**
* Create a new activation.
* @param applicationId Application ID of an associated application.
* @param userId User ID.
* @param model Model with passed parameters.
* @return Redirect the user to activation detail.
*/
@RequestMapping(value = "/activation/create")
public String activationCreate(@RequestParam(value = "applicationId") Long applicationId, @RequestParam(value = "userId") String userId, Map<String, Object> model) {

Expand All @@ -114,12 +140,25 @@ public String activationCreate(@RequestParam(value = "applicationId") Long appli
return "redirect:/activation/detail/" + response.getActivationId();
}

/**
* Commit activation.
* @param activationId Activation ID.
* @param model Model with passed parameters.
* @return Redirect the user to activation detail.
*/
@RequestMapping(value = "/activation/create/do.submit", method = RequestMethod.POST)
public String activationCreateCommitAction(@RequestParam(value = "activationId") String activationId, Map<String, Object> model) {
CommitActivationResponse commitActivation = client.commitActivation(activationId);
return "redirect:/activation/detail/" + commitActivation.getActivationId();
}

/**
* Block activation.
* @param activationId Activation ID
* @param redirect Where to redirect user
* @param model Model with passed parameters.
* @return Redirect user to given URL or to activation detail, in case 'redirect' is null or empty.
*/
@RequestMapping(value = "/activation/block/do.submit", method = RequestMethod.POST)
public String blockActivation(@RequestParam(value = "activationId") String activationId, @RequestParam(value = "redirect") String redirect, Map<String, Object> model) {
BlockActivationResponse blockActivation = client.blockActivation(activationId);
Expand All @@ -129,6 +168,13 @@ public String blockActivation(@RequestParam(value = "activationId") String activ
return "redirect:/activation/detail/" + blockActivation.getActivationId();
}

/**
* Unblock activation.
* @param activationId Activation ID
* @param redirect Where to redirect user
* @param model Model with passed parameters.
* @return Redirect user to given URL or to activation detail, in case 'redirect' is null or empty.
*/
@RequestMapping(value = "/activation/unblock/do.submit", method = RequestMethod.POST)
public String unblockActivation(@RequestParam(value = "activationId") String activationId, @RequestParam(value = "redirect") String redirect, Map<String, Object> model) {
UnblockActivationResponse unblockActivation = client.unblockActivation(activationId);
Expand All @@ -137,7 +183,14 @@ public String unblockActivation(@RequestParam(value = "activationId") String act
}
return "redirect:/activation/detail/" + unblockActivation.getActivationId();
}


/**
* Commit activation.
* @param activationId Activation ID
* @param redirect Where to redirect user
* @param model Model with passed parameters.
* @return Redirect user to given URL or to activation detail, in case 'redirect' is null or empty.
*/
@RequestMapping(value = "/activation/commit/do.submit", method = RequestMethod.POST)
public String commitActivation(@RequestParam(value = "activationId") String activationId, @RequestParam(value = "redirect") String redirect, Map<String, Object> model) {
CommitActivationResponse commitActivation = client.commitActivation(activationId);
Expand All @@ -147,6 +200,13 @@ public String commitActivation(@RequestParam(value = "activationId") String acti
return "redirect:/activation/detail/" + commitActivation.getActivationId();
}

/**
* Remove activation.
* @param activationId Activation ID
* @param redirect Where to redirect user
* @param model Model with passed parameters.
* @return Redirect user to given URL or to activation detail, in case 'redirect' is null or empty.
*/
@RequestMapping(value = "/activation/remove/do.submit", method = RequestMethod.POST)
public String removeActivation(@RequestParam(value = "activationId") String activationId, @RequestParam(value = "redirect") String redirect, Map<String, Object> model) {
RemoveActivationResponse removeActivation = client.removeActivation(activationId);
Expand Down

0 comments on commit b0c699e

Please sign in to comment.