package com.perforce.workshop.tjuricek.p4oauth import org.gradle.api.DefaultTask import org.gradle.api.tasks.TaskAction /** * */ class CreateKeystoreTask extends DefaultTask { @TaskAction def create() { if (!keystoreFile.parentFile.exists()) { keystoreFile.parentFile.mkdirs() } // I'm not sure if this should use the 'getState' method or not if (keystoreFile.exists()) { setDidWork(false); return; } ProcessBuilder pb = new ProcessBuilder( "keytool", "-genkeypair", "-dname", "cn=Developer, ou=Engineering, o=Perforce, c=US", "-alias", "business", "-keypass", keyPass, "-keystore", keystoreFile.absolutePath, "-storepass", storePass, "-validity", "180" ); def proc = pb.start() int exitVal = proc.waitFor() if (exitVal != 0) { logger.warn("keytool cmd: " + pb.command().join(" ")); throw new IllegalStateException("keytool failed:\n" + proc.getErrorStream().getText("utf8")) } } File getKeystoreFile() { return project.file("${project.buildDir}/keystore"); } String getKeyPass() { return "password" } String getStorePass() { return "password" } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 9180 | tjuricek |
0.1.1 Adding mechanism for fetching the p4 token given the bearer token on an Authorization header. This is probably secure since we can't use these tokens except for the restricted hosts. |
||
#2 | 9138 | tjuricek |
Added a "test server" with startTestServer and stopTestServer gradle tasks. The test server isn't 100% complete, but the gradle tasks should be. This is to be used to drive tests forward via a web browser. |
||
#1 | 9105 | tjuricek |
Added the 'createKeystore' task, and framework for how the functional tests will be set up. See the functional_tests/README. The short story is that we'll execute a "test webapp" that the actual tests will interact with. |