diff --git a/.hgignore b/.hgignore index 6ff185f670..00efb50c1f 100644 --- a/.hgignore +++ b/.hgignore @@ -29,3 +29,8 @@ Desktop DF$ # jrebel rebel.xml \.pyc +# ui +scm-ui/build +scm-ui/coverage +/?node_modules/ + diff --git a/Jenkinsfile b/Jenkinsfile index f139f54906..aa6cd6b33b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ #!groovy // Keep the version in sync with the one used in pom.xml in order to get correct syntax completion. -@Library('github.com/cloudogu/ces-build-lib@9aadeeb') +@Library('github.com/cloudogu/ces-build-lib@59d3e94') import com.cloudogu.ces.cesbuildlib.* node() { // No specific label @@ -31,16 +31,14 @@ node() { // No specific label } stage('Unit Test') { - mvn 'test -Dsonia.scm.test.skip.hg=true' + mvn 'test -Dsonia.scm.test.skip.hg=true -Dmaven.test.failure.ignore=true' } stage('SonarQube') { - def sonarQube = new SonarQube(this, 'sonarcloud.io') - analyzeWith(mvn) - if (!sonarQube.waitForQualityGateWebhookToBeCalled()) { + if (!waitForQualityGateWebhookToBeCalled()) { currentBuild.result = 'UNSTABLE' } } @@ -97,6 +95,18 @@ void analyzeWith(Maven mvn) { } } +boolean waitForQualityGateWebhookToBeCalled() { + boolean isQualityGateSucceeded = true + timeout(time: 2, unit: 'MINUTES') { // Needed when there is no webhook for example + def qGate = waitForQualityGate() + echo "SonarQube Quality Gate status: ${qGate.status}" + if (qGate.status != 'OK') { + isQualityGateSucceeded = false + } + } + return isQualityGateSucceeded +} + String getCommitAuthorComplete() { new Sh(this).returnStdOut 'hg log --branch . --limit 1 --template "{author}"' } diff --git a/pom.xml b/pom.xml index e0a8f6282f..0b751a2908 100644 --- a/pom.xml +++ b/pom.xml @@ -70,9 +70,9 @@ scm-test scm-plugins scm-dao-xml + scm-ui scm-webapp scm-server - scm-clients @@ -92,7 +92,6 @@ - jitpack https://jitpack.io @@ -158,6 +157,33 @@ + + + + + com.github.sdorra + shiro-unit + 1.0.1 + test + + + + + com.github.sdorra.shiro-static-permissions + ssp-lib + ${ssp.version} + + + + com.github.sdorra.shiro-static-permissions + ssp-processor + ${ssp.version} + true + + + + + @@ -225,6 +251,25 @@ + + com.github.legman + legman-maven-plugin + ${legman.version} + + true + + + + process-classes + + + guava-migration-check + + + + + org.apache.maven.plugins maven-compiler-plugin @@ -508,20 +553,20 @@ 3.0.1 2.0.1 + 3.1.3.Final 1.19.4 2.8.6 4.0 - 3.1.3.Final - + - 1.2.0 + 1.3.0 9.2.10.v20150310 9.2.10.v20150310 - 1.0.0-SNAPSHOT + 967c8fd521 1.4.0 diff --git a/scm-clients/pom.xml b/scm-clients/pom.xml deleted file mode 100644 index e78be6afa5..0000000000 --- a/scm-clients/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - 4.0.0 - - - sonia.scm - scm - 2.0.0-SNAPSHOT - - - sonia.scm.clients - scm-clients - pom - 2.0.0-SNAPSHOT - scm-clients - - - scm-client-api - scm-client-impl - scm-cli-client - - - - - - - - scm-core - sonia.scm - jar - 2.0.0-SNAPSHOT - - - shiro-core - org.apache.shiro - - - aopalliance - aopalliance - - - guice - com.google.inject - - - guice-multibindings - com.google.inject.extensions - - - guice-servlet - com.google.inject.extensions - - - jersey-core - com.sun.jersey - - - guice-throwingproviders - com.google.inject.extensions - - - commons-lang - commons-lang - - - - - - - diff --git a/scm-clients/scm-cli-client/pom.xml b/scm-clients/scm-cli-client/pom.xml deleted file mode 100644 index e5605878f8..0000000000 --- a/scm-clients/scm-cli-client/pom.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - 4.0.0 - - - scm-clients - sonia.scm.clients - 2.0.0-SNAPSHOT - - - sonia.scm.clients - scm-cli-client - 2.0.0-SNAPSHOT - scm-cli-client - - - - - - - javax.servlet - javax.servlet-api - ${servlet.version} - - - - javax.transaction - jta - 1.1 - provided - - - - sonia.scm.clients - scm-client-impl - 2.0.0-SNAPSHOT - - - - args4j - args4j - 2.0.29 - - - - ch.qos.logback - logback-classic - ${logback.version} - - - - org.freemarker - freemarker - 2.3.21 - - - - - - - - - com.mycila.maven-license-plugin - maven-license-plugin - 1.9.0 - -
http://download.scm-manager.org/licenses/mvn-license.txt
- - src/** - **/test/** - - - target/** - .hg/** - **/*.ftl - - true -
-
- - - org.apache.maven.plugins - maven-assembly-plugin - 2.3 - - - - sonia.scm.cli.App - - - - jar-with-dependencies - - - - - package - - single - - - - - -
-
- - - - - it - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.4 - - - package - - copy - - - - - sonia.scm - scm-webapp - ${project.version} - war - ${project.build.directory}/webapp - scm-webapp.war - - - - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.12 - - - ${project.version} - - - - - integration-test - - integration-test - - - - verify - - verify - - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.version} - - 8085 - STOP - - - scm.home - target/scm-it - - - file.encoding - UTF-8 - - - - 8081 - - - /scm - - ${project.build.directory}/webapp/scm-webapp.war - 0 - true - - - - start-jetty - pre-integration-test - - deploy-war - - - - stop-jetty - post-integration-test - - stop - - - - - - - - - - - -
diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/App.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/App.java deleted file mode 100644 index ca8737101c..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/App.java +++ /dev/null @@ -1,339 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.LoggerContext; - -import org.kohsuke.args4j.Argument; -import org.kohsuke.args4j.CmdLineException; -import org.kohsuke.args4j.CmdLineParser; -import org.kohsuke.args4j.Option; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.cli.cmd.CommandDescriptor; -import sonia.scm.cli.cmd.SubCommand; -import sonia.scm.cli.cmd.SubCommandHandler; -import sonia.scm.cli.cmd.SubCommandOptionHandler; -import sonia.scm.cli.config.ConfigOptionHandler; -import sonia.scm.cli.config.ScmClientConfig; -import sonia.scm.cli.config.ServerConfig; -import sonia.scm.util.IOUtil; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.PrintWriter; - -import java.util.ArrayList; -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -public class App -{ - - /** the logger for App */ - private static final Logger logger = LoggerFactory.getLogger(App.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - public App() - { - this(System.in, System.out); - } - - /** - * Constructs ... - * - * - * @param input - * @param output - */ - public App(BufferedReader input, PrintWriter output) - { - this.input = input; - this.output = output; - } - - /** - * Constructs ... - * - * - * @param input - * @param output - */ - public App(InputStream input, OutputStream output) - { - this.input = new BufferedReader(new InputStreamReader(input)); - this.output = new PrintWriter(output); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param args - */ - public static void main(String[] args) - { - new App().run(args); - } - - /** - * Method description - * - * - * @param args - */ - protected void run(String[] args) - { - CmdLineParser parser = new CmdLineParser(this); - - try - { - parser.parseArgument(args); - } - catch (CmdLineException ex) - { - - // todo error handling - logger.warn("could not parse commandline", ex); - System.exit(1); - } - - configureLogger(); - loadConfig(); - - I18n i18n = new I18n(); - - if ((args.length == 0) || (subcommand == null) || help) - { - printHelp(parser, i18n); - } - else - { - subcommand.init(input, output, i18n, config); - subcommand.run(arguments); - } - - IOUtil.close(input); - IOUtil.close(output); - } - - /** - * Method description - * - */ - private void configureLogger() - { - LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); - - lc.getLogger(Logger.ROOT_LOGGER_NAME).setLevel(loggingLevel); - } - - /** - * Method description - * - */ - private void loadConfig() - { - if (config == null) - { - config = ScmClientConfig.getInstance().getDefaultConfig(); - } - - if (Util.isNotEmpty(serverUrl)) - { - config.setServerUrl(serverUrl); - } - - if (Util.isNotEmpty(username)) - { - config.setUsername(username); - } - - if (Util.isNotEmpty(password)) - { - config.setPassword(password); - } - } - - /** - * Method description - * - * - * @param parser - * @param i18n - */ - private void printHelp(CmdLineParser parser, I18n i18n) - { - output.println(i18n.getMessage(I18n.USAGE)); - output.println(); - output.append(i18n.getMessage(I18n.OPTIONS)).println(":"); - output.println(); - parser.printUsage(output, i18n.getBundle()); - output.println(); - output.append(i18n.getMessage(I18n.SUBCOMMANDS_TITLE)).println(":"); - output.println(); - - String group = null; - List descList = - SubCommandHandler.getInstance().getDescriptors(); - int length = 0; - - for (CommandDescriptor desc : descList) - { - int l = desc.getName().length(); - - if (l > length) - { - length = l; - } - } - - length += 5; - - for (CommandDescriptor desc : - SubCommandHandler.getInstance().getDescriptors()) - { - if ((group == null) ||!group.equals(desc.getGroup())) - { - output.println(); - group = desc.getGroup(); - output.append(i18n.getMessage(group)).println(":"); - output.println(); - } - - int l = desc.getName().length(); - - output.append(" ").append(desc.getName()); - l = length - l; - - for (int i = 0; i < l; i++) - { - output.append(" "); - } - - output.println(i18n.getMessage(desc.getUsage())); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--config", - usage = "optionConfig", - metaVar = "config", - handler = ConfigOptionHandler.class, - aliases = { "-c" } - ) - private ServerConfig config; - - /** Field description */ - @Option( - name = "--help", - usage = "optionHelpText", - aliases = { "-h" } - ) - private boolean help = false; - - /** Field description */ - @Argument(index = 1, metaVar = "arg") - private List arguments = new ArrayList(); - - /** Field description */ - private BufferedReader input; - - /** Field description */ - @Option( - name = "--logging-level", - usage = "optionLoggingLevel", - handler = LoggingLevelOptionHandler.class, - aliases = { "-l" } - ) - private Level loggingLevel = Level.ERROR; - - /** Field description */ - private PrintWriter output; - - /** Field description */ - @Option( - name = "--password", - usage = "optionPassword", - aliases = { "-p" } - ) - private String password; - - /** Field description */ - @Option( - name = "--server", - usage = "optionServerUrl", - aliases = { "-s" } - ) - private String serverUrl; - - /** Field description */ - @Argument( - index = 0, - metaVar = "metaVar_command", - handler = SubCommandOptionHandler.class - ) - private SubCommand subcommand; - - /** Field description */ - @Option( - name = "--user", - usage = "optionUsername", - aliases = { "-u" } - ) - private String username; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/BooleanModifyOptionHandler.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/BooleanModifyOptionHandler.java deleted file mode 100644 index 46d18badb6..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/BooleanModifyOptionHandler.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.CmdLineException; -import org.kohsuke.args4j.CmdLineParser; -import org.kohsuke.args4j.OptionDef; -import org.kohsuke.args4j.spi.OptionHandler; -import org.kohsuke.args4j.spi.Parameters; -import org.kohsuke.args4j.spi.Setter; - -/** - * - * @author Sebastian Sdorra - */ -public class BooleanModifyOptionHandler extends OptionHandler -{ - - /** - * Constructs ... - * - * - * @param parser - * @param option - * @param setter - */ - public BooleanModifyOptionHandler(CmdLineParser parser, OptionDef option, - Setter setter) - { - super(parser, option, setter); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param params - * - * @return - * - * @throws CmdLineException - */ - @Override - public int parseArguments(Parameters params) throws CmdLineException - { - Boolean bool = Boolean.valueOf(params.getParameter(0)); - - setter.addValue(bool); - - return 1; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public String getDefaultMetaVariable() - { - return I18n.BOOLEAN; - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/I18n.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/I18n.java deleted file mode 100644 index 8147c59b44..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/I18n.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * - * @author Sebastian Sdorra - */ -public class I18n -{ - - /** Field description */ - public static final String ERROR = "error"; - - /** Field description */ - public static final String GROUP_NOT_FOUND = "groupNotFound"; - - /** Field description */ - public static final String LEVEL = "level"; - - - public static final String BOOLEAN = "boolean"; - - /** Field description */ - public static final String OPTIONS = "options"; - - /** Field description */ - public static final String REPOSITORY_NOT_FOUND = "repositoryNotFound"; - - /** Field description */ - public static final String RESOURCE_BUNDLE = "sonia.resources.i18n"; - - /** Field description */ - public static final String SUBCOMMANDS_TITLE = "subCommandsTitle"; - - /** Field description */ - public static final String USAGE = "usage"; - - /** Field description */ - public static final String USER_NOT_FOUND = "userNotFound"; - - /** the logger for I18n */ - private static final Logger logger = LoggerFactory.getLogger(I18n.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - public I18n() - { - bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public ResourceBundle getBundle() - { - return bundle; - } - - /** - * Method description - * - * - * @param key - * - * @return - */ - public String getMessage(String key) - { - String value = key; - - try - { - value = bundle.getString(key); - } - catch (MissingResourceException ex) - { - logger.warn("could not find resource for key {}", key); - } - - return value; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private ResourceBundle bundle; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/LoggingLevelOptionHandler.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/LoggingLevelOptionHandler.java deleted file mode 100644 index 2622abecfb..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/LoggingLevelOptionHandler.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import ch.qos.logback.classic.Level; - -import org.kohsuke.args4j.CmdLineException; -import org.kohsuke.args4j.CmdLineParser; -import org.kohsuke.args4j.OptionDef; -import org.kohsuke.args4j.spi.OptionHandler; -import org.kohsuke.args4j.spi.Parameters; -import org.kohsuke.args4j.spi.Setter; - -/** - * - * @author Sebastian Sdorra - */ -public class LoggingLevelOptionHandler extends OptionHandler -{ - - /** - * Constructs ... - * - * - * @param parser - * @param option - * @param setter - */ - public LoggingLevelOptionHandler(CmdLineParser parser, OptionDef option, - Setter setter) - { - super(parser, option, setter); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param params - * - * @return - * - * @throws CmdLineException - */ - @Override - public int parseArguments(Parameters params) throws CmdLineException - { - String value = params.getParameter(0); - Level l = Level.toLevel(value); - - setter.addValue(l); - - return 1; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public String getDefaultMetaVariable() - { - return I18n.LEVEL; - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/SimpleLocalizable.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/SimpleLocalizable.java deleted file mode 100644 index 33fc3ef0b5..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/SimpleLocalizable.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Copyright (c) 2014, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Localizable; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Locale; - -/** - * TODO create real implementation - * - * @author Sebastian Sdorra - */ -public class SimpleLocalizable implements Localizable -{ - - /** - * Constructs ... - * - * - * @param message - */ - public SimpleLocalizable(String message) - { - this.message = message; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param args - * - * @return - */ - @Override - public String format(Object... args) - { - return message; - } - - /** - * Method description - * - * - * @param locale - * @param args - * - * @return - */ - @Override - public String formatWithLocale(Locale locale, Object... args) - { - return message; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private final String message; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/AddMembersSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/AddMembersSubCommand.java deleted file mode 100644 index 2538367fb0..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/AddMembersSubCommand.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.group.Group; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "add-members", - usage = "usageAddMember", - group = "group" -) -public class AddMembersSubCommand extends MembersSubCommand -{ - - /** - * Method description - * - * - * @param group - * @param members - */ - @Override - protected void modifyMembers(Group group, List members) - { - group.getMembers().addAll(members); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/AddPermissionSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/AddPermissionSubCommand.java deleted file mode 100644 index 621ebe54de..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/AddPermissionSubCommand.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Option; - -import sonia.scm.repository.Permission; -import sonia.scm.repository.PermissionType; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "add-permission", - usage = "usageAddPermission", - group = "repository" -) -public class AddPermissionSubCommand extends PermissionSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public PermissionType getType() - { - return type; - } - - /** - * Method description - * - * - * @return - */ - public boolean isGroup() - { - return group; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param group - */ - public void setGroup(boolean group) - { - this.group = group; - } - - /** - * Method description - * - * - * @param type - */ - public void setType(PermissionType type) - { - this.type = type; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param permissions - */ - @Override - protected void modifyPermissions(List permissions) - { - permissions.add(new Permission(name, type, group)); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--group", - usage = "optionPermissionGroup", - aliases = { "-g" } - ) - private boolean group = false; - - /** Field description */ - @Option( - name = "--name", - usage = "optionPermissionName", - required = true, - aliases = { "-n" } - ) - private String name; - - /** Field description */ - @Option( - name = "--type", - usage = "optionPermissionType", - required = true, - metaVar = "permissiontype", - aliases = { "-t" } - ) - private PermissionType type; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/Command.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/Command.java deleted file mode 100644 index ea6e988dae..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/Command.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- JDK imports ------------------------------------------------------------ - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * - * @author Sebastian Sdorra - */ -@Documented -@Retention(RetentionPolicy.RUNTIME) -public @interface Command -{ - String name() default ""; - String usage() default ""; - String group() default "misc"; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CommandDescriptor.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CommandDescriptor.java deleted file mode 100644 index ce51657ea9..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CommandDescriptor.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.util.AssertUtil; -import sonia.scm.util.Util; - -/** - * - * @author Sebastian Sdorra - */ -public class CommandDescriptor implements Comparable -{ - - /** the logger for CommandDescriptor */ - private static final Logger logger = - LoggerFactory.getLogger(CommandDescriptor.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param commandClass - */ - public CommandDescriptor(Class commandClass) - { - AssertUtil.assertIsNotNull(commandClass); - this.commandClass = commandClass; - - Command cmd = commandClass.getAnnotation(Command.class); - - if (cmd != null) - { - this.name = cmd.name(); - this.group = cmd.group(); - this.usage = cmd.usage(); - } - - if (Util.isEmpty(name)) - { - name = commandClass.getSimpleName(); - } - } - - /** - * Constructs ... - * - * - * @param name - * @param usage - * @param commandClass - */ - public CommandDescriptor(String name, String usage, - Class commandClass) - { - this.name = name; - this.usage = usage; - this.commandClass = commandClass; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param desc - * - * @return - */ - @Override - public int compareTo(CommandDescriptor desc) - { - int result = group.compareTo(desc.group); - - if (result == 0) - { - result = name.compareTo(desc.name); - } - - return result; - } - - /** - * Method description - * - * - * @return - */ - public SubCommand createSubCommand() - { - SubCommand command = null; - - try - { - command = commandClass.newInstance(); - command.setCommandName(name); - } - catch (Exception ex) - { - logger.error("could not create SubCommand {}", commandClass.getName()); - } - - return command; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public Class getCommandClass() - { - return commandClass; - } - - /** - * Method description - * - * - * @return - */ - public String getGroup() - { - return group; - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - /** - * Method description - * - * - * @return - */ - public String getUsage() - { - return usage; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private Class commandClass; - - /** Field description */ - private String group = "misc"; - - /** Field description */ - private String name; - - /** Field description */ - private String usage = ""; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CreateGroupSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CreateGroupSubCommand.java deleted file mode 100644 index a64a273253..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CreateGroupSubCommand.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Option; - -import sonia.scm.cli.wrapper.GroupWrapper; -import sonia.scm.client.ScmClientSession; -import sonia.scm.group.Group; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "create-group", - usage = "usageCreateGroup", - group = "group" -) -public class CreateGroupSubCommand extends TemplateSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getDescription() - { - return description; - } - - /** - * Method description - * - * - * @return - */ - public List getMembers() - { - return members; - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - /** - * Method description - * - * - * @return - */ - public String getType() - { - return type; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param description - */ - public void setDescription(String description) - { - this.description = description; - } - - /** - * Method description - * - * - * @param members - */ - public void setMembers(List members) - { - this.members = members; - } - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - /** - * Method description - * - * - * @param type - */ - public void setType(String type) - { - this.type = type; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - Group group = new Group(); - - group.setName(name); - group.setDescription(description); - group.setType(type); - group.setMembers(members); - - ScmClientSession session = createSession(); - - session.getGroupHandler().create(group); - - Map env = new HashMap(); - - env.put("group", new GroupWrapper(group)); - renderTemplate(env, GetGroupSubCommand.TEMPLATE); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--description", - usage = "optionGroupDescription", - aliases = { "-d" } - ) - private String description; - - /** Field description */ - @Option( - name = "--member", - usage = "optionGroupMember", - aliases = { "-m" } - ) - private List members; - - /** Field description */ - @Option( - name = "--name", - usage = "optionGroupName", - required = true, - aliases = { "-n" } - ) - private String name; - - /** Field description */ - @Option( - name = "--type", - usage = "optionGroupType", - aliases = { "-t" } - ) - private String type = "xml"; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CreateRepositorySubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CreateRepositorySubCommand.java deleted file mode 100644 index 52828eba25..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CreateRepositorySubCommand.java +++ /dev/null @@ -1,220 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Option; - -import sonia.scm.cli.wrapper.RepositoryWrapper; -import sonia.scm.client.ScmClientSession; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "create-repository", - usage = "usageCreateRepository", - group = "repository" -) -public class CreateRepositorySubCommand extends TemplateSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getContact() - { - return contact; - } - - /** - * Method description - * - * - * @return - */ - public String getDescription() - { - return description; - } - - /** - * Method description - * - * - * @return - */ - public String getType() - { - return type; - } - - /** - * Method description - * - * - * @return - */ - public boolean isPublicReadable() - { - return publicReadable; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param contact - */ - public void setContact(String contact) - { - this.contact = contact; - } - - /** - * Method description - * - * - * @param description - */ - public void setDescription(String description) - { - this.description = description; - } - - /** - * Method description - * - * - * @param publicReadable - */ - public void setPublicReadable(boolean publicReadable) - { - this.publicReadable = publicReadable; - } - - /** - * Method description - * - * - * @param type - */ - public void setType(String type) - { - this.type = type; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - Repository repository = new Repository(); - - repository.setName(name); - repository.setType(type); - repository.setContact(contact); - repository.setDescription(description); - - ScmClientSession session = createSession(); - - session.getRepositoryHandler().create(repository); - - Map env = new HashMap(); - - env.put("repository", new RepositoryWrapper(config, repository)); - renderTemplate(env, GetRepositorySubCommand.TEMPLATE); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--contact", - usage = "optionRepositoryContact", - aliases = { "-c" } - ) - private String contact; - - /** Field description */ - @Option( - name = "--description", - usage = "optionRepositoryDescription", - aliases = { "-d" } - ) - private String description; - - /** Field description */ - @Option( - name = "--name", - required = true, - usage = "optionRepositoryName", - aliases = { "-n" } - ) - private String name; - - /** Field description */ - @Option( - name = "--public", - usage = "optionRepositoryPublic", - aliases = { "-p" } - ) - private boolean publicReadable; - - /** Field description */ - @Option( - name = "--type", - required = true, - usage = "optionRepositoryType", - aliases = { "-t" } - ) - private String type; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CreateUserSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CreateUserSubCommand.java deleted file mode 100644 index c6a72d4ce8..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/CreateUserSubCommand.java +++ /dev/null @@ -1,274 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Option; - -import sonia.scm.cli.wrapper.UserWrapper; -import sonia.scm.client.ScmClientSession; -import sonia.scm.user.User; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "create-user", - usage = "usageCreateUser", - group = "user" -) -public class CreateUserSubCommand extends TemplateSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getDisplayName() - { - return displayName; - } - - /** - * Method description - * - * - * @return - */ - public String getMail() - { - return mail; - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - /** - * Method description - * - * - * @return - */ - public String getPassword() - { - return password; - } - - /** - * Method description - * - * - * @return - */ - public String getType() - { - return type; - } - - /** - * Method description - * - * - * @return - */ - public boolean isAdmin() - { - return admin; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param admin - */ - public void setAdmin(boolean admin) - { - this.admin = admin; - } - - /** - * Method description - * - * - * @param displayName - */ - public void setDisplayName(String displayName) - { - this.displayName = displayName; - } - - /** - * Method description - * - * - * @param mail - */ - public void setMail(String mail) - { - this.mail = mail; - } - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - /** - * Method description - * - * - * @param password - */ - public void setPassword(String password) - { - this.password = password; - } - - /** - * Method description - * - * - * @param type - */ - public void setType(String type) - { - this.type = type; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - User user = new User(); - - user.setName(name); - user.setAdmin(admin); - user.setDisplayName(displayName); - user.setPassword(password); - user.setMail(mail); - user.setType(type); - - ScmClientSession session = createSession(); - - session.getUserHandler().create(user); - - Map env = new HashMap(); - - env.put("user", new UserWrapper(user)); - renderTemplate(env, GetUserSubCommand.TEMPLATE); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--admin", - usage = "optionUserAdmin", - aliases = { "-a" } - ) - private boolean admin = false; - - /** Field description */ - @Option( - name = "--display-name", - usage = "optionUserDisplayName", - required = true, - aliases = { "-d" } - ) - private String displayName; - - /** Field description */ - @Option( - name = "--mail", - usage = "optionUserMail", - aliases = { "-m" } - ) - private String mail; - - /** Field description */ - @Option( - name = "--name", - usage = "optionUserName", - required = true, - aliases = { "-n" } - ) - private String name; - - /** Field description */ - @Option( - name = "--password", - usage = "optionUserPassword", - aliases = { "-p" } - ) - private String password; - - /** Field description */ - @Option( - name = "--type", - usage = "optionUserType", - aliases = { "-t" } - ) - private String type = "xml"; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteConfigSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteConfigSubCommand.java deleted file mode 100644 index 93c2ad253e..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteConfigSubCommand.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.cli.config.ScmClientConfig; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "delete-config", - usage = "usageDeleteConfig", - group = "config" -) -public class DeleteConfigSubCommand extends SubCommand -{ - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientConfig.getInstance().delete(); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteGroupSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteGroupSubCommand.java deleted file mode 100644 index 345cf5baec..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteGroupSubCommand.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; - -import sonia.scm.client.ScmClientSession; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "delete-group", - usage = "usageDeleteGroup", - group = "group" -) -public class DeleteGroupSubCommand extends SubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - - session.getGroupHandler().delete(name); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Argument( - usage = "optionGroupName", - metaVar = "groupname", - required = true - ) - private String name; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteMembersSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteMembersSubCommand.java deleted file mode 100644 index 449fab5181..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteMembersSubCommand.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.group.Group; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "delete-members", - usage = "usageDeleteMembers", - group = "group" -) -public class DeleteMembersSubCommand extends MembersSubCommand -{ - - /** - * Method description - * - * - * @param group - * @param members - */ - @Override - protected void modifyMembers(Group group, List members) - { - group.getMembers().removeAll(members); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeletePermissionSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeletePermissionSubCommand.java deleted file mode 100644 index fe01b3ff24..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeletePermissionSubCommand.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Option; - -import sonia.scm.repository.Permission; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Iterator; -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "delete-permission", - usage = "usageDeletePermission", - group = "repository" -) -public class DeletePermissionSubCommand extends PermissionSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param permissions - */ - @Override - protected void modifyPermissions(List permissions) - { - Iterator it = permissions.iterator(); - - while (it.hasNext()) - { - Permission p = it.next(); - - if (name.equals(p.getName())) - { - it.remove(); - } - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--name", - usage = "optionPermissionName", - required = true, - aliases = { "-n" } - ) - private String name; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteRepositorySubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteRepositorySubCommand.java deleted file mode 100644 index 742eb72f80..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteRepositorySubCommand.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; - -import sonia.scm.client.ScmClientSession; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "delete-repository", - usage = "usageDeleteRepository", - group = "repository" -) -public class DeleteRepositorySubCommand extends SubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getId() - { - return id; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param id - */ - public void setId(String id) - { - this.id = id; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - - session.getRepositoryHandler().delete(id); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Argument( - usage = "optionRepositoryId", - metaVar = "repositoryid", - required = true - ) - private String id; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteUserSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteUserSubCommand.java deleted file mode 100644 index c254a2e7e3..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/DeleteUserSubCommand.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; - -import sonia.scm.client.ScmClientSession; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "delete-user", - usage = "usageDeleteUser", - group = "user" -) -public class DeleteUserSubCommand extends SubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - - session.getUserHandler().delete(name); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Argument( - usage = "optionUserName", - metaVar = "username", - required = true - ) - private String name; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/EncryptSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/EncryptSubCommand.java deleted file mode 100644 index af76698062..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/EncryptSubCommand.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; - -/** - * - * @author Sebastian Sdorra - * @since 1.41 - */ -@Command( - name = "encrypt", - usage = "usageEncrypt", - group = "security" -) -public class EncryptSubCommand extends SubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getValue() - { - return value; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param value - */ - public void setValue(String value) - { - this.value = value; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - String enc = createSession().getSecurityHandler().encrypt(value); - - output.println(enc); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Argument( - usage = "optionEncryptValue", - metaVar = "value", - required = true - ) - private String value; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GenerateKeySubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GenerateKeySubCommand.java deleted file mode 100644 index b8658391b0..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GenerateKeySubCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "generate-key", - usage = "usageGenerateKey", - group = "security" -) -public class GenerateKeySubCommand extends SubCommand -{ - - /** - * Method description - * - */ - @Override - protected void run() - { - output.println(createSession().getSecurityHandler().generateKey()); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GetGroupSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GetGroupSubCommand.java deleted file mode 100644 index 5d823217e1..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GetGroupSubCommand.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; - -import sonia.scm.cli.I18n; -import sonia.scm.cli.wrapper.GroupWrapper; -import sonia.scm.client.ScmClientSession; -import sonia.scm.group.Group; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "get-group", - usage = "usageGetGroup", - group = "group" -) -public class GetGroupSubCommand extends TemplateSubCommand -{ - - /** Field description */ - public static final String TEMPLATE = "/sonia/resources/get-group.ftl"; - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - Group group = session.getGroupHandler().get(name); - - if (group != null) - { - Map env = new HashMap(); - - env.put("group", new GroupWrapper(group)); - renderTemplate(env, TEMPLATE); - } - else - { - output.println(i18n.getMessage(I18n.GROUP_NOT_FOUND)); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Argument( - usage = "optionGroupName", - metaVar = "groupname", - required = true - ) - private String name; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GetRepositorySubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GetRepositorySubCommand.java deleted file mode 100644 index 2e8227fa60..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GetRepositorySubCommand.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; - -import sonia.scm.cli.I18n; -import sonia.scm.cli.wrapper.RepositoryWrapper; -import sonia.scm.client.ScmClientSession; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "get-repository", - usage = "usageGetRepository", - group = "repository" -) -public class GetRepositorySubCommand extends TemplateSubCommand -{ - - /** Field description */ - public static final String TEMPLATE = "/sonia/resources/get-repository.ftl"; - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getId() - { - return id; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param id - */ - public void setId(String id) - { - this.id = id; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - - Repository repository; - - int index = id.indexOf("/"); - - if (index > 0) - { - String type = id.substring(0, index); - String name = id.substring(index + 1); - - repository = session.getRepositoryHandler().get(type, name); - } - else - { - repository = session.getRepositoryHandler().get(id); - } - - if (repository != null) - { - Map env = new HashMap(); - - env.put("repository", new RepositoryWrapper(config, repository)); - renderTemplate(env, TEMPLATE); - } - else - { - output.println(i18n.getMessage(I18n.REPOSITORY_NOT_FOUND)); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Argument( - usage = "optionRepositoryIdOrTypeAndName", - metaVar = "repositoryid", - required = true - ) - private String id; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GetUserSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GetUserSubCommand.java deleted file mode 100644 index 60d70349cb..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/GetUserSubCommand.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; - -import sonia.scm.cli.I18n; -import sonia.scm.cli.wrapper.UserWrapper; -import sonia.scm.client.ScmClientSession; -import sonia.scm.user.User; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "get-user", - usage = "usageGetUser", - group = "user" -) -public class GetUserSubCommand extends TemplateSubCommand -{ - - /** Field description */ - public static final String TEMPLATE = "/sonia/resources/get-user.ftl"; - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - User user = session.getUserHandler().get(name); - - if (user != null) - { - Map env = new HashMap(); - - env.put("user", new UserWrapper(user)); - renderTemplate(env, TEMPLATE); - } - else - { - output.println(i18n.getMessage(I18n.USER_NOT_FOUND)); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Argument( - usage = "optionUserName", - metaVar = "username", - required = true - ) - private String name; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportBundleSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportBundleSubCommand.java deleted file mode 100644 index d746df0828..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportBundleSubCommand.java +++ /dev/null @@ -1,186 +0,0 @@ -/** -* Copyright (c) 2014, Sebastian Sdorra All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. 2. Redistributions in -* binary form must reproduce the above copyright notice, this list of -* conditions and the following disclaimer in the documentation and/or other -* materials provided with the distribution. 3. Neither the name of SCM-Manager; -* nor the names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* http://bitbucket.org/sdorra/scm-manager -* -*/ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.common.io.Files; - -import org.kohsuke.args4j.Option; - -import sonia.scm.ConfigurationException; -import sonia.scm.client.ImportBundleRequest; -import sonia.scm.client.ScmClientSession; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.File; - -/** - * - * @author Sebastian Sdorra - * @since 1.43 - */ -@Command( - name = "import-from-bundle", - usage = "usageImportBundle", - group = "repository" -) -public class ImportBundleSubCommand extends ImportSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public File getBundle() - { - return bundle; - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - /** - * Method description - * - * - * @return - */ - public boolean isCompressed() - { - return compressed; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param bundle - */ - public void setBundle(File bundle) - { - this.bundle = bundle; - } - - /** - * Method description - * - * - * @param compressed - */ - public void setCompressed(boolean compressed) - { - this.compressed = compressed; - } - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - if (!bundle.exists()) - { - throw new ConfigurationException("could not find bundle"); - } - else - { - ScmClientSession session = createSession(); - - ImportBundleRequest req = new ImportBundleRequest(getType(), name, - Files.asByteSource(bundle)); - - req.setCompressed(compressed); - - Repository repository = - session.getRepositoryHandler().importFromBundle(req); - - printImportedRepository(repository); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--bundle", - required = true, - usage = "optionRepositoryBundle", - aliases = { "-b" } - ) - private File bundle; - - /** Field description */ - @Option( - name = "--compressed", - usage = "optionRepositoryBundleCompressed", - aliases = { "-c" } - ) - private boolean compressed = false; - - /** Field description */ - @Option( - name = "--name", - required = true, - usage = "optionRepositoryName", - aliases = { "-n" } - ) - private String name; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportDirectorySubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportDirectorySubCommand.java deleted file mode 100644 index 788eef4fae..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportDirectorySubCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.common.collect.Maps; - -import sonia.scm.client.ImportResultWrapper; -import sonia.scm.client.ScmClientSession; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - * @since 1.43 - */ -@Command( - name = "import-from-directory", - usage = "usageImportDirectory", - group = "repository" -) -public class ImportDirectorySubCommand extends ImportSubCommand -{ - - /** Field description */ - public static final String TEMPLATE = - "/sonia/resources/import-from-directory.ftl"; - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - ImportResultWrapper wrapper = - session.getRepositoryHandler().importFromDirectory(getType()); - Map env = Maps.newHashMap(); - - env.put("importedDirectories", wrapper.getImportedDirectories()); - env.put("failedDirectories", wrapper.getFailedDirectories()); - renderTemplate(env, TEMPLATE); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportSubCommand.java deleted file mode 100644 index 7c8efe704d..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportSubCommand.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Copyright (c) 2014, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.common.collect.Maps; - -import org.kohsuke.args4j.Argument; - -import sonia.scm.cli.wrapper.RepositoryWrapper; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - * @since 1.43 - */ -public abstract class ImportSubCommand extends TemplateSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getType() - { - return type; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param type - */ - public void setType(String type) - { - this.type = type; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param repository - */ - protected void printImportedRepository(Repository repository) - { - Map env = Maps.newHashMap(); - - env.put("repository", new RepositoryWrapper(config, repository)); - renderTemplate(env, GetRepositorySubCommand.TEMPLATE); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Argument( - usage = "optionRepositoryType", - metaVar = "repositorytype", - required = true - ) - private String type; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportUrlSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportUrlSubCommand.java deleted file mode 100644 index 912a9a5fbc..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ImportUrlSubCommand.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Copyright (c) 2014, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.common.collect.Maps; - -import org.kohsuke.args4j.Option; - -import sonia.scm.client.ImportUrlRequest; -import sonia.scm.client.ScmClientSession; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import java.net.URL; - -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "import-from-url", - usage = "usageImportUrl", - group = "repository" -) -public class ImportUrlSubCommand extends ImportSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - /** - * Method description - * - * - * @return - */ - public URL getUrl() - { - return url; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - /** - * Method description - * - * - * @param url - */ - public void setUrl(URL url) - { - this.url = url; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - - ImportUrlRequest request = new ImportUrlRequest(getType(), name, - url.toExternalForm()); - Repository repository = - session.getRepositoryHandler().importFromUrl(request); - - printImportedRepository(repository); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--name", - required = true, - usage = "optionRepositoryName", - aliases = { "-n" } - ) - private String name; - - /** Field description */ - @Option( - name = "--url", - required = true, - usage = "optionRemoteRepositoryUrl", - aliases = { "-r" } - ) - private URL url; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ListGroupsSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ListGroupsSubCommand.java deleted file mode 100644 index 968e574ca6..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ListGroupsSubCommand.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.cli.wrapper.WrapperUtil; -import sonia.scm.client.ScmClientSession; -import sonia.scm.group.Group; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "list-groups", - usage = "usageListGroups", - group = "group" -) -public class ListGroupsSubCommand extends TemplateSubCommand -{ - - /** Field description */ - public static final String TEMPLATE = "/sonia/resources/list-groups.ftl"; - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - List groups = session.getGroupHandler().getAll(); - Map env = new HashMap(); - - env.put("groups", WrapperUtil.wrapGroups(groups)); - renderTemplate(env, TEMPLATE); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ListRepositoriesSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ListRepositoriesSubCommand.java deleted file mode 100644 index 2235781791..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ListRepositoriesSubCommand.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.cli.wrapper.WrapperUtil; -import sonia.scm.client.ScmClientSession; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "list-repositories", - usage = "usageListRepositories", - group = "repository" -) -public class ListRepositoriesSubCommand extends TemplateSubCommand -{ - - /** Field description */ - public static final String TEMPLATE = - "/sonia/resources/list-repositories.ftl"; - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - List repositories = session.getRepositoryHandler().getAll(); - Map env = new HashMap(); - - env.put("repositories", WrapperUtil.wrapRepositories(config, repositories)); - renderTemplate(env, TEMPLATE); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ListUsersSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ListUsersSubCommand.java deleted file mode 100644 index 58da1fc2f3..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ListUsersSubCommand.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.cli.wrapper.WrapperUtil; -import sonia.scm.client.ScmClientSession; -import sonia.scm.user.User; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "list-users", - usage = "usageListUsers", - group = "user" -) -public class ListUsersSubCommand extends TemplateSubCommand -{ - - /** Field description */ - public static final String TEMPLATE = "/sonia/resources/list-users.ftl"; - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - List users = session.getUserHandler().getAll(); - Map env = new HashMap(); - - env.put("users", WrapperUtil.wrapUsers(users)); - renderTemplate(env, TEMPLATE); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/MembersSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/MembersSubCommand.java deleted file mode 100644 index 279b0602ec..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/MembersSubCommand.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; -import org.kohsuke.args4j.Option; - -import sonia.scm.cli.I18n; -import sonia.scm.cli.wrapper.GroupWrapper; -import sonia.scm.client.GroupClientHandler; -import sonia.scm.client.ScmClientSession; -import sonia.scm.group.Group; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class MembersSubCommand extends TemplateSubCommand -{ - - /** - * Method description - * - * - * @param group - * @param members - */ - protected abstract void modifyMembers(Group group, List members); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public List getMembers() - { - return members; - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param members - */ - public void setMembers(List members) - { - this.members = members; - } - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - GroupClientHandler handler = session.getGroupHandler(); - Group group = handler.get(name); - - if (group != null) - { - modifyMembers(group, members); - handler.modify(group); - - Map env = new HashMap(); - - env.put("group", new GroupWrapper(group)); - renderTemplate(env, GetGroupSubCommand.TEMPLATE); - } - else - { - output.println(i18n.getMessage(I18n.GROUP_NOT_FOUND)); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--member", - usage = "optionGroupMember", - required = true, - aliases = { "-m" } - ) - private List members; - - /** Field description */ - @Argument( - usage = "optionGroupName", - metaVar = "groupname", - required = true - ) - private String name; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ModifyGroupSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ModifyGroupSubCommand.java deleted file mode 100644 index 244f40f114..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ModifyGroupSubCommand.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; -import org.kohsuke.args4j.Option; - -import sonia.scm.cli.I18n; -import sonia.scm.cli.wrapper.GroupWrapper; -import sonia.scm.client.GroupClientHandler; -import sonia.scm.client.ScmClientSession; -import sonia.scm.group.Group; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "modify-group", - usage = "usageModifyGroup", - group = "group" -) -public class ModifyGroupSubCommand extends TemplateSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getDescription() - { - return description; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param description - */ - public void setDescription(String description) - { - this.description = description; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - GroupClientHandler handler = session.getGroupHandler(); - Group group = handler.get(name); - - if (group != null) - { - if (Util.isNotEmpty(description)) - { - group.setDescription(description); - } - - handler.modify(group); - - Map env = new HashMap(); - - env.put("group", new GroupWrapper(group)); - renderTemplate(env, GetGroupSubCommand.TEMPLATE); - } - else - { - output.println(i18n.getMessage(I18n.GROUP_NOT_FOUND)); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--description", - usage = "optionGroupDescription", - aliases = { "-d" } - ) - private String description; - - /** Field description */ - @Argument( - usage = "optionGroupName", - metaVar = "groupname", - required = true - ) - private String name; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ModifyRepositorySubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ModifyRepositorySubCommand.java deleted file mode 100644 index 5ec4c59519..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ModifyRepositorySubCommand.java +++ /dev/null @@ -1,269 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; -import org.kohsuke.args4j.Option; - -import sonia.scm.cli.BooleanModifyOptionHandler; -import sonia.scm.cli.I18n; -import sonia.scm.cli.wrapper.RepositoryWrapper; -import sonia.scm.client.RepositoryClientHandler; -import sonia.scm.client.ScmClientSession; -import sonia.scm.repository.Repository; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "modify-repository", - usage = "usageModifyRepository", - group = "repository" -) -public class ModifyRepositorySubCommand extends TemplateSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public Boolean getArchvied() - { - return archvied; - } - - /** - * Method description - * - * - * @return - */ - public String getContact() - { - return contact; - } - - /** - * Method description - * - * - * @return - */ - public String getDescription() - { - return description; - } - - /** - * Method description - * - * - * @return - */ - public String getId() - { - return id; - } - - /** - * Method description - * - * - * @return - */ - public Boolean getPublicReadable() - { - return publicReadable; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param archvied - */ - public void setArchvied(Boolean archvied) - { - this.archvied = archvied; - } - - /** - * Method description - * - * - * @param contact - */ - public void setContact(String contact) - { - this.contact = contact; - } - - /** - * Method description - * - * - * @param description - */ - public void setDescription(String description) - { - this.description = description; - } - - /** - * Method description - * - * - * @param id - */ - public void setId(String id) - { - this.id = id; - } - - /** - * Method description - * - * - * @param publicReadable - */ - public void setPublicReadable(Boolean publicReadable) - { - this.publicReadable = publicReadable; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - RepositoryClientHandler handler = session.getRepositoryHandler(); - Repository repository = handler.get(id); - - if (repository != null) - { - if (Util.isNotEmpty(contact)) - { - repository.setContact(contact); - } - - if (Util.isNotEmpty(description)) - { - repository.setDescription(description); - } - - if (archvied != null) - { - repository.setArchived(archvied); - } - - if (publicReadable != null) - { - repository.setPublicReadable(publicReadable); - } - - handler.modify(repository); - - Map env = new HashMap(); - - env.put("repository", new RepositoryWrapper(config, repository)); - renderTemplate(env, GetRepositorySubCommand.TEMPLATE); - } - else - { - output.println(i18n.getMessage(I18n.REPOSITORY_NOT_FOUND)); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--archived", - usage = "optionRepositoryArchive", - aliases = { "-a" }, - handler = BooleanModifyOptionHandler.class - ) - private Boolean archvied; - - /** Field description */ - @Option( - name = "--contact", - usage = "optionRepositoryContact", - aliases = { "-c" } - ) - private String contact; - - /** Field description */ - @Option( - name = "--description", - usage = "optionRepositoryDescription", - aliases = { "-d" } - ) - private String description; - - /** Field description */ - @Argument( - usage = "optionRepositoryId", - metaVar = "repositoryid", - required = true - ) - private String id; - - /** Field description */ - @Option( - name = "--public", - usage = "optionRepositoryPublic", - aliases = { "-p" }, - handler = BooleanModifyOptionHandler.class - ) - private Boolean publicReadable; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ModifyUserSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ModifyUserSubCommand.java deleted file mode 100644 index 613b07d552..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ModifyUserSubCommand.java +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; -import org.kohsuke.args4j.Option; - -import sonia.scm.cli.I18n; -import sonia.scm.cli.wrapper.UserWrapper; -import sonia.scm.client.ScmClientSession; -import sonia.scm.client.UserClientHandler; -import sonia.scm.user.User; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "modify-user", - usage = "usageModifyUser", - group = "user" -) -public class ModifyUserSubCommand extends TemplateSubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getDisplayName() - { - return displayName; - } - - /** - * Method description - * - * - * @return - */ - public String getMail() - { - return mail; - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - /** - * Method description - * - * - * @return - */ - public String getPassword() - { - return password; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param displayName - */ - public void setDisplayName(String displayName) - { - this.displayName = displayName; - } - - /** - * Method description - * - * - * @param mail - */ - public void setMail(String mail) - { - this.mail = mail; - } - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - /** - * Method description - * - * - * @param password - */ - public void setPassword(String password) - { - this.password = password; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - UserClientHandler handler = session.getUserHandler(); - User user = handler.get(name); - - if (user != null) - { - if (Util.isNotEmpty(displayName)) - { - user.setDisplayName(displayName); - } - - if (Util.isNotEmpty(mail)) - { - user.setMail(mail); - } - - if (Util.isNotEmpty(password)) - { - user.setPassword(password); - } - - handler.modify(user); - - Map env = new HashMap(); - - env.put("user", new UserWrapper(user)); - renderTemplate(env, GetUserSubCommand.TEMPLATE); - } - else - { - output.println(i18n.getMessage(I18n.USER_NOT_FOUND)); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option( - name = "--display-name", - usage = "optionUserDisplayName", - aliases = { "-d" } - ) - private String displayName; - - /** Field description */ - @Option( - name = "--mail", - usage = "optionUserMail", - aliases = { "-m" } - ) - private String mail; - - /** Field description */ - @Argument( - usage = "optionUserName", - metaVar = "username", - required = true - ) - private String name; - - /** Field description */ - @Option( - name = "--password", - usage = "optionUserPassword", - aliases = { "-p" } - ) - private String password; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/PermissionSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/PermissionSubCommand.java deleted file mode 100644 index a6b5eba2f5..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/PermissionSubCommand.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.Argument; - -import sonia.scm.cli.I18n; -import sonia.scm.cli.wrapper.RepositoryWrapper; -import sonia.scm.client.RepositoryClientHandler; -import sonia.scm.client.ScmClientSession; -import sonia.scm.repository.Permission; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class PermissionSubCommand extends TemplateSubCommand -{ - - /** - * Method description - * - * - * @param permissions - */ - protected abstract void modifyPermissions(List permissions); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getId() - { - return id; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param id - */ - public void setId(String id) - { - this.id = id; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - ScmClientSession session = createSession(); - RepositoryClientHandler handler = session.getRepositoryHandler(); - Repository repository = handler.get(id); - - if (repository != null) - { - List permissions = repository.getPermissions(); - - if (permissions == null) - { - permissions = new ArrayList(); - } - - modifyPermissions(permissions); - repository.setPermissions(permissions); - handler.modify(repository); - - Map env = new HashMap(); - - env.put("repository", new RepositoryWrapper(config, repository)); - renderTemplate(env, GetRepositorySubCommand.TEMPLATE); - } - else - { - output.println(i18n.getMessage(I18n.REPOSITORY_NOT_FOUND)); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Argument( - usage = "optionRepositoryId", - metaVar = "repositoryid", - required = true - ) - private String id; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ServerVersionSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ServerVersionSubCommand.java deleted file mode 100644 index e5c60f0779..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/ServerVersionSubCommand.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ -package sonia.scm.cli.cmd; - -import sonia.scm.ScmState; -import sonia.scm.client.ScmClientSession; -import sonia.scm.util.Util; - -/** - * - * @author Sebastian Sdorra - * @version 1.9 - */ -@Command( - name = "server-version", - usage = "usageServerVersion", - group = "misc" -) -public class ServerVersionSubCommand extends SubCommand -{ - - @Override - protected void run() - { - ScmClientSession session = createSession(); - ScmState state = session.getState(); - String version = null; - if ( state != null ){ - version = state.getVersion(); - - } - if ( Util.isEmpty(version) ){ - version = VersionSubCommand.DEFAULT_VERSION; - } - - output.append("scm-manager version: ").println( version ); - } - -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/StoreConfigSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/StoreConfigSubCommand.java deleted file mode 100644 index 3fcd06e479..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/StoreConfigSubCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.cli.config.ScmClientConfig; - -/** - * - * @author Sebastian Sdorra - */ -@Command( - name = "store-config", - usage = "usageStoreConfig", - group = "config" -) -public class StoreConfigSubCommand extends SubCommand -{ - - /** - * Method description - * - */ - @Override - protected void run() - { - output.println("store config"); - ScmClientConfig.getInstance().store(); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/SubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/SubCommand.java deleted file mode 100644 index 09dcf344ef..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/SubCommand.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.CmdLineException; -import org.kohsuke.args4j.CmdLineParser; -import org.kohsuke.args4j.Option; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.cli.I18n; -import sonia.scm.cli.config.ServerConfig; -import sonia.scm.client.ScmClient; -import sonia.scm.client.ScmClientSession; -import sonia.scm.util.IOUtil; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.BufferedReader; -import java.io.PrintWriter; - -import java.util.Collection; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class SubCommand -{ - - /** the logger for SubCommand */ - private static final Logger logger = - LoggerFactory.getLogger(SubCommand.class); - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - protected abstract void run(); - - /** - * Method description - * - * - * @param input - * @param output - * @param i18n - * @param config - */ - public void init(BufferedReader input, PrintWriter output, I18n i18n, - ServerConfig config) - { - this.input = input; - this.output = output; - this.i18n = i18n; - this.config = config; - } - - /** - * Method description - * - * - * @param args - */ - public void run(Collection args) - { - CmdLineParser parser = new CmdLineParser(this); - - try - { - parser.parseArgument(args); - - if (help) - { - parser.printUsage(output, i18n.getBundle()); - System.exit(1); - } - else - { - try - { - run(); - } - finally - { - IOUtil.close(session); - } - } - } - catch (CmdLineException ex) - { - if (logger.isWarnEnabled()) - { - logger.warn("could not parse comannd line", ex); - } - - if (!help) - { - output.append(i18n.getMessage(I18n.ERROR)).append(": "); - output.println(ex.getMessage()); - output.println(); - } - - printHelp(parser); - } - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getCommandName() - { - return commandName; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param name - */ - public void setCommandName(String name) - { - this.commandName = name; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - protected ScmClientSession createSession() - { - if (Util.isNotEmpty(config.getUsername()) - && Util.isNotEmpty(config.getPassword())) - { - session = ScmClient.createSession(config.getServerUrl(), - config.getUsername(), - config.getPassword()); - } - else - { - session = ScmClient.createSession(config.getServerUrl()); - } - - return session; - } - - /** - * Method description - * - * - * @param parser - */ - protected void printHelp(CmdLineParser parser) - { - parser.printUsage(output, i18n.getBundle()); - System.exit(1); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - protected ServerConfig config; - - /** Field description */ - protected I18n i18n; - - /** Field description */ - protected BufferedReader input; - - /** Field description */ - protected PrintWriter output; - - /** Field description */ - private String commandName; - - /** Field description */ - @Option( - name = "--help", - usage = "optionHelpText", - aliases = { "-h" } - ) - private boolean help = false; - - /** Field description */ - private ScmClientSession session; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/SubCommandHandler.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/SubCommandHandler.java deleted file mode 100644 index 3f8e1f74fb..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/SubCommandHandler.java +++ /dev/null @@ -1,234 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.ConfigurationException; -import sonia.scm.util.IOUtil; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - -import java.net.URL; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -public class SubCommandHandler -{ - - /** Field description */ - public static final String RESOURCE_SERVICES = - "META-INF/services/".concat(SubCommand.class.getName()); - - /** Field description */ - private static volatile SubCommandHandler instance; - - /** the logger for SubCommandOptionHandler */ - private static final Logger logger = - LoggerFactory.getLogger(SubCommandOptionHandler.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - private SubCommandHandler() - { - subCommands = new HashMap(); - loadSubCommands(); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public static SubCommandHandler getInstance() - { - if (instance == null) - { - synchronized (SubCommandHandler.class) - { - if (instance == null) - { - instance = new SubCommandHandler(); - } - } - } - - return instance; - } - - /** - * Method description - * - * - * @param name - * - * @return - */ - public CommandDescriptor getDescriptor(String name) - { - return subCommands.get(name); - } - - /** - * Method description - * - * - * @return - */ - public List getDescriptors() - { - List descs = - new ArrayList(subCommands.values()); - - Collections.sort(descs); - - return descs; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param url - */ - private void loadSubCommand(URL url) - { - BufferedReader reader = null; - - try - { - reader = new BufferedReader(new InputStreamReader(url.openStream())); - - String line = reader.readLine(); - - while (line != null) - { - parseLine(line); - line = reader.readLine(); - } - } - catch (IOException ex) - { - logger.error("could not load commands"); - } - finally - { - IOUtil.close(reader); - } - } - - /** - * Method description - * - */ - private void loadSubCommands() - { - try - { - Enumeration enm = - SubCommandHandler.class.getClassLoader().getResources( - RESOURCE_SERVICES); - - while (enm.hasMoreElements()) - { - URL url = enm.nextElement(); - - loadSubCommand(url); - } - } - catch (IOException ex) - { - throw new ConfigurationException("could not load SubComamnds", ex); - } - } - - /** - * Method description - * - * - * @param line - */ - @SuppressWarnings("unchecked") - private void parseLine(String line) - { - line = line.trim(); - - if (Util.isNotEmpty(line) &&!line.startsWith("#")) - { - try - { - Class clazz = - (Class) Class.forName(line); - CommandDescriptor desc = new CommandDescriptor(clazz); - - subCommands.put(desc.getName(), desc); - } - catch (ClassNotFoundException ex) - { - logger.warn("could not found command class {}", line); - } - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private Map subCommands; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/SubCommandOptionHandler.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/SubCommandOptionHandler.java deleted file mode 100644 index dd219e557c..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/SubCommandOptionHandler.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.CmdLineException; -import org.kohsuke.args4j.CmdLineParser; -import org.kohsuke.args4j.Localizable; -import org.kohsuke.args4j.OptionDef; -import org.kohsuke.args4j.spi.Messages; -import org.kohsuke.args4j.spi.OptionHandler; -import org.kohsuke.args4j.spi.Parameters; -import org.kohsuke.args4j.spi.Setter; - -import sonia.scm.cli.SimpleLocalizable; - -/** - * - * @author Sebastian Sdorra - */ -public class SubCommandOptionHandler extends OptionHandler -{ - - /** - * Constructs ... - * - * - * @param parser - * @param option - * @param setter - */ - public SubCommandOptionHandler(CmdLineParser parser, OptionDef option, - Setter setter) - { - super(parser, option, setter); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * - * @param parameters - * - * @return - * - * @throws CmdLineException - */ - @Override - public int parseArguments(Parameters parameters) throws CmdLineException - { - String name = parameters.getParameter(0); - CommandDescriptor desc = - SubCommandHandler.getInstance().getDescriptor(name); - - if (desc != null) - { - owner.stopOptionParsing(); - setter.addValue(desc.createSubCommand()); - } - else - { - String msg = "command ".concat(name).concat(" not found"); - - throw new CmdLineException(owner, new SimpleLocalizable(msg)); - } - - return 1; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public String getDefaultMetaVariable() - { - return "command"; - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/TemplateSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/TemplateSubCommand.java deleted file mode 100644 index b9d985b3b9..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/TemplateSubCommand.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import freemarker.template.Configuration; -import freemarker.template.Template; -import freemarker.template.TemplateException; - -import org.kohsuke.args4j.Option; - -import sonia.scm.ConfigurationException; -import sonia.scm.util.IOUtil; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.StringReader; - -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class TemplateSubCommand extends SubCommand -{ - - /** - * Method description - * - * - * @return - */ - public String getTemplate() - { - return template; - } - - /** - * Method description - * - * - * @return - */ - public File getTemplateFile() - { - return templateFile; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param template - */ - public void setTemplate(String template) - { - this.template = template; - } - - /** - * Method description - * - * - * @param templateFile - */ - public void setTemplateFile(File templateFile) - { - this.templateFile = templateFile; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param env - * @param defaultTemplate - */ - protected void renderTemplate(Map env, String defaultTemplate) - { - Configuration configuration = new Configuration(Configuration.VERSION_2_3_20); - Reader reader = null; - - try - { - if ((templateFile != null) && templateFile.exists()) - { - reader = new FileReader(templateFile); - } - else if (Util.isNotEmpty(template)) - { - reader = new StringReader(template); - } - else - { - reader = new InputStreamReader( - TemplateSubCommand.class.getResourceAsStream(defaultTemplate)); - } - - Template tpl = new Template("default-template", reader, configuration); - - tpl.process(env, output); - } - catch (TemplateException | IOException ex) - { - throw new ConfigurationException("could not render template", ex); - } - finally - { - IOUtil.close(reader); - } - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @Option(name = "--template", usage = "optionTemplate") - private String template; - - /** Field description */ - @Option(name = "--template-file", usage = "optionTemplateFile") - private File templateFile; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/VersionSubCommand.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/VersionSubCommand.java deleted file mode 100644 index 285739f2c2..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/cmd/VersionSubCommand.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.cmd; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.util.IOUtil; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; -import java.io.InputStream; - -import java.util.Properties; - -/** - * - * @author Sebastian Sdorra - * @since 1.9 - */ -@Command( - name = "version", - usage = "usageVersion", - group = "misc" -) -public class VersionSubCommand extends SubCommand -{ - - /** Default version {@link String} */ - public static final String DEFAULT_VERSION = "unknown"; - - /** Path to the maven properties file of the scm-core artifact */ - public static final String MAVEN_PROPERTIES = - "/META-INF/maven/sonia.scm.clients/scm-cli-client/pom.properties"; - - /** Maven property for the version of the artifact */ - public static final String MAVEN_PROPERTY_VERSION = "version"; - - /** the logger for VersionSubCommand */ - private static final Logger logger = - LoggerFactory.getLogger(VersionSubCommand.class); - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Override - protected void run() - { - String version = getVersion(); - - output.append("scm-cli-client version: ").println(version); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - private String getVersion() - { - String version = null; - InputStream stream = null; - - try - { - stream = VersionSubCommand.class.getResourceAsStream(MAVEN_PROPERTIES); - - if (stream != null) - { - Properties properties = new Properties(); - - properties.load(stream); - version = properties.getProperty(MAVEN_PROPERTY_VERSION); - } - } - catch (IOException ex) - { - logger.warn("could not parse maven.properties", ex); - } - finally - { - IOUtil.close(stream); - } - - if (Util.isEmpty(version)) - { - version = DEFAULT_VERSION; - } - - return version; - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ConfigOptionHandler.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ConfigOptionHandler.java deleted file mode 100644 index 15e030b8bc..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ConfigOptionHandler.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.config; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.kohsuke.args4j.CmdLineException; -import org.kohsuke.args4j.CmdLineParser; -import org.kohsuke.args4j.OptionDef; -import org.kohsuke.args4j.spi.OptionHandler; -import org.kohsuke.args4j.spi.Parameters; -import org.kohsuke.args4j.spi.Setter; - -/** - * - * @author Sebastian Sdorra - */ -public class ConfigOptionHandler extends OptionHandler -{ - - /** - * Constructs ... - * - * - * @param parser - * @param option - * @param setter - */ - public ConfigOptionHandler(CmdLineParser parser, OptionDef option, - Setter setter) - { - super(parser, option, setter); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param parameters - * - * @return - * - * @throws CmdLineException - */ - @Override - public int parseArguments(Parameters parameters) throws CmdLineException - { - String name = parameters.getParameter(0); - ServerConfig config = ScmClientConfig.getInstance().getConfig(name); - - setter.addValue(config); - - return 1; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public String getDefaultMetaVariable() - { - return "metaVar_config"; - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ScmClientConfig.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ScmClientConfig.java deleted file mode 100644 index 9edb2b382a..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ScmClientConfig.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.config; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -/** - * - * @author Sebastian Sdorra - */ -@XmlRootElement(name = "client-config") -@XmlAccessorType(XmlAccessType.FIELD) -public class ScmClientConfig -{ - - /** Field description */ - public static final String DEFAULT_NAME = "default"; - - /** Field description */ - private static volatile ScmClientConfig instance; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - private ScmClientConfig() - { - this.serverConfigMap = new HashMap(); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public static ScmClientConfig getInstance() - { - if (instance == null) - { - synchronized (ScmClientConfig.class) - { - if (instance == null) - { - instance = load(); - } - } - } - - return instance; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - private static ScmClientConfig load() - { - ScmClientConfigFileHandler fileHandler = new ScmClientConfigFileHandler(); - ScmClientConfig config = fileHandler.read(); - - if (config == null) - { - config = new ScmClientConfig(); - } - - config.setFileHandler(fileHandler); - - return config; - } - - /** - * Method description - * - */ - public void delete() - { - fileHandler.delete(); - } - - /** - * Method description - * - */ - public void store() - { - fileHandler.write(this); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param name - * - * @return - */ - public ServerConfig getConfig(String name) - { - ServerConfig config = serverConfigMap.get(name); - - if (config == null) - { - config = new ServerConfig(); - serverConfigMap.put(name, config); - } - - return config; - } - - /** - * Method description - * - * - * @return - */ - public ServerConfig getDefaultConfig() - { - return getConfig(DEFAULT_NAME); - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param fileHandler - */ - private void setFileHandler(ScmClientConfigFileHandler fileHandler) - { - this.fileHandler = fileHandler; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @XmlTransient - private ScmClientConfigFileHandler fileHandler; - - /** Field description */ - @XmlElement(name = "server-config") - @XmlJavaTypeAdapter(XmlConfigAdapter.class) - private Map serverConfigMap; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ScmClientConfigFileHandler.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ScmClientConfigFileHandler.java deleted file mode 100644 index 5cc2c46978..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ScmClientConfigFileHandler.java +++ /dev/null @@ -1,306 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.config; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.IOUtil; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; - -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.spec.InvalidKeySpecException; - -import java.util.UUID; -import java.util.prefs.Preferences; - -import javax.crypto.Cipher; -import javax.crypto.CipherInputStream; -import javax.crypto.CipherOutputStream; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.SecretKey; -import javax.crypto.SecretKeyFactory; -import javax.crypto.spec.PBEKeySpec; -import javax.crypto.spec.PBEParameterSpec; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.bind.Unmarshaller; - -/** - * - * @author Sebastian Sdorra - */ -public class ScmClientConfigFileHandler -{ - - /** Field description */ - public static final String DEFAULT_CONFIG_NAME = ".scm-cli-config.enc.xml"; - - /** Field description */ - public static final String ENV_CONFIG_FILE = "SCM_CLI_CONFIG"; - - /** Field description */ - public static final String PREF_SECRET_KEY = "scm.client.key"; - - /** Field description */ - public static final String SALT = "AE16347F"; - - /** Field description */ - public static final int SPEC_ITERATION = 12; - - /** Field description */ - private static final String CIPHER_NAME = "PBEWithMD5AndDES"; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - public ScmClientConfigFileHandler() - { - prefs = Preferences.userNodeForPackage(ScmClientConfigFileHandler.class); - key = prefs.get(PREF_SECRET_KEY, null); - - if (Util.isEmpty(key)) - { - key = createNewKey(); - prefs.put(PREF_SECRET_KEY, key); - } - - try - { - context = JAXBContext.newInstance(ScmClientConfig.class); - } - catch (JAXBException ex) - { - throw new ScmConfigException( - "could not create JAXBContext for ScmClientConfig", ex); - } - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - public void delete() - { - File configFile = getConfigFile(); - - if (configFile.exists() &&!configFile.delete()) - { - throw new ScmConfigException("could not delete config file"); - } - - prefs.remove(PREF_SECRET_KEY); - } - - /** - * Method description - * - * - * @return - */ - public ScmClientConfig read() - { - ScmClientConfig config = null; - File configFile = getConfigFile(); - - if (configFile.exists()) - { - InputStream input = null; - - try - { - Cipher c = createCipher(Cipher.DECRYPT_MODE); - - input = new CipherInputStream(new FileInputStream(configFile), c); - - Unmarshaller um = context.createUnmarshaller(); - - config = (ScmClientConfig) um.unmarshal(input); - } - catch (Exception ex) - { - throw new ScmConfigException("could not read config file", ex); - } - finally - { - IOUtil.close(input); - } - } - - return config; - } - - /** - * Method description - * - * - * @param config - */ - public void write(ScmClientConfig config) - { - File configFile = getConfigFile(); - OutputStream output = null; - - try - { - Cipher c = createCipher(Cipher.ENCRYPT_MODE); - - output = new CipherOutputStream(new FileOutputStream(configFile), c); - - Marshaller m = context.createMarshaller(); - - m.marshal(config, output); - } - catch (Exception ex) - { - throw new ScmConfigException("could not write config file", ex); - } - finally - { - IOUtil.close(output); - } - } - - /** - * Method description - * - * - * @param mode - * - * @return - * - * - * @throws InvalidAlgorithmParameterException - * @throws InvalidKeyException - * @throws InvalidKeySpecException - * @throws NoSuchAlgorithmException - * @throws NoSuchPaddingException - */ - private Cipher createCipher(int mode) - throws NoSuchAlgorithmException, NoSuchPaddingException, - InvalidKeySpecException, InvalidKeyException, - InvalidAlgorithmParameterException - { - SecretKey sk = createSecretKey(); - Cipher cipher = Cipher.getInstance(CIPHER_NAME); - PBEParameterSpec spec = new PBEParameterSpec(SALT.getBytes(), - SPEC_ITERATION); - - cipher.init(mode, sk, spec); - - return cipher; - } - - /** - * Method description - * - * - * @return - */ - private String createNewKey() - { - return UUID.randomUUID().toString(); - } - - /** - * Method description - * - * - * @return - * - * @throws InvalidKeySpecException - * @throws NoSuchAlgorithmException - */ - private SecretKey createSecretKey() - throws NoSuchAlgorithmException, InvalidKeySpecException - { - PBEKeySpec keySpec = new PBEKeySpec(key.toCharArray()); - SecretKeyFactory factory = SecretKeyFactory.getInstance(CIPHER_NAME); - - return factory.generateSecret(keySpec); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - private File getConfigFile() - { - File configFile = null; - String configPath = System.getenv(ENV_CONFIG_FILE); - - if (Util.isEmpty(configPath)) - { - configFile = new File(System.getProperty("user.home"), - DEFAULT_CONFIG_NAME); - } - else - { - configFile = new File(configPath); - } - - return configFile; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private JAXBContext context; - - /** Field description */ - private String key; - - /** Field description */ - private Preferences prefs; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ScmConfigException.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ScmConfigException.java deleted file mode 100644 index 33fbef093e..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ScmConfigException.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.config; - -/** - * - * @author Sebastian Sdorra - */ -public class ScmConfigException extends RuntimeException -{ - - /** Field description */ - private static final long serialVersionUID = -4226165375815233654L; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - public ScmConfigException() - { - super(); - } - - /** - * Constructs ... - * - * - * @param message - */ - public ScmConfigException(String message) - { - super(message); - } - - /** - * Constructs ... - * - * - * @param cause - */ - public ScmConfigException(Throwable cause) - { - super(cause); - } - - /** - * Constructs ... - * - * - * @param message - * @param cause - */ - public ScmConfigException(String message, Throwable cause) - { - super(message, cause); - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ServerConfig.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ServerConfig.java deleted file mode 100644 index c7fb4108c5..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/ServerConfig.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.config; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.Validateable; - -/** - * - * @author Sebastian Sdorra - */ -public class ServerConfig implements Validateable -{ - - /** - * Constructs ... - * - */ - public ServerConfig() {} - - /** - * Constructs ... - * - * - * @param serverUrl - * @param username - * @param password - */ - public ServerConfig(String serverUrl, String username, String password) - { - this.serverUrl = serverUrl; - this.username = username; - this.password = password; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getPassword() - { - return password; - } - - /** - * Method description - * - * - * @return - */ - public String getServerUrl() - { - return serverUrl; - } - - /** - * Method description - * - * - * @return - */ - public String getUsername() - { - return username; - } - - /** - * Method description - * - * - * @return - */ - @Override - public boolean isValid() - { - - // TODO - return true; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param password - */ - public void setPassword(String password) - { - this.password = password; - } - - /** - * Method description - * - * - * @param serverUrl - */ - public void setServerUrl(String serverUrl) - { - this.serverUrl = serverUrl; - } - - /** - * Method description - * - * - * @param username - */ - public void setUsername(String username) - { - this.username = username; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private String password; - - /** Field description */ - private String serverUrl; - - /** Field description */ - private String username; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/XmlConfigAdapter.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/XmlConfigAdapter.java deleted file mode 100644 index fcf109d879..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/XmlConfigAdapter.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.config; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.xml.bind.annotation.adapters.XmlAdapter; - -/** - * - * @author Sebastian Sdorra - */ -public class XmlConfigAdapter - extends XmlAdapter> -{ - - /** - * Method description - * - * - * @param map - * - * @return - * - * @throws Exception - */ - @Override - public XmlConfigSet marshal(Map map) throws Exception - { - Set set = new HashSet(); - - for (Map.Entry e : map.entrySet()) - { - set.add(new XmlConfigElement(e.getKey(), e.getValue())); - } - - return new XmlConfigSet(set); - } - - /** - * Method description - * - * - * @param set - * - * @return - * - * @throws Exception - */ - @Override - public Map unmarshal(XmlConfigSet set) throws Exception - { - Map map = new HashMap(); - - for (XmlConfigElement e : set) - { - map.put(e.getName(), e.getConfig()); - } - - return map; - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/XmlConfigElement.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/XmlConfigElement.java deleted file mode 100644 index f4e3eb2c04..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/XmlConfigElement.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.config; - -//~--- JDK imports ------------------------------------------------------------ - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -/** - * - * @author Sebastian Sdorra - */ -@XmlRootElement(name = "server") -@XmlAccessorType(XmlAccessType.FIELD) -public class XmlConfigElement -{ - - /** - * Constructs ... - * - */ - public XmlConfigElement() {} - - /** - * Constructs ... - * - * - * @param name - * @param config - */ - public XmlConfigElement(String name, ServerConfig config) - { - this.name = name; - this.config = config; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public ServerConfig getConfig() - { - return config; - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param config - */ - public void setConfig(ServerConfig config) - { - this.config = config; - } - - /** - * Method description - * - * - * @param name - */ - public void setName(String name) - { - this.name = name; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @XmlElement(name = "server-config") - private ServerConfig config; - - /** Field description */ - private String name; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/XmlConfigSet.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/XmlConfigSet.java deleted file mode 100644 index 9bd3370775..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/config/XmlConfigSet.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.config; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Iterator; -import java.util.Set; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -/** - * - * @author Sebastian Sdorra - */ -@XmlRootElement(name = "server-config") -@XmlAccessorType(XmlAccessType.FIELD) -public class XmlConfigSet implements Iterable -{ - - /** - * Constructs ... - * - */ - public XmlConfigSet() {} - - /** - * Constructs ... - * - * - * @param configSet - */ - public XmlConfigSet(Set configSet) - { - this.configSet = configSet; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public Iterator iterator() - { - return configSet.iterator(); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public Set getConfigSet() - { - return configSet; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param configSet - */ - public void setConfigSet(Set configSet) - { - this.configSet = configSet; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - @XmlElement(name = "server") - private Set configSet; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/AbstractWrapper.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/AbstractWrapper.java deleted file mode 100644 index 0e72aec28e..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/AbstractWrapper.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.wrapper; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Date; - -/** - * - * @author Sebastian Sdorra - */ -public class AbstractWrapper -{ - - /** - * Method description - * - * - * @param value - * - * @return - */ - protected Date getDate(Long value) - { - Date date = null; - - if (value != null) - { - date = new Date(value); - } - - return date; - } -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/GroupWrapper.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/GroupWrapper.java deleted file mode 100644 index d26225b5f7..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/GroupWrapper.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.wrapper; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.group.Group; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Date; -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -public class GroupWrapper extends AbstractWrapper -{ - - /** - * Constructs ... - * - * - * @param group - */ - public GroupWrapper(Group group) - { - this.group = group; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public Date getCreationDate() - { - return getDate(group.getCreationDate()); - } - - /** - * Method description - * - * - * @return - */ - public String getDescription() - { - return group.getDescription(); - } - - /** - * Method description - * - * - * @return - */ - public String getId() - { - return group.getId(); - } - - /** - * Method description - * - * - * @return - */ - public Date getLastModified() - { - return getDate(group.getLastModified()); - } - - /** - * Method description - * - * - * @return - */ - public List getMembers() - { - return group.getMembers(); - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return group.getName(); - } - - /** - * Method description - * - * - * @return - */ - public String getType() - { - return group.getType(); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private Group group; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/RepositoryWrapper.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/RepositoryWrapper.java deleted file mode 100644 index 216afde624..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/RepositoryWrapper.java +++ /dev/null @@ -1,210 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.wrapper; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.cli.config.ServerConfig; -import sonia.scm.repository.Permission; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Date; -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -public class RepositoryWrapper extends AbstractWrapper -{ - - /** - * Constructs ... - * - * - * @param config - * @param repository - */ - public RepositoryWrapper(ServerConfig config, Repository repository) - { - this(config.getServerUrl(), repository); - } - - /** - * Constructs ... - * - * - * - * @param baseUrl - * @param repository - */ - public RepositoryWrapper(String baseUrl, Repository repository) - { - this.baseUrl = baseUrl; - this.repository = repository; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getContact() - { - return repository.getContact(); - } - - /** - * Method description - * - * - * @return - */ - public Date getCreationDate() - { - return getDate(repository.getCreationDate()); - } - - /** - * Method description - * - * - * @return - */ - public String getDescription() - { - return repository.getDescription(); - } - - /** - * Method description - * - * - * @return - */ - public String getId() - { - return repository.getId(); - } - - /** - * Method description - * - * - * @return - */ - public Date getLastModified() - { - return getDate(repository.getLastModified()); - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return repository.getName(); - } - - /** - * Method description - * - * - * @return - */ - public List getPermissions() - { - return repository.getPermissions(); - } - - /** - * Method description - * - * - * @return - */ - public String getType() - { - return repository.getType(); - } - - /** - * Method description - * - * - * @return - */ - public String getUrl() - { - return repository.createUrl(baseUrl); - } - - /** - * Method description - * - * - * @return - */ - public boolean isArchived() - { - return repository.isArchived(); - } - - /** - * Method description - * - * - * @return - */ - public boolean isPublicReadable() - { - return repository.isPublicReadable(); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private String baseUrl; - - /** Field description */ - private Repository repository; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/UserWrapper.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/UserWrapper.java deleted file mode 100644 index 55ccc6681c..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/UserWrapper.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.wrapper; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.user.User; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Date; - -/** - * - * @author Sebastian Sdorra - */ -public class UserWrapper extends AbstractWrapper -{ - - /** - * Constructs ... - * - * - * @param user - */ - public UserWrapper(User user) - { - this.user = user; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public Date getCreationDate() - { - return getDate(user.getCreationDate()); - } - - /** - * Method description - * - * - * @return - */ - public String getDisplayName() - { - return user.getDisplayName(); - } - - /** - * Method description - * - * - * @return - */ - public String getId() - { - return user.getId(); - } - - /** - * Method description - * - * - * @return - */ - public Date getLastModified() - { - return getDate(user.getLastModified()); - } - - /** - * Method description - * - * - * @return - */ - public String getMail() - { - return user.getMail(); - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return user.getName(); - } - - /** - * Method description - * - * - * @return - */ - public String getType() - { - return user.getType(); - } - - /** - * Method description - * - * - * @return - */ - public boolean isAdmin() - { - return user.isAdmin(); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private User user; -} diff --git a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/WrapperUtil.java b/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/WrapperUtil.java deleted file mode 100644 index 0c87424fe6..0000000000 --- a/scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/WrapperUtil.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli.wrapper; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.cli.config.ServerConfig; -import sonia.scm.group.Group; -import sonia.scm.repository.Repository; -import sonia.scm.user.User; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -public final class WrapperUtil -{ - - /** - * Constructs ... - * - */ - private WrapperUtil() {} - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param groups - * - * @return - */ - public static List wrapGroups(Collection groups) - { - List wrappers = new ArrayList(); - - for (Group g : groups) - { - wrappers.add(new GroupWrapper(g)); - } - - return wrappers; - } - - /** - * Method description - * - * - * - * - * @param config - * @param repositories - * - * @return - */ - public static List wrapRepositories(ServerConfig config, - Collection repositories) - { - List wrappers = new ArrayList(); - - for (Repository r : repositories) - { - wrappers.add(new RepositoryWrapper(config.getServerUrl(), r)); - } - - return wrappers; - } - - /** - * Method description - * - * - * @param users - * - * @return - */ - public static List wrapUsers(Collection users) - { - List wrappers = new ArrayList(); - - for (User u : users) - { - wrappers.add(new UserWrapper(u)); - } - - return wrappers; - } -} diff --git a/scm-clients/scm-cli-client/src/main/resources/META-INF/services/sonia.scm.cli.cmd.SubCommand b/scm-clients/scm-cli-client/src/main/resources/META-INF/services/sonia.scm.cli.cmd.SubCommand deleted file mode 100644 index 91f2345948..0000000000 --- a/scm-clients/scm-cli-client/src/main/resources/META-INF/services/sonia.scm.cli.cmd.SubCommand +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) 2010, Sebastian Sdorra -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# 3. Neither the name of SCM-Manager; nor the names of its -# contributors may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# http://bitbucket.org/sdorra/scm-manager -# - -# config -sonia.scm.cli.cmd.StoreConfigSubCommand -sonia.scm.cli.cmd.DeleteConfigSubCommand - -# repository -sonia.scm.cli.cmd.CreateRepositorySubCommand -sonia.scm.cli.cmd.ModifyRepositorySubCommand -sonia.scm.cli.cmd.GetRepositorySubCommand -sonia.scm.cli.cmd.ListRepositoriesSubCommand -sonia.scm.cli.cmd.DeleteRepositorySubCommand -sonia.scm.cli.cmd.ImportDirectorySubCommand -sonia.scm.cli.cmd.ImportUrlSubCommand -sonia.scm.cli.cmd.ImportBundleSubCommand - -# permission -sonia.scm.cli.cmd.AddPermissionSubCommand -sonia.scm.cli.cmd.DeletePermissionSubCommand - -# user -sonia.scm.cli.cmd.ListUsersSubCommand -sonia.scm.cli.cmd.GetUserSubCommand -sonia.scm.cli.cmd.CreateUserSubCommand -sonia.scm.cli.cmd.DeleteUserSubCommand -sonia.scm.cli.cmd.ModifyUserSubCommand - -# group -sonia.scm.cli.cmd.ListGroupsSubCommand -sonia.scm.cli.cmd.GetGroupSubCommand -sonia.scm.cli.cmd.CreateGroupSubCommand -sonia.scm.cli.cmd.DeleteGroupSubCommand -sonia.scm.cli.cmd.ModifyGroupSubCommand - -# member -sonia.scm.cli.cmd.AddMembersSubCommand -sonia.scm.cli.cmd.DeleteMembersSubCommand - -# security -sonia.scm.cli.cmd.EncryptSubCommand -sonia.scm.cli.cmd.GenerateKeySubCommand - -# misc -sonia.scm.cli.cmd.VersionSubCommand -sonia.scm.cli.cmd.ServerVersionSubCommand diff --git a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/get-group.ftl b/scm-clients/scm-cli-client/src/main/resources/sonia/resources/get-group.ftl deleted file mode 100644 index 6126b6d81f..0000000000 --- a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/get-group.ftl +++ /dev/null @@ -1,11 +0,0 @@ -Name: ${group.name} -Type: ${group.type} -Description: ${group.description!""} -Creation-Date: <#if group.creationDate??>${group.creationDate?string("yyyy-MM-dd HH:mm:ss")} -Last-Modified: <#if group.lastModified??>${group.lastModified?string("yyyy-MM-dd HH:mm:ss")} -Members: -<#if group.members??> -<#list group.members as member> - ${member} - - diff --git a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/get-repository.ftl b/scm-clients/scm-cli-client/src/main/resources/sonia/resources/get-repository.ftl deleted file mode 100644 index 7ac5d4c38f..0000000000 --- a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/get-repository.ftl +++ /dev/null @@ -1,16 +0,0 @@ -ID: ${repository.id} -Name: ${repository.name} -Type: ${repository.type} -E-Mail: ${repository.contact!""} -Description: ${repository.description!""} -Public: ${repository.publicReadable?string} -Archived: ${repository.archived?string} -Creation-Date: <#if repository.creationDate??>${repository.creationDate?string("yyyy-MM-dd HH:mm:ss")} -Last-Modified: <#if repository.lastModified??>${repository.lastModified?string("yyyy-MM-dd HH:mm:ss")} -URL: ${repository.url} -Permissions: -<#if repository.permissions??> -<#list repository.permissions as permission> - ${permission.type} - ${permission.name} (Group: ${permission.groupPermission?string}) - - diff --git a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/get-user.ftl b/scm-clients/scm-cli-client/src/main/resources/sonia/resources/get-user.ftl deleted file mode 100644 index 45f08e56d1..0000000000 --- a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/get-user.ftl +++ /dev/null @@ -1,8 +0,0 @@ -Name: ${user.name} -Display Name: ${user.displayName} -Type: ${user.type} -E-Mail: ${user.mail!""} -Active: ${user.admin?string} -Administrator: ${user.admin?string} -Creation-Date: <#if user.creationDate??>${user.creationDate?string("yyyy-MM-dd HH:mm:ss")} -Last-Modified: <#if user.lastModified??>${user.lastModified?string("yyyy-MM-dd HH:mm:ss")} diff --git a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/i18n.properties b/scm-clients/scm-cli-client/src/main/resources/sonia/resources/i18n.properties deleted file mode 100644 index 9d6afd3dda..0000000000 --- a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/i18n.properties +++ /dev/null @@ -1,131 +0,0 @@ -# -# Copyright (c) 2010, Sebastian Sdorra -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# 3. Neither the name of SCM-Manager; nor the names of its -# contributors may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# http://bitbucket.org/sdorra/scm-manager -# -# - -VAL = value -FILE = file -error = Error - -subCommandsTitle = list of commands - -optionConfig = Configuration name -optionServerUrl = SCM-Manager URL -optionUsername = Username -optionPassword = Password -optionHelpText = Shows this help -optionLoggingLevel = Logging level (DEBUG, INFO, WARN, ERROR) -optionTemplate = Template -optionTemplateFile = Template file -optionRepositoryId = Repository Id -optionRepositoryIdOrTypeAndName = Repository Id or type/name -optionRepositoryName = Repository name -optionRepositoryType = Repository type -optionRepositoryContact = Repository contact -optionRepositoryDescription = Repository description -optionRepositoryPublic = Repository public readable -optionRepositoryArchive = Repository archived -optionRemoteRepositoryUrl = Remote repository url -optionRepositoryBundle = Import repository from a bundle file (e.g. svn dump) -optionRepositoryBundleCompressed = Indicates that the bundle is gzip compressed - -optionPermissionGroup = Group -optionPermissionName = Group or user name -optionPermissionType = Permission type (READ,WRITE or OWNER) - -optionUserName = Username -optionUserDisplayName = Display name -optionUserMail = E-Mail address -optionUserPassword = Password -optionUserType = Type -optionUserAdmin = Administrator - -optionGroupName = Name of the group -optionGroupDescription = Description -optionGroupType = Type -optionGroupMember = Member - -optionEncryptValue = value to encrypt - -repositoryNotFound = The repository is not available -userNotFound = The user could not be found -groupNotFoun = The group could not be found - -config = configname -arg = subcommand arguments -command = subcommand -permissiontype = value -groupname = groupname -repositoryid = repositoryid -username = username -repositorytype = type - -config = Configuration -misc = Miscellaneous -repository = Repository -group = Group -user = User -security = Security -level = Logging-Level -boolean = true or false -URL = url -bundle = file - -options = Options -usage = scm-cli-client [options] command [command options] - -# usages -usageAddMember = Add members to a existing group -usageAddPermission = Add permission to a existing repository -usageCreateGroup = Create a new group -usageCreateRepository = Create a new repository -usageCreateUser = Create a new user -usageDeleteConfig = Delete all stored configurations -usageDeleteGroup = Delete a group -usageDeleteMembers = Delete members of a group -usageDeletePermission = Delete a permission of a repository -usageDeleteRepository = Delete a repository -usageDeleteUser = Delete a user -usageGetGroup = Print a group -usageGetRepository = Print a repository -usageGetUser = Print a user -usageListGroups= Print a list of all groups -usageListUsers= Print a list of all users -usageListRepositories= Print a list of all repositories -usageModifyGroup = Modify a group -usageModifyUser = Modify a user -usageModifyRepository = Modify a repository -usageStoreConfig = Stores the current configuration -usageVersion = Show the version of scm-cli-client -usageServerVersion = Show the version of the scm-manager -usageImportDirectory = Import repositories from repository directory -usageImportUrl = Import repository from remote url - -usageEncrypt = Encrypts the given value -usageGenerateKey = Generates a unique key \ No newline at end of file diff --git a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/import-from-directory.ftl b/scm-clients/scm-cli-client/src/main/resources/sonia/resources/import-from-directory.ftl deleted file mode 100644 index 33cf9e083e..0000000000 --- a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/import-from-directory.ftl +++ /dev/null @@ -1,9 +0,0 @@ -Imported repositories: -<#list importedDirectories as imported> -- ${imported} - - -Repositories failed to import: -<#list failedDirectories as failed> -- ${failed} - \ No newline at end of file diff --git a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/list-groups.ftl b/scm-clients/scm-cli-client/src/main/resources/sonia/resources/list-groups.ftl deleted file mode 100644 index b25340f8f1..0000000000 --- a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/list-groups.ftl +++ /dev/null @@ -1,14 +0,0 @@ -<#list groups as group> -Name: ${group.name} -Type: ${group.type} -Description: ${group.description!""} -Creation-Date: <#if group.creationDate??>${group.creationDate?string("yyyy-MM-dd HH:mm:ss")} -Last-Modified: <#if group.lastModified??>${group.lastModified?string("yyyy-MM-dd HH:mm:ss")} -Members: -<#if group.members??> -<#list group.members as member> - ${member} - - - - \ No newline at end of file diff --git a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/list-repositories.ftl b/scm-clients/scm-cli-client/src/main/resources/sonia/resources/list-repositories.ftl deleted file mode 100644 index c78c51b505..0000000000 --- a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/list-repositories.ftl +++ /dev/null @@ -1,19 +0,0 @@ -<#list repositories as repository> -ID: ${repository.id} -Name: ${repository.name} -Type: ${repository.type} -E-Mail: ${repository.contact!""} -Description: ${repository.description!""} -Public: ${repository.publicReadable?string} -Archived: ${repository.archived?string} -Creation-Date: <#if repository.creationDate??>${repository.creationDate?string("yyyy-MM-dd HH:mm:ss")} -Last-Modified: <#if repository.lastModified??>${repository.lastModified?string("yyyy-MM-dd HH:mm:ss")} -URL: ${repository.url} -Permissions: -<#if repository.permissions??> -<#list repository.permissions as permission> - ${permission.type} - ${permission.name} (Group: ${permission.groupPermission?string}) - - - - diff --git a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/list-users.ftl b/scm-clients/scm-cli-client/src/main/resources/sonia/resources/list-users.ftl deleted file mode 100644 index eab8106c3c..0000000000 --- a/scm-clients/scm-cli-client/src/main/resources/sonia/resources/list-users.ftl +++ /dev/null @@ -1,11 +0,0 @@ -<#list users as user> -Name: ${user.name} -Display Name: ${user.displayName} -Type: ${user.type} -E-Mail: ${user.mail!""} -Active: ${user.admin?string} -Administrator: ${user.admin?string} -Creation-Date: <#if user.creationDate??>${user.creationDate?string("yyyy-MM-dd HH:mm:ss")} -Last-Modified: <#if user.lastModified??>${user.lastModified?string("yyyy-MM-dd HH:mm:ss")} - - diff --git a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/AbstractITCaseBase.java b/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/AbstractITCaseBase.java deleted file mode 100644 index 5184ea37ed..0000000000 --- a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/AbstractITCaseBase.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.common.collect.Lists; -import com.google.common.io.Closeables; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -import java.util.Arrays; -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class AbstractITCaseBase -{ - - /** - * Method description - * - * - * @param cmd - * - * @return - * - * @throws IOException - */ - protected String execute(String... cmd) throws IOException - { - String result = null; - ByteArrayInputStream inputStream = null; - ByteArrayOutputStream outputStream = null; - - try - { - inputStream = new ByteArrayInputStream(new byte[0]); - outputStream = new ByteArrayOutputStream(); - - App app = new App(inputStream, outputStream); - - app.run(cmd); - - outputStream.flush(); - result = outputStream.toString().trim(); - } - finally - { - Closeables.close(inputStream, true); - Closeables.close(outputStream, true); - } - - return result; - } - - /** - * Method description - * - * - * @param cmd - * - * @return - * - * @throws IOException - */ - protected String executeServer(String... cmd) throws IOException - { - List cmdList = Lists.newArrayList(); - - cmdList.add("--server"); - cmdList.add("http://localhost:8081/scm"); - cmdList.add("--user"); - cmdList.add("scmadmin"); - cmdList.add("--password"); - cmdList.add("scmadmin"); - cmdList.addAll(Arrays.asList(cmd)); - - return execute(cmdList.toArray(new String[cmdList.size()])); - } - - /** - * Method description - * - * - * @param values - * - * @return - */ - protected String prepareForTest(String values) - { - return values.replaceAll("\\n", ";").replaceAll("\\s+", ""); - } -} diff --git a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/RepositoriesITCase.java b/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/RepositoriesITCase.java deleted file mode 100644 index d09e912157..0000000000 --- a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/RepositoriesITCase.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import static org.hamcrest.Matchers.*; - -import static org.junit.Assert.*; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * - * @author Sebastian Sdorra - */ -public class RepositoriesITCase extends AbstractITCaseBase -{ - - /** - * Method description - * - * - * @throws IOException - */ - @Test - public void listRepositoriesTest() throws IOException - { - executeServer("create-repository", "--type", "git", "--name", "hobbo", - "--description", "Test Repo"); - - String repositories = prepareForTest(executeServer("list-repositories")); - - assertThat(repositories, containsString("Name:hobbo;")); - assertThat(repositories, containsString("Description:TestRepo;")); - assertThat(repositories, containsString("Type:git;")); - - Pattern pattern = Pattern.compile("ID:([^;]+);"); - Matcher matcher = pattern.matcher(repositories); - - if (!matcher.find()) - { - fail("could not extract id of repository"); - } - - String id = matcher.group(1); - - executeServer("delete-repository", id); - } -} diff --git a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/ServerVersionITCase.java b/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/ServerVersionITCase.java deleted file mode 100644 index 7e424587fb..0000000000 --- a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/ServerVersionITCase.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assume.assumeTrue; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; - -/** - * - * @author Sebastian Sdorra - */ -public class ServerVersionITCase extends AbstractITCaseBase -{ - - /** - * Method description - * - * - * @throws IOException - */ - @Test - public void testServerVersion() throws IOException - { - String systemVersion = System.getProperty("scm.version"); - - assumeTrue("skip test, because system property scm.version is not set", - systemVersion != null); - - String version = executeServer("server-version"); - - assertEquals("scm-manager version: ".concat(systemVersion), version); - } -} diff --git a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/UsersITCase.java b/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/UsersITCase.java deleted file mode 100644 index e5b29457a9..0000000000 --- a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/UsersITCase.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import static org.hamcrest.Matchers.*; - -import static org.junit.Assert.*; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; - -/** - * - * @author Sebastian Sdorra - */ -public class UsersITCase extends AbstractITCaseBase -{ - - /** - * Method description - * - * - * @throws IOException - */ - @Test - public void listUsersTest() throws IOException - { - String users = prepareForTest(executeServer("list-users")); - - assertThat(users, containsString("Name:scmadmin;")); - assertThat(users, containsString("DisplayName:SCMAdministrator;")); - assertThat(users, containsString("Type:xml;")); - assertThat(users, containsString("E-Mail:scm-admin@scm-manager.org;")); - assertThat(users, containsString("Active:true;")); - assertThat(users, containsString("Administrator:true;")); - System.out.println(users); - } -} diff --git a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/VersionITCase.java b/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/VersionITCase.java deleted file mode 100644 index 3d9563c34e..0000000000 --- a/scm-clients/scm-cli-client/src/test/java/sonia/scm/cli/VersionITCase.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.cli; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import static org.junit.Assert.*; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; - -/** - * - * @author Sebastian Sdorra - */ -public class VersionITCase extends AbstractITCaseBase -{ - - /** - * Method description - * - * - * @throws IOException - */ - @Test - public void testVersion() throws IOException - { - // maven properties are not available during it tests - String version = execute("version"); - - assertEquals("scm-cli-client version: unknown", version); - } -} diff --git a/scm-clients/scm-client-api/pom.xml b/scm-clients/scm-client-api/pom.xml deleted file mode 100644 index d2f8692ca7..0000000000 --- a/scm-clients/scm-client-api/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - 4.0.0 - - - sonia.scm.clients - scm-clients - 2.0.0-SNAPSHOT - - - sonia.scm.clients - scm-client-api - jar - 2.0.0-SNAPSHOT - scm-client-api - - - - - - - javax.servlet - javax.servlet-api - ${servlet.version} - provided - - - - javax.transaction - jta - 1.1 - provided - - - - - diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ClientChangesetHandler.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ClientChangesetHandler.java deleted file mode 100644 index 2207d2c6b9..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ClientChangesetHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.repository.Changeset; -import sonia.scm.repository.ChangesetPagingResult; - -/** - * - * @author Sebastian Sdorra - * @since 1.8 - */ -public interface ClientChangesetHandler -{ - - /** - * Method description - * - * - * @param revision - * - * @return - * - * @since 1.12 - */ - public Changeset getChangeset(String revision); - - /** - * Method description - * - * - * @param start - * @param limit - * - * @return - */ - public ChangesetPagingResult getChangesets(int start, int limit); - - /** - * @param path - * @param revision - * @param start - * @param limit - * @return - */ - public ChangesetPagingResult getChangesets(String path, String revision, - int start, int limit); -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ClientHandler.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ClientHandler.java deleted file mode 100644 index b178ab3680..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ClientHandler.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - * - * @param - */ -public interface ClientHandler -{ - - /** - * Method description - * - * - * - * @param item - */ - public void create(T item); - - /** - * Method description - * - * - * @param id - */ - public void delete(String id); - - /** - * Method description - * - * - * - * @param item - */ - public void delete(T item); - - /** - * Method description - * - * - * - * @param item - */ - public void modify(T item); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param id - * - * @return - */ - public T get(String id); - - /** - * Method description - * - * - * @return - */ - public List getAll(); -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ClientRepositoryBrowser.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ClientRepositoryBrowser.java deleted file mode 100644 index 5c1f753e63..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ClientRepositoryBrowser.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.repository.BlameLine; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; -import java.io.InputStream; - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - * @since 1.8 - */ -public interface ClientRepositoryBrowser -{ - - /** - * Method description - * - * - * @param revision - * @param path - * - * @return - */ - public List getBlameLines(String revision, String path); - - /** - * Method description - * - * - * @param revision - * @param path - * - * @return - * - * @throws IOException - */ - public InputStream getContent(String revision, String path) - throws IOException; - - /** - * Method description - * - * - * @param revision - * @param path - * - * @return - */ - public List getFiles(String revision, String path); - - /** - * Method description - * - * - * @param revision - * - * @return - */ - public List getFiles(String revision); -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/FileObjectWrapper.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/FileObjectWrapper.java deleted file mode 100644 index ddbeef69a3..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/FileObjectWrapper.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.repository.BlameLine; -import sonia.scm.repository.FileObject; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; -import java.io.InputStream; - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - * @since 1.8 - */ -public class FileObjectWrapper -{ - - /** - * Constructs ... - * - * - * - * @param repositoryBrowser - * @param revision - * @param file - */ - public FileObjectWrapper(ClientRepositoryBrowser repositoryBrowser, - String revision, FileObject file) - { - this.repositoryBrowser = repositoryBrowser; - this.revision = revision; - this.file = file; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public List getBlameLines() - { - return repositoryBrowser.getBlameLines(revision, getPath()); - } - - /** - * Method description - * - * - * @return - */ - public List getChildren() - { - List children = null; - - if (isDirectory()) - { - children = repositoryBrowser.getFiles(revision, getPath()); - } - - return children; - } - - /** - * Method description - * - * - * @return - * - * @throws IOException - */ - public InputStream getContent() throws IOException - { - return repositoryBrowser.getContent(revision, getPath()); - } - - /** - * Method description - * - * - * @return - */ - public String getDescription() - { - return file.getDescription(); - } - - /** - * Method description - * - * - * @return - */ - public Long getLastModified() - { - return file.getLastModified(); - } - - /** - * Method description - * - * - * @return - */ - public long getLength() - { - return file.getLength(); - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return file.getName(); - } - - /** - * Method description - * - * - * @return - */ - public String getPath() - { - return file.getPath(); - } - - /** - * Method description - * - * - * @return - */ - public boolean isDirectory() - { - return file.isDirectory(); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private FileObject file; - - /** Field description */ - private ClientRepositoryBrowser repositoryBrowser; - - /** Field description */ - private String revision; -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/GroupClientHandler.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/GroupClientHandler.java deleted file mode 100644 index 93fe52cc8d..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/GroupClientHandler.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.group.Group; - -/** - * - * @author Sebastian Sdorra - */ -public interface GroupClientHandler extends ClientHandler {} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ImportBundleRequest.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ImportBundleRequest.java deleted file mode 100644 index c6c9e71016..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ImportBundleRequest.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Copyright (c) 2014, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.common.io.ByteSource; - -/** - * - * @author Sebastian Sdorra - * @since 1.43 - */ -public class ImportBundleRequest -{ - - /** - * Constructs ... - * - */ - ImportBundleRequest() {} - - /** - * Constructs ... - * - * - * @param type - * @param name - * @param bundle - */ - public ImportBundleRequest(String type, String name, ByteSource bundle) - { - this.type = type; - this.name = name; - this.bundle = bundle; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public ByteSource getBundle() - { - return bundle; - } - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - /** - * Method description - * - * - * @return - */ - public String getType() - { - return type; - } - - /** - * Method description - * - * - * @return - */ - public boolean isCompressed() - { - return compressed; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param compressed - */ - public void setCompressed(boolean compressed) - { - this.compressed = compressed; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private ByteSource bundle; - - /** Field description */ - private boolean compressed = false; - - /** Field description */ - private String name; - - /** Field description */ - private String type; -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ImportResultWrapper.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ImportResultWrapper.java deleted file mode 100644 index 1417e3b888..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ImportResultWrapper.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Copyright (c) 2014, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.common.base.Function; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterables; - -import sonia.scm.repository.ImportResult; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - * @since 1.43 - */ -public class ImportResultWrapper -{ - - /** - * Constructs ... - * - * - * @param client - * @param type - * @param result - */ - public ImportResultWrapper(RepositoryClientHandler client, String type, - ImportResult result) - { - this.client = client; - this.type = type; - this.result = result; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public List getFailedDirectories() - { - List directories = result.getFailedDirectories(); - - if (directories == null) - { - directories = ImmutableList.of(); - } - - return directories; - } - - /** - * Method description - * - * - * @return - */ - public List getImportedDirectories() - { - List directories = result.getImportedDirectories(); - - if (directories == null) - { - directories = ImmutableList.of(); - } - - return directories; - } - - /** - * Method description - * - * - * @return - */ - public Iterable getImportedRepositories() - { - return Iterables.transform(getImportedDirectories(), - new RepositoryResolver(client, type)); - } - - //~--- inner classes -------------------------------------------------------- - - /** - * Class description - * - * - * @version Enter version here..., 14/11/29 - * @author Enter your name here... - */ - private static class RepositoryResolver - implements Function - { - - /** - * Constructs ... - * - * - * @param clientHandler - * @param type - */ - public RepositoryResolver(RepositoryClientHandler clientHandler, - String type) - { - this.clientHandler = clientHandler; - this.type = type; - } - - //~--- methods ------------------------------------------------------------ - - /** - * Method description - * - * - * @param name - * - * @return - */ - @Override - public Repository apply(String name) - { - return clientHandler.get(type, type); - } - - //~--- fields ------------------------------------------------------------- - - /** Field description */ - private final RepositoryClientHandler clientHandler; - - /** Field description */ - private final String type; - } - - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private final RepositoryClientHandler client; - - /** Field description */ - private final ImportResult result; - - /** Field description */ - private final String type; -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ImportUrlRequest.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ImportUrlRequest.java deleted file mode 100644 index 66969f4a86..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ImportUrlRequest.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) 2014, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- JDK imports ------------------------------------------------------------ - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; - -/** - * - * @author Sebastian Sdorra - * @since 1.43 - */ -@XmlRootElement(name = "import") -@XmlAccessorType(XmlAccessType.FIELD) -public class ImportUrlRequest -{ - - /** - * Constructs ... - * - */ - ImportUrlRequest() {} - - /** - * Constructs ... - * - * - * @param type - * @param name - * @param url - */ - public ImportUrlRequest(String type, String name, String url) - { - this.type = type; - this.name = name; - this.url = url; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getName() - { - return name; - } - - /** - * Method description - * - * - * @return - */ - public String getType() - { - return type; - } - - /** - * Method description - * - * - * @return - */ - public String getUrl() - { - return url; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private String name; - - /** Field description */ - @XmlTransient - private String type; - - /** Field description */ - private String url; -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/RepositoryClientHandler.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/RepositoryClientHandler.java deleted file mode 100644 index 9c0060aaff..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/RepositoryClientHandler.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.NotSupportedFeatuerException; -import sonia.scm.Type; -import sonia.scm.repository.Repository; -import sonia.scm.repository.Tags; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Collection; - -/** - * - * @author Sebastian Sdorra - */ -public interface RepositoryClientHandler extends ClientHandler -{ - - /** - * Method description - * - * - * @param type - * - * @return - * - * @since 1.43 - */ - public ImportResultWrapper importFromDirectory(String type); - - /** - * Method description - * - * - * @param request - * - * @return - * - * @since 1.43 - */ - public Repository importFromBundle(ImportBundleRequest request); - - /** - * Method description - * - * - * @param request - * @return - * - * @since 1.43 - */ - public Repository importFromUrl(ImportUrlRequest request); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param type - * @param name - * - * @return - * @since 1.11 - */ - public Repository get(String type, String name); - - /** - * Method description - * - * - * @param repository - * - * @return - * @since 1.8 - * - * @throws NotSupportedFeatuerException - */ - public ClientChangesetHandler getChangesetHandler(Repository repository) - throws NotSupportedFeatuerException; - - /** - * Method description - * - * - * @param repository - * - * @return - * @since 1.8 - * - * @throws NotSupportedFeatuerException - */ - public ClientRepositoryBrowser getRepositoryBrowser(Repository repository) - throws NotSupportedFeatuerException; - - /** - * Method description - * - * - * @return - */ - public Collection getRepositoryTypes(); - - /** - * Returns all tags of the given repository. - * - * - * @param repository repository - * - * @return all tags of the given repository - * @since 1.18 - */ - public Tags getTags(Repository repository); -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClient.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClient.java deleted file mode 100644 index c57e4992bb..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClient.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.util.ServiceUtil; - -/** - * - * @author Sebastian Sdorra - */ -public final class ScmClient -{ - - /** Field description */ - private static volatile ScmClientProvider provider = null; - - /** the logger for ScmClient */ - private static final Logger logger = LoggerFactory.getLogger(ScmClient.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - private ScmClient() {} - - //~--- methods -------------------------------------------------------------- - - /** - * Creates an ScmClientSession for the given user - * - * - * @param url - * @param username - * @param password - * - * @return - * - * @throws ScmClientException - */ - public static ScmClientSession createSession(String url, String username, - String password) - throws ScmClientException - { - return getProvider().createSession(url, username, password); - } - - /** - * Creates an anonymous ScmClientSession - * - * - * @param url - * - * @return - * - * @throws ScmClientException - */ - public static ScmClientSession createSession(String url) - throws ScmClientException - { - return getProvider().createSession(url, null, null); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - * - */ - private static ScmClientProvider getProvider() - { - if (provider == null) - { - synchronized (ScmClientProvider.class) - { - if (provider == null) - { - provider = ServiceUtil.getService(ScmClientProvider.class); - } - } - } - - if (provider == null) - { - throw new ScmClientException("could not find a ScmClientProvider"); - } - else if (logger.isInfoEnabled()) - { - logger.info("create ScmClient with provider {}", - provider.getClass().getName()); - } - - return provider; - } -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientException.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientException.java deleted file mode 100644 index 2a15a277f7..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientException.java +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -/** - * - * @author Sebastian Sdorra - */ -public class ScmClientException extends RuntimeException -{ - - /** Field description */ - public static final int SC_FORBIDDEN = 403; - - /** Field description */ - public static final int SC_NOTFOUND = 404; - - /** Field description */ - public static final int SC_UNAUTHORIZED = 401; - - /** Field description */ - public static final int SC_UNKNOWN = -1; - - /** Field description */ - private static final long serialVersionUID = -2302107106896701393L; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param statusCode - */ - public ScmClientException(int statusCode) - { - this.statusCode = statusCode; - } - - /** - * Constructs ... - * - * - * @param message - */ - public ScmClientException(String message) - { - super(message); - } - - /** - * Constructs ... - * - * - * @param cause - */ - public ScmClientException(Throwable cause) - { - super(cause); - } - - /** - * Constructs ... - * - * - * - * @param statusCode - * @param message - */ - public ScmClientException(int statusCode, String message) - { - super(message); - this.statusCode = statusCode; - } - - /** - * Constructs ... - * - * - * @param message - * @param cause - */ - public ScmClientException(String message, Throwable cause) - { - super(message, cause); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getContent() - { - return content; - } - - /** - * Method description - * - * - * @return - */ - public int getStatusCode() - { - return statusCode; - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param content - */ - public void setContent(String content) - { - this.content = content; - } - - /** - * Method description - * - * - * @param statusCode - */ - public void setStatusCode(int statusCode) - { - this.statusCode = statusCode; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private String content; - - /** Field description */ - private int statusCode = SC_UNKNOWN; -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientProvider.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientProvider.java deleted file mode 100644 index 1a03696400..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -/** - * - * @author Sebastian Sdorra - */ -public interface ScmClientProvider -{ - - /** - * Method description - * - * - * @param url - * @param username - * @param password - * - * @return - * - */ - public ScmClientSession createSession(String url, String username, - String password); -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientSession.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientSession.java deleted file mode 100644 index 7f58a94852..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientSession.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.ScmState; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.Closeable; - -/** - * - * @author Sebastian Sdorra - */ -public interface ScmClientSession extends Closeable -{ - - /** - * Method description - * - */ - @Override - public void close(); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public GroupClientHandler getGroupHandler(); - - /** - * Method description - * - * - * @return - */ - public RepositoryClientHandler getRepositoryHandler(); - - /** - * Method description - * - * - * @return - */ - public SecurityClientHandler getSecurityHandler(); - - /** - * Method description - * - * - * @return - */ - public ScmState getState(); - - /** - * Method description - * - * - * @return - */ - public UserClientHandler getUserHandler(); -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmForbiddenException.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmForbiddenException.java deleted file mode 100644 index d029d654a8..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmForbiddenException.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -/** - * - * @author Sebastian Sdorra - */ -public class ScmForbiddenException extends ScmClientException -{ - - /** Field description */ - private static final long serialVersionUID = 3937346624508458660L; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - public ScmForbiddenException() - { - super(SC_FORBIDDEN); - } - - /** - * Constructs ... - * - * - * @param message - */ - public ScmForbiddenException(String message) - { - super(SC_FORBIDDEN, message); - } -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmNotFoundException.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmNotFoundException.java deleted file mode 100644 index ae0835e8cb..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmNotFoundException.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -/** - * - * @author Sebastian Sdorra - */ -public class ScmNotFoundException extends ScmClientException -{ - - /** Field description */ - private static final long serialVersionUID = -7015126639998723954L; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - public ScmNotFoundException() - { - super(SC_NOTFOUND); - } - - /** - * Constructs ... - * - * - * @param message - */ - public ScmNotFoundException(String message) - { - super(SC_NOTFOUND, message); - } -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmUnauthorizedException.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmUnauthorizedException.java deleted file mode 100644 index fc561117e1..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmUnauthorizedException.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -/** - * - * @author Sebastian Sdorra - */ -public class ScmUnauthorizedException extends ScmClientException -{ - - /** Field description */ - private static final long serialVersionUID = 4398907424134588809L; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - public ScmUnauthorizedException() - { - super(SC_UNAUTHORIZED); - } - - /** - * Constructs ... - * - * - * @param message - */ - public ScmUnauthorizedException(String message) - { - super(SC_UNAUTHORIZED, message); - } -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/SecurityClientHandler.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/SecurityClientHandler.java deleted file mode 100644 index a0131a7f1c..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/SecurityClientHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -/** - * - * @author Sebastian Sdorra - * @since 1.41 - */ -public interface SecurityClientHandler -{ - - /** - * Method description - * - * - * @param value - * - * @return - */ - public String encrypt(String value); - - /** - * Method description - * - * - * @return - */ - public String generateKey(); -} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/UserClientHandler.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/UserClientHandler.java deleted file mode 100644 index 59192ba5a7..0000000000 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/UserClientHandler.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.user.User; - -/** - * - * @author Sebastian Sdorra - */ -public interface UserClientHandler extends ClientHandler {} diff --git a/scm-clients/scm-client-impl/pom.xml b/scm-clients/scm-client-impl/pom.xml deleted file mode 100644 index ecf2939706..0000000000 --- a/scm-clients/scm-client-impl/pom.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - 4.0.0 - - - sonia.scm.clients - scm-clients - 2.0.0-SNAPSHOT - - - sonia.scm.clients - scm-client-impl - jar - 2.0.0-SNAPSHOT - scm-client-impl - - - - - - - javax.servlet - javax.servlet-api - ${servlet.version} - provided - - - - javax.transaction - jta - 1.1 - provided - - - - sonia.scm.clients - scm-client-api - 2.0.0-SNAPSHOT - - - - com.sun.jersey - jersey-client - ${jersey-client.version} - - - - com.sun.jersey.contribs - jersey-multipart - ${jersey-client.version} - - - - - - org.slf4j - jul-to-slf4j - ${slf4j.version} - test - - - - ch.qos.logback - logback-classic - ${logback.version} - test - - - - sonia.scm - scm-test - 2.0.0-SNAPSHOT - test - - - - - - - - - - Sonatype - Sonatype Release - http://oss.sonatype.org/content/repositories/releases - - - - maven.scm-manager.org - scm-manager release repository - http://maven.scm-manager.org/nexus/content/groups/public - - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.3 - - - jar-with-dependencies - - - - - package - - single - - - - - - - - - - - - it - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.4 - - - package - - copy - - - - - sonia.scm - scm-webapp - ${project.version} - war - ${project.build.directory}/webapp - scm-webapp.war - - - - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.12 - - - integration-test - - integration-test - - - - verify - - verify - - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.version} - - 8085 - STOP - - - scm.home - target/scm-it - - - file.encoding - UTF-8 - - - - 8081 - - - /scm - - ${project.build.directory}/webapp/scm-webapp.war - 0 - true - - - - start-jetty - pre-integration-test - - deploy-war - - - - stop-jetty - post-integration-test - - stop - - - - - - - - - - - - diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/AbstractClientHandler.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/AbstractClientHandler.java deleted file mode 100644 index 0e29456adc..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/AbstractClientHandler.java +++ /dev/null @@ -1,346 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.ModelObject; -import sonia.scm.url.UrlProvider; -import sonia.scm.util.AssertUtil; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.GenericType; -import com.sun.jersey.api.client.WebResource; - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - * - * @param - */ -public abstract class AbstractClientHandler - implements ClientHandler -{ - - /** the logger for AbstractClientHandler */ - private static final Logger logger = - LoggerFactory.getLogger(AbstractClientHandler.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param session - * @param itemClass - */ - public AbstractClientHandler(JerseyClientSession session, Class itemClass) - { - this.session = session; - this.itemClass = itemClass; - this.client = session.getClient(); - this.urlProvider = session.getUrlProvider(); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * - * @return - */ - protected abstract GenericType> createGenericListType(); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param itemId - * - * @return - */ - protected abstract String getItemUrl(String itemId); - - /** - * Method description - * - * - * @return - */ - protected abstract String getItemsUrl(); - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param item - */ - @Override - public void create(T item) - { - AssertUtil.assertIsNotNull(item); - - WebResource resource = client.resource(getItemsUrl()); - ClientResponse response = null; - - try - { - response = resource.post(ClientResponse.class, item); - ClientUtil.checkResponse(response, 201); - - String url = response.getHeaders().get("Location").get(0); - - AssertUtil.assertIsNotEmpty(url); - - T newItem = getItemByUrl(url); - - AssertUtil.assertIsNotNull(newItem); - postCreate(response, item, newItem); - } - finally - { - ClientUtil.close(response); - } - } - - /** - * Method description - * - * - * @param id - */ - @Override - public void delete(String id) - { - AssertUtil.assertIsNotEmpty(id); - - WebResource resource = client.resource(getItemUrl(id)); - ClientResponse response = null; - - try - { - response = resource.delete(ClientResponse.class); - ClientUtil.checkResponse(response, 204); - } - finally - { - ClientUtil.close(response); - } - } - - /** - * Method description - * - * - * @param item - */ - @Override - public void delete(T item) - { - AssertUtil.assertIsNotNull(item); - delete(item.getId()); - } - - /** - * Method description - * - * - * @param item - */ - @Override - public void modify(T item) - { - AssertUtil.assertIsNotNull(item); - - String id = item.getId(); - - AssertUtil.assertIsNotEmpty(id); - - WebResource resource = client.resource(getItemUrl(id)); - ClientResponse response = null; - - try - { - response = resource.put(ClientResponse.class, item); - ClientUtil.checkResponse(response, 204); - postModify(response, item); - } - finally - { - ClientUtil.close(response); - } - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param id - * - * @return - */ - @Override - public T get(String id) - { - return getItemByUrl(getItemUrl(id)); - } - - /** - * Method description - * - * - * @return - */ - @Override - public List getAll() - { - List items = null; - String url = getItemsUrl(); - - if (logger.isDebugEnabled()) - { - logger.debug("fetch all items of {} from url", itemClass.getSimpleName(), - url); - } - - WebResource resource = client.resource(url); - ClientResponse response = null; - - try - { - response = resource.get(ClientResponse.class); - ClientUtil.checkResponse(response, 200); - items = response.getEntity(createGenericListType()); - } - finally - { - ClientUtil.close(response); - } - - return items; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param response - * @param item - * @param newItem - */ - protected void postCreate(ClientResponse response, T item, T newItem) {} - - /** - * Method description - * - * - * @param response - * @param item - */ - protected void postModify(ClientResponse response, T item) {} - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param url - * - * @return - */ - protected T getItemByUrl(String url) - { - if (logger.isDebugEnabled()) - { - logger.debug("fetch item {} from url {}", itemClass.getSimpleName(), url); - } - - T item = null; - WebResource resource = client.resource(url); - ClientResponse response = null; - - try - { - response = resource.get(ClientResponse.class); - - int sc = response.getStatus(); - - if (sc != ScmClientException.SC_NOTFOUND) - { - ClientUtil.checkResponse(response, 200); - item = response.getEntity(itemClass); - } - } - finally - { - ClientUtil.close(response); - } - - return item; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - protected Client client; - - /** Field description */ - protected JerseyClientSession session; - - /** Field description */ - protected UrlProvider urlProvider; - - /** Field description */ - private Class itemClass; -} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/ClientUtil.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/ClientUtil.java deleted file mode 100644 index e297405026..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/ClientUtil.java +++ /dev/null @@ -1,238 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.WebResource; -import com.sun.jersey.api.client.filter.LoggingFilter; - -/** - * - * @author Sebastian Sdorra - */ -public final class ClientUtil -{ - - /** the logger for ClientUtil */ - private static final Logger logger = - LoggerFactory.getLogger(ClientUtil.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - private ClientUtil() {} - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param exception - * @param response - */ - public static void appendContent(ScmClientException exception, - ClientResponse response) - { - try - { - exception.setContent(response.getEntity(String.class)); - } - catch (Exception ex) - { - logger.warn("could not read content", ex); - } - } - - /** - * Method description - * - * - * @param response - * @param expectedStatusCode - */ - public static void checkResponse(ClientResponse response, - int expectedStatusCode) - { - int sc = response.getStatus(); - - if (sc != expectedStatusCode) - { - if (logger.isWarnEnabled()) - { - logger.warn("response code {} expected, but {} returned", - expectedStatusCode, sc); - } - - sendException(response, sc); - } - } - - /** - * Method description - * - * - * @param response - * - */ - public static void checkResponse(ClientResponse response) - { - int sc = response.getStatus(); - - if (sc >= 300) - { - if (logger.isWarnEnabled()) - { - logger.warn("request failed, response code {} returned", sc); - } - - sendException(response, sc); - } - } - - /** - * Method description - * - * - * @param response - */ - public static void close(ClientResponse response) - { - if (response != null) - { - response.close(); - } - } - - /** - * Method description - * - * - * @param client - * @param url - * - * @return - */ - public static WebResource createResource(Client client, String url) - { - return createResource(client, url, false); - } - - /** - * Method description - * - * - * @param client - * @param url - * @param enableLogging - * - * @return - */ - public static WebResource createResource(Client client, String url, - boolean enableLogging) - { - WebResource resource = client.resource(url); - - if (enableLogging) - { - resource.addFilter(new LoggingFilter()); - } - - return resource; - } - - /** - * Method description - * - * - * @param response - * @param sc - */ - public static void sendException(ClientResponse response, int sc) - { - ScmClientException exception = null; - - switch (sc) - { - case ScmClientException.SC_UNAUTHORIZED : - exception = new ScmUnauthorizedException(); - - break; - - case ScmClientException.SC_FORBIDDEN : - exception = new ScmForbiddenException(); - - break; - - case ScmClientException.SC_NOTFOUND : - exception = new ScmNotFoundException(); - - break; - - default : - exception = new ScmClientException(sc); - appendContent(exception, response); - } - - throw exception; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param response - * - * @return - */ - public static boolean isSuccessfull(ClientResponse response) - { - int status = response.getStatus(); - - return (status > 200) && (status < 300); - } -} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientChangesetHandler.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientChangesetHandler.java deleted file mode 100644 index 8cc8abb60a..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientChangesetHandler.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.repository.Changeset; -import sonia.scm.repository.ChangesetPagingResult; -import sonia.scm.repository.Repository; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.WebResource; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyClientChangesetHandler implements ClientChangesetHandler -{ - - /** - * Constructs ... - * - * - * @param session - * @param repository - */ - public JerseyClientChangesetHandler(JerseyClientSession session, - Repository repository) - { - this.session = session; - this.repository = repository; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param revision - * - * @return - */ - @Override - public Changeset getChangeset(String revision) - { - Changeset changeset = null; - String url = - session.getUrlProvider().getRepositoryUrlProvider().getChangesetUrl( - repository.getId(), revision); - WebResource resource = session.getClient().resource(url); - ClientResponse response = null; - - try - { - response = resource.get(ClientResponse.class); - - if (response.getStatus() != ScmClientException.SC_NOTFOUND) - { - ClientUtil.checkResponse(response, 200); - changeset = response.getEntity(Changeset.class); - } - } - finally - { - ClientUtil.close(response); - } - - return changeset; - } - - /** - * Method description - * - * - * @param start - * @param limit - * - * @return - */ - @Override - public ChangesetPagingResult getChangesets(int start, int limit) - { - ChangesetPagingResult result = null; - String url = - session.getUrlProvider().getRepositoryUrlProvider().getChangesetUrl( - repository.getId(), start, limit); - WebResource resource = session.getClient().resource(url); - ClientResponse response = null; - - try - { - response = resource.get(ClientResponse.class); - - if (response.getStatus() != ScmClientException.SC_NOTFOUND) - { - ClientUtil.checkResponse(response, 200); - result = response.getEntity(ChangesetPagingResult.class); - } - } - finally - { - ClientUtil.close(response); - } - - return result; - } - - /** - * Method description - * - * - * - * @param path - * @param revision - * @param start - * @param limit - * - * @return - */ - @Override - public ChangesetPagingResult getChangesets(String path, String revision, - int start, int limit) - { - ChangesetPagingResult result = null; - String url = - session.getUrlProvider().getRepositoryUrlProvider().getChangesetUrl( - repository.getId(), path, revision, start, limit); - WebResource resource = session.getClient().resource(url); - ClientResponse response = null; - - try - { - response = resource.get(ClientResponse.class); - - if (response.getStatus() != ScmClientException.SC_NOTFOUND) - { - ClientUtil.checkResponse(response, 200); - result = response.getEntity(ChangesetPagingResult.class); - } - } - finally - { - ClientUtil.close(response); - } - - return result; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private Repository repository; - - /** Field description */ - private JerseyClientSession session; -} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientProvider.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientProvider.java deleted file mode 100644 index eb9825d470..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientProvider.java +++ /dev/null @@ -1,282 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.common.base.Strings; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.ScmState; -import sonia.scm.url.UrlProvider; -import sonia.scm.url.UrlProviderFactory; -import sonia.scm.util.AssertUtil; -import sonia.scm.util.HttpUtil; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientHandlerException; -import com.sun.jersey.api.client.ClientRequest; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.WebResource; -import com.sun.jersey.api.client.config.DefaultClientConfig; -import com.sun.jersey.api.client.filter.ClientFilter; -import com.sun.jersey.core.util.MultivaluedMapImpl; -import com.sun.jersey.multipart.impl.MultiPartWriter; - -import javax.ws.rs.core.MultivaluedMap; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyClientProvider implements ScmClientProvider -{ - - /** the logger for JerseyClientProvider */ - private static final Logger logger = - LoggerFactory.getLogger(JerseyClientProvider.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - public JerseyClientProvider() {} - - /** - * Constructs ... - * - * - * @param enableLogging - */ - public JerseyClientProvider(boolean enableLogging) - { - this.enableLogging = enableLogging; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param url - * @param username - * @param password - * - * @return - * - */ - @Override - public JerseyClientSession createSession(String url, String username, - String password) - { - AssertUtil.assertIsNotEmpty(url); - - String user = "anonymous"; - - if (Util.isNotEmpty(username)) - { - user = username; - } - - logger.info("create new session for {} with username {}", url, user); - - UrlProvider urlProvider = UrlProviderFactory.createUrlProvider(url, - UrlProviderFactory.TYPE_RESTAPI_XML); - - Client client = - Client.create(new DefaultClientConfig(MultiPartWriter.class)); - - boolean loginAttempt = isLoginAttempt(username, password); - ClientResponse response; - - if (loginAttempt) - { - response = login(urlProvider, client, username, password); - } - else - { - response = state(urlProvider, client); - } - - ClientUtil.checkResponse(response); - - ScmState state = response.getEntity(ScmState.class); - - if (!state.isSuccess()) - { - logger.warn("server returned state failed"); - - throw new ScmClientException("create ScmClientSession failed"); - } - - logger.info("create session successfully for user {}", user); - - if (loginAttempt) - { - appendAuthenticationFilter(client, state); - } - - return new JerseyClientSession(client, urlProvider, state); - } - - private void appendAuthenticationFilter(Client client, ScmState state) - { - String token = state.getToken(); - - if (Strings.isNullOrEmpty(token)) - { - throw new ScmClientException( - "scm-manager does not return a bearer token"); - } - - // authentication for further requests - client.addFilter(new AuthenticationFilter(token)); - } - - private ClientResponse login(UrlProvider urlProvider, Client client, - String username, String password) - { - String authUrl = urlProvider.getAuthenticationUrl(); - - if (logger.isDebugEnabled()) - { - logger.debug("try login at {}", authUrl); - } - - WebResource resource = ClientUtil.createResource(client, authUrl, - enableLogging); - - if (logger.isDebugEnabled()) - { - logger.debug("try login for {}", username); - } - - MultivaluedMap formData = new MultivaluedMapImpl(); - - formData.add("username", username); - formData.add("password", password); - formData.add("grant_type", "password"); - - return resource.type("application/x-www-form-urlencoded").post( - ClientResponse.class, formData); - } - - private ClientResponse state(UrlProvider urlProvider, Client client) - { - String stateUrl = urlProvider.getStateUrl(); - - if (logger.isDebugEnabled()) - { - logger.debug("retrive state from {}", stateUrl); - } - - WebResource resource = ClientUtil.createResource(client, stateUrl, - enableLogging); - - if (logger.isDebugEnabled()) - { - logger.debug("try anonymous login"); - } - - return resource.get(ClientResponse.class); - } - - //~--- get methods ---------------------------------------------------------- - - private boolean isLoginAttempt(String username, String password) - { - return Util.isNotEmpty(username) && Util.isNotEmpty(password); - } - - //~--- inner classes -------------------------------------------------------- - - /** - * Authentication filter - */ - private class AuthenticationFilter extends ClientFilter - { - - /** - * Constructs ... - * - * - * @param bearerToken - */ - public AuthenticationFilter(String bearerToken) - { - this.bearerToken = bearerToken; - } - - //~--- methods ------------------------------------------------------------ - - /** - * Method description - * - * - * @param request - * - * @return - * - * @throws ClientHandlerException - */ - @Override - public ClientResponse handle(ClientRequest request) - throws ClientHandlerException - { - request.getHeaders().putSingle(HttpUtil.HEADER_AUTHORIZATION, - HttpUtil.AUTHORIZATION_SCHEME_BEARER.concat(" ").concat(bearerToken)); - - return getNext().handle(request); - } - - //~--- fields ------------------------------------------------------------- - - /** Field description */ - private final String bearerToken; - } - - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private boolean enableLogging = false; -} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientRepositoryBrowser.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientRepositoryBrowser.java deleted file mode 100644 index 571c30f7db..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientRepositoryBrowser.java +++ /dev/null @@ -1,232 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.repository.BlameLine; -import sonia.scm.repository.BlameResult; -import sonia.scm.repository.BrowserResult; -import sonia.scm.repository.FileObject; -import sonia.scm.repository.Repository; -import sonia.scm.util.AssertUtil; -import sonia.scm.util.Util; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.WebResource; - -import java.io.IOException; -import java.io.InputStream; - -import java.util.ArrayList; -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyClientRepositoryBrowser implements ClientRepositoryBrowser -{ - - /** - * Constructs ... - * - * - * @param session - * @param repository - */ - public JerseyClientRepositoryBrowser(JerseyClientSession session, - Repository repository) - { - this.session = session; - this.repository = repository; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param revision - * @param path - * - * @return - */ - @Override - public List getBlameLines(String revision, String path) - { - List blameLines = null; - String url = - session.getUrlProvider().getRepositoryUrlProvider().getBlameUrl( - repository.getId(), path, revision); - WebResource resource = session.getClient().resource(url); - ClientResponse response = null; - - try - { - response = resource.get(ClientResponse.class); - - if (response.getStatus() != ScmClientException.SC_NOTFOUND) - { - ClientUtil.checkResponse(response, 200); - - BlameResult result = response.getEntity(BlameResult.class); - - AssertUtil.assertIsNotNull(result); - blameLines = result.getBlameLines(); - } - } - finally - { - ClientUtil.close(response); - } - - return blameLines; - } - - /** - * Method description - * - * - * @param revision - * @param path - * - * @return - * - * @throws IOException - */ - @Override - public InputStream getContent(String revision, String path) throws IOException - { - InputStream input = null; - String url = - session.getUrlProvider().getRepositoryUrlProvider().getContentUrl( - repository.getId(), path, revision); - WebResource resource = session.getClient().resource(url); - ClientResponse response = null; - - try - { - response = resource.get(ClientResponse.class); - - if (response.getStatus() != ScmClientException.SC_NOTFOUND) - { - ClientUtil.checkResponse(response, 200); - input = response.getEntityInputStream(); - } - } - finally - { - ClientUtil.close(response); - } - - return input; - } - - /** - * Method description - * - * - * @param revision - * @param path - * - * @return - */ - @Override - public List getFiles(String revision, String path) - { - List files = null; - String url = - session.getUrlProvider().getRepositoryUrlProvider().getBrowseUrl( - repository.getId(), path, revision); - WebResource resource = session.getClient().resource(url); - ClientResponse response = null; - - try - { - response = resource.get(ClientResponse.class); - - if (response.getStatus() != ScmClientException.SC_NOTFOUND) - { - ClientUtil.checkResponse(response, 200); - - BrowserResult result = response.getEntity(BrowserResult.class); - - AssertUtil.assertIsNotNull(result); - files = new ArrayList(); - - List foList = result.getFiles(); - - if (Util.isNotEmpty(foList)) - { - for (FileObject fo : foList) - { - files.add(new FileObjectWrapper(this, revision, fo)); - } - } - } - } - finally - { - ClientUtil.close(response); - } - - return files; - } - - /** - * Method description - * - * - * @param revision - * - * @return - */ - @Override - public List getFiles(String revision) - { - return getFiles(revision, Util.EMPTY_STRING); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private Repository repository; - - /** Field description */ - private JerseyClientSession session; -} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientSession.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientSession.java deleted file mode 100644 index 5e0531be4e..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientSession.java +++ /dev/null @@ -1,189 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.ScmState; -import sonia.scm.url.UrlProvider; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.Client; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyClientSession implements ScmClientSession -{ - - /** the logger for JerseyClientSession */ - private static final Logger logger = - LoggerFactory.getLogger(JerseyClientSession.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param client - * @param urlProvider - * @param state - */ - public JerseyClientSession(Client client, UrlProvider urlProvider, - ScmState state) - { - this.client = client; - this.urlProvider = urlProvider; - this.state = state; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - */ - @Override - public void close() - { - if (logger.isInfoEnabled()) - { - logger.info("close client session"); - } - - client.destroy(); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public Client getClient() - { - return client; - } - - /** - * Method description - * - * - * @return - */ - @Override - public GroupClientHandler getGroupHandler() - { - return new JerseyGroupClientHandler(this); - } - - /** - * Method description - * - * - * @return - */ - @Override - public RepositoryClientHandler getRepositoryHandler() - { - return new JerseyRepositoryClientHandler(this); - } - - /** - * Method description - * - * - * @return - */ - @Override - public SecurityClientHandler getSecurityHandler() - { - return new JerseySecurityClientHandler(this); - } - - /** - * Method description - * - * - * @return - */ - @Override - public ScmState getState() - { - return state; - } - - /** - * Method description - * - * - * @return - */ - public UrlProvider getUrlProvider() - { - return urlProvider; - } - - /** - * Method description - * - * - * @return - */ - @Override - public UserClientHandler getUserHandler() - { - return new JerseyUserClientHandler(this); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private final Client client; - - /** Field description */ - private final ScmState state; - - /** Field description */ - private final UrlProvider urlProvider; -} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyGroupClientHandler.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyGroupClientHandler.java deleted file mode 100644 index 0c22798279..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyGroupClientHandler.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.group.Group; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.GenericType; - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyGroupClientHandler extends AbstractClientHandler - implements GroupClientHandler -{ - - /** - * Constructs ... - * - * - * @param session - */ - public JerseyGroupClientHandler(JerseyClientSession session) - { - super(session, Group.class); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - protected GenericType> createGenericListType() - { - return new GenericType>() {} - ; - } - - /** - * Method description - * - * - * @param response - * @param item - * @param newItem - */ - @Override - protected void postCreate(ClientResponse response, Group item, Group newItem) - { - newItem.copyProperties(item); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param itemId - * - * @return - */ - @Override - protected String getItemUrl(String itemId) - { - return urlProvider.getGroupUrlProvider().getDetailUrl(itemId); - } - - /** - * Method description - * - * - * @return - */ - @Override - protected String getItemsUrl() - { - return urlProvider.getGroupUrlProvider().getAllUrl(); - } -} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyRepositoryClientHandler.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyRepositoryClientHandler.java deleted file mode 100644 index ff611c9aa2..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyRepositoryClientHandler.java +++ /dev/null @@ -1,386 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.common.base.Strings; - -import sonia.scm.NotSupportedFeatuerException; -import sonia.scm.Type; -import sonia.scm.repository.ImportResult; -import sonia.scm.repository.Repository; -import sonia.scm.repository.Tags; -import sonia.scm.util.HttpUtil; -import sonia.scm.util.IOUtil; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.GenericType; -import com.sun.jersey.api.client.WebResource; -import com.sun.jersey.multipart.FormDataMultiPart; -import com.sun.jersey.multipart.file.StreamDataBodyPart; - -import java.io.IOException; -import java.io.InputStream; - -import java.util.Collection; -import java.util.List; - -import javax.ws.rs.core.MediaType; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyRepositoryClientHandler - extends AbstractClientHandler implements RepositoryClientHandler -{ - - /** Field description */ - private static final String IMPORT_TYPE_BUNDLE = "bundle"; - - /** Field description */ - private static final String IMPORT_TYPE_DIRECTORY = "directory"; - - /** Field description */ - private static final String IMPORT_TYPE_URL = "url"; - - /** Field description */ - private static final String PARAM_BUNDLE = "bundle"; - - /** Field description */ - private static final String PARAM_COMPRESSED = "compressed"; - - /** Field description */ - private static final String PARAM_NAME = "name"; - - /** Field description */ - private static final String URL_IMPORT = "import/repositories/"; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param session - */ - public JerseyRepositoryClientHandler(JerseyClientSession session) - { - super(session, Repository.class); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param request - * - * @return - */ - @Override - public Repository importFromBundle(ImportBundleRequest request) - { - WebResource r = client.resource(getImportUrl(request.getType(), - IMPORT_TYPE_BUNDLE)).queryParam(PARAM_COMPRESSED, - Boolean.toString(request.isCompressed())); - Repository repository = null; - InputStream stream = null; - - try - { - stream = request.getBundle().openStream(); - - FormDataMultiPart form = new FormDataMultiPart(); - - form.field(PARAM_NAME, request.getName()); - form.bodyPart(new StreamDataBodyPart(PARAM_BUNDLE, stream)); - - ClientResponse response = - r.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class, form); - - ClientUtil.checkResponse(response); - - String location = - response.getHeaders().getFirst(HttpUtil.HEADER_LOCATION); - - if (Strings.isNullOrEmpty(location)) - { - throw new ScmClientException("no location header found after import"); - } - - repository = getItemByUrl(location); - } - catch (IOException ex) - { - throw new ScmClientException("could not import bundle", ex); - } - finally - { - IOUtil.close(stream); - } - - return repository; - } - - /** - * Method description - * - * - * @param type - * - * @return - */ - @Override - public ImportResultWrapper importFromDirectory(String type) - { - WebResource r = client.resource(getImportUrl(type, IMPORT_TYPE_DIRECTORY)); - ClientResponse response = r.post(ClientResponse.class); - - ClientUtil.checkResponse(response); - - return new ImportResultWrapper(this, type, - response.getEntity(ImportResult.class)); - } - - /** - * Method description - * - * - * @param request - * - * @return - */ - @Override - public Repository importFromUrl(ImportUrlRequest request) - { - WebResource r = client.resource(getImportUrl(request.getType(), - IMPORT_TYPE_URL)); - ClientResponse response = r.post(ClientResponse.class, request); - - ClientUtil.checkResponse(response); - - String location = response.getHeaders().getFirst(HttpUtil.HEADER_LOCATION); - - if (Strings.isNullOrEmpty(location)) - { - throw new ScmClientException("no location header found after import"); - } - - return getItemByUrl(location); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param type - * @param name - * - * @return - */ - @Override - public Repository get(String type, String name) - { - String url = urlProvider.getRepositoryUrlProvider().getDetailUrl(type, - name); - - return getItemByUrl(url); - } - - /** - * Method description - * - * - * @param repository - * - * @return - * - * @throws NotSupportedFeatuerException - */ - @Override - public ClientChangesetHandler getChangesetHandler(Repository repository) - throws NotSupportedFeatuerException - { - return new JerseyClientChangesetHandler(session, repository); - } - - /** - * Method description - * - * - * @param repository - * - * @return - * - */ - @Override - public JerseyClientRepositoryBrowser getRepositoryBrowser( - Repository repository) - { - return new JerseyClientRepositoryBrowser(session, repository); - } - - /** - * Method description - * - * - * @return - */ - @Override - public Collection getRepositoryTypes() - { - return session.getState().getRepositoryTypes(); - } - - /** - * Method description - * - * - * @param repository - * - * @return - */ - @Override - public Tags getTags(Repository repository) - { - Tags tags = null; - String url = session.getUrlProvider().getRepositoryUrlProvider().getTagsUrl( - repository.getId()); - WebResource resource = session.getClient().resource(url); - ClientResponse response = null; - - try - { - response = resource.get(ClientResponse.class); - - if (response.getStatus() != ScmClientException.SC_NOTFOUND) - { - ClientUtil.checkResponse(response, 200); - tags = response.getEntity(Tags.class); - } - } - finally - { - ClientUtil.close(response); - } - - return tags; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - protected GenericType> createGenericListType() - { - return new GenericType>() {} - ; - } - - /** - * Method description - * - * - * @param response - * @param repository - * @param newRepository - */ - @Override - protected void postCreate(ClientResponse response, Repository repository, - Repository newRepository) - { - newRepository.copyProperties(repository); - - // copyProperties does not copy the repository id - repository.setId(newRepository.getId()); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param itemId - * - * @return - */ - @Override - protected String getItemUrl(String itemId) - { - return urlProvider.getRepositoryUrlProvider().getDetailUrl(itemId); - } - - /** - * Method description - * - * - * @return - */ - @Override - protected String getItemsUrl() - { - return urlProvider.getRepositoryUrlProvider().getAllUrl(); - } - - /** - * Method description - * - * - * @param type - * @param importType - * - * @return - */ - private String getImportUrl(String type, String importType) - { - StringBuilder buffer = new StringBuilder(URL_IMPORT); - - buffer.append(type).append(HttpUtil.SEPARATOR_PATH).append(importType); - - return HttpUtil.append(urlProvider.getBaseUrl(), buffer.toString()); - } -} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseySecurityClientHandler.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseySecurityClientHandler.java deleted file mode 100644 index 5f24752078..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseySecurityClientHandler.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseySecurityClientHandler implements SecurityClientHandler -{ - - /** - * Constructs ... - * - * - * @param session - */ - JerseySecurityClientHandler(JerseyClientSession session) - { - this.session = session; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param value - * - * @return - */ - @Override - public String encrypt(String value) - { - String url = - session.getUrlProvider().getSecurityUrlProvider().getEncryptUrl(); - - return session.getClient().resource(url).post(String.class, value); - } - - /** - * Method description - * - * - * @return - */ - @Override - public String generateKey() - { - String url = - session.getUrlProvider().getSecurityUrlProvider().getGenerateKeyUrl(); - - return session.getClient().resource(url).get(String.class); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private final JerseyClientSession session; -} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyUserClientHandler.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyUserClientHandler.java deleted file mode 100644 index a353434379..0000000000 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyUserClientHandler.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.user.User; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.GenericType; - -import java.util.List; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyUserClientHandler extends AbstractClientHandler - implements UserClientHandler -{ - - /** - * Constructs ... - * - * - * @param session - */ - public JerseyUserClientHandler(JerseyClientSession session) - { - super(session, User.class); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - protected GenericType> createGenericListType() - { - return new GenericType>() {} - ; - } - - /** - * Method description - * - * - * @param response - * @param item - * @param newItem - */ - @Override - protected void postCreate(ClientResponse response, User item, User newItem) - { - newItem.copyProperties(item); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param itemId - * - * @return - */ - @Override - protected String getItemUrl(String itemId) - { - return urlProvider.getUserUrlProvider().getDetailUrl(itemId); - } - - /** - * Method description - * - * - * @return - */ - @Override - protected String getItemsUrl() - { - return urlProvider.getUserUrlProvider().getAllUrl(); - } -} diff --git a/scm-clients/scm-client-impl/src/main/resources/META-INF/services/sonia.scm.client.ScmClientProvider b/scm-clients/scm-client-impl/src/main/resources/META-INF/services/sonia.scm.client.ScmClientProvider deleted file mode 100644 index ac345b3480..0000000000 --- a/scm-clients/scm-client-impl/src/main/resources/META-INF/services/sonia.scm.client.ScmClientProvider +++ /dev/null @@ -1 +0,0 @@ -sonia.scm.client.JerseyClientProvider \ No newline at end of file diff --git a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/AbstractClientHandlerTestBase.java b/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/AbstractClientHandlerTestBase.java deleted file mode 100644 index fe4547ecb8..0000000000 --- a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/AbstractClientHandlerTestBase.java +++ /dev/null @@ -1,295 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client.it; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import sonia.scm.ModelObject; -import sonia.scm.client.ClientHandler; -import sonia.scm.client.JerseyClientSession; -import sonia.scm.client.ScmForbiddenException; -import sonia.scm.client.ScmUnauthorizedException; - -import static org.junit.Assert.*; - -import static sonia.scm.client.it.ClientTestUtil.*; - -/** - * - * @author Sebastian Sdorra - * - * @param - */ -public abstract class AbstractClientHandlerTestBase -{ - - /** - * Method description - * - * - * @param session - * - * @return - */ - protected abstract ClientHandler createHandler( - JerseyClientSession session); - - /** - * Method description - * - * - * @return - */ - protected abstract ModifyTest createModifyTest(); - - /** - * Method description - * - * - * @param number - * - * @return - */ - protected abstract T createTestData(int number); - - /** - * Method description - * - * - */ - @Test - public void testCreate() - { - JerseyClientSession session = createAdminSession(); - T item = createTestData(1); - ClientHandler handler = createHandler(session); - - handler.create(item); - assertIsValid(item); - - String id = item.getId(); - T o = handler.get(id); - - assertNotNull(o); - assertEquals(item.getId(), o.getId()); - session.close(); - } - - /** - * Method description - * - * - */ - @Test - public void testDelete() - { - JerseyClientSession session = createAdminSession(); - T item = createTestData(2); - ClientHandler handler = createHandler(session); - - handler.create(item); - assertIsValid(item); - - String id = item.getId(); - - handler.delete(item); - - T o = handler.get(id); - - assertNull(o); - } - - /** - * Method description - * - * - */ - @Test(expected = ScmUnauthorizedException.class) - public void testDisabledCreateAnonymous() - { - JerseyClientSession session = createAnonymousSession(); - T item = createTestData(3); - - createHandler(session).create(item); - session.close(); - } - - /** - * Method description - * - * - */ - @Test - public void testEnabledCreateAnonymous() - { - setAnonymousAccess(true); - - JerseyClientSession session = createAnonymousSession(); - T item = createTestData(3); - boolean forbidden = false; - - try - { - createHandler(session).create(item); - } - catch (ScmForbiddenException ex) - { - forbidden = true; - } - - assertTrue(forbidden); - session.close(); - setAnonymousAccess(false); - } - - /** - * Method description - * - */ - @Test - public void testEnabledModifyAnonymous() - { - setAnonymousAccess(true); - - JerseyClientSession session = createAdminSession(); - T item = createTestData(4); - - createHandler(session).create(item); - assertIsValid(item); - session.close(); - session = createAnonymousSession(); - - ModifyTest mt = createModifyTest(); - - mt.modify(item); - - boolean notfound = false; - - try - { - createHandler(session).modify(item); - } - catch (ScmForbiddenException ex) - { - notfound = true; - } - - setAnonymousAccess(false); - session.close(); - session = createAdminSession(); - createHandler(session).delete(item); - session.close(); - assertTrue(notfound); - } - - /** - * Method description - * - */ - @Test - public void testModify() - { - long start = System.currentTimeMillis(); - JerseyClientSession session = createAdminSession(); - T item = createTestData(4); - ClientHandler handler = createHandler(session); - - handler.create(item); - assertIsValid(item); - item = handler.get(item.getId()); - - ModifyTest mt = createModifyTest(); - - mt.modify(item); - handler.modify(item); - item = handler.get(item.getId()); - assertIsValid(item); - assertTrue(mt.isCorrectModified(item)); - assertNotNull(item.getLastModified()); - assertTrue(item.getLastModified() > start); - assertTrue(item.getLastModified() < System.currentTimeMillis()); - handler.delete(item); - session.close(); - } - - /** - * Method description - * - * - * @param item - */ - protected void assertIsValid(T item) - { - assertNotNull(item); - assertNotNull(item.getId()); - assertTrue(item.getId().length() > 0); - } - - //~--- inner interfaces ----------------------------------------------------- - - /** - * Interface description - * - * - * @param - * - * @version Enter version here..., 11/05/13 - * @author Enter your name here... - */ - protected interface ModifyTest - { - - /** - * Method description - * - * - * @param item - */ - public void modify(T item); - - //~--- get methods -------------------------------------------------------- - - /** - * Method description - * - * - * @param item - * - * @return - */ - public boolean isCorrectModified(T item); - } -} diff --git a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/ClientTestUtil.java b/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/ClientTestUtil.java deleted file mode 100644 index c567ff0e86..0000000000 --- a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/ClientTestUtil.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client.it; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.client.ClientUtil; -import sonia.scm.client.JerseyClientProvider; -import sonia.scm.client.JerseyClientSession; -import sonia.scm.config.ScmConfiguration; -import sonia.scm.url.UrlProvider; - -//~--- JDK imports ------------------------------------------------------------ - -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.WebResource; - -/** - * - * @author Sebastian Sdorra - */ -public final class ClientTestUtil -{ - - /** Field description */ - public static final String ADMIN_PASSWORD = "scmadmin"; - - /** Field description */ - public static final String ADMIN_USERNAME = "scmadmin"; - - /** Field description */ - public static final String REPOSITORY_TYPE = "git"; - - /** Field description */ - public static final String URL_BASE = "http://localhost:8081/scm"; - - /** Field description */ - public static final boolean REQUEST_LOGGING = false; - - private ClientTestUtil() - { - } - - - - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @return - * - */ - public static JerseyClientSession createAdminSession() - { - return createSession(ADMIN_USERNAME, ADMIN_PASSWORD); - } - - /** - * Method description - * - * - * @return - * - */ - public static JerseyClientSession createAnonymousSession() - { - return createSession(null, null); - } - - /** - * Method description - * - * - * @param username - * @param password - * - * @return - * - */ - public static JerseyClientSession createSession(String username, - String password) - { - JerseyClientProvider provider = new JerseyClientProvider(REQUEST_LOGGING); - - return provider.createSession(URL_BASE, username, password); - } - - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param access - * - */ - public static void setAnonymousAccess(boolean access) - { - JerseyClientSession adminSession = createAdminSession(); - UrlProvider up = adminSession.getUrlProvider(); - Client client = adminSession.getClient(); - WebResource resource = ClientUtil.createResource(client, up.getConfigUrl(), - REQUEST_LOGGING); - ScmConfiguration config = resource.get(ScmConfiguration.class); - - config.setAnonymousAccessEnabled(access); - resource.post(config); - adminSession.close(); - } -} diff --git a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyClientProviderITCase.java b/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyClientProviderITCase.java deleted file mode 100644 index 3aab675b0b..0000000000 --- a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyClientProviderITCase.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client.it; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import sonia.scm.client.JerseyClientSession; -import sonia.scm.client.ScmClientException; -import sonia.scm.client.ScmUnauthorizedException; - -import static org.junit.Assert.*; - -import static sonia.scm.client.it.ClientTestUtil.*; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyClientProviderITCase -{ - - /** - * Method description - * - * - * - */ - @Test(expected = ScmUnauthorizedException.class) - public void createSessionAnonymousFailedTest() - { - createAnonymousSession().close(); - } - - /** - * Method description - * - * - * - */ - @Test - public void createSessionAnonymousTest() - { - - // enable anonymous access - setAnonymousAccess(true); - - // test anonymous access - createAnonymousSession().close(); - - // disable anonymous access - setAnonymousAccess(false); - } - - /** - * Method description - * - * - * - */ - @Test - public void createSessionTest() - { - JerseyClientSession session = createAdminSession(); - - assertNotNull(session); - assertNotNull(session.getState()); - assertNotNull(session.getState().getUser()); - assertEquals(session.getState().getUser().getName(), "scmadmin"); - session.close(); - } - - /** - * Method description - * - * - * - * @throws IOException - * @throws ScmClientException - */ - @Test(expected = ScmUnauthorizedException.class) - public void createSessionWithUnkownUserTest() - throws ScmClientException, IOException - { - createSession("dent", "dent123").close(); - } - - /** - * Method description - * - * - * - * @throws IOException - * @throws ScmClientException - */ - @Test(expected = ScmUnauthorizedException.class) - public void createSessionWithWrongPasswordTest() - throws ScmClientException, IOException - { - createSession("scmadmin", "ka123").close(); - } -} diff --git a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyGroupClientHandlerITCase.java b/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyGroupClientHandlerITCase.java deleted file mode 100644 index 0650564741..0000000000 --- a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyGroupClientHandlerITCase.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client.it; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.client.ClientHandler; -import sonia.scm.client.JerseyClientSession; -import sonia.scm.client.it.AbstractClientHandlerTestBase.ModifyTest; -import sonia.scm.group.Group; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyGroupClientHandlerITCase - extends AbstractClientHandlerTestBase -{ - - /** - * Method description - * - * - * @param session - * - * @return - */ - @Override - protected ClientHandler createHandler(JerseyClientSession session) - { - return session.getGroupHandler(); - } - - /** - * Method description - * - * - * @return - */ - @Override - protected ModifyTest createModifyTest() - { - return new ModifyTest() - { - @Override - public void modify(Group item) - { - item.setDescription("Modified Description"); - } - @Override - public boolean isCorrectModified(Group item) - { - return "Modified Description".equals(item.getDescription()); - } - }; - } - - /** - * Method description - * - * - * @param number - * - * @return - */ - @Override - protected Group createTestData(int number) - { - return new Group("xml", "group-" + number); - } -} diff --git a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyRepositoryClientHandlerITCase.java b/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyRepositoryClientHandlerITCase.java deleted file mode 100644 index d960d57392..0000000000 --- a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyRepositoryClientHandlerITCase.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client.it; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.client.ClientHandler; -import sonia.scm.client.JerseyClientSession; -import sonia.scm.client.it.AbstractClientHandlerTestBase.ModifyTest; -import sonia.scm.repository.Repository; -import sonia.scm.repository.RepositoryTestData; - -import static org.junit.Assert.*; - -import static sonia.scm.client.it.ClientTestUtil.*; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyRepositoryClientHandlerITCase - extends AbstractClientHandlerTestBase -{ - - /** - * Method description - * - * - * @param item - */ - @Override - protected void assertIsValid(Repository item) - { - super.assertIsValid(item); - assertNotNull(item.getCreationDate()); - assertTrue(item.getCreationDate() > 0); - assertTrue(item.getCreationDate() < System.currentTimeMillis()); - } - - /** - * Method description - * - * - * @param session - * - * @return - */ - @Override - protected ClientHandler createHandler(JerseyClientSession session) - { - return session.getRepositoryHandler(); - } - - /** - * Method description - * - * - * @return - */ - @Override - protected ModifyTest createModifyTest() - { - return new ModifyTest() - { - @Override - public void modify(Repository item) - { - item.setDescription("Modified description"); - } - @Override - public boolean isCorrectModified(Repository item) - { - return "Modified description".equals(item.getDescription()); - } - }; - } - - /** - * Method description - * - * - * @param number - * - * @return - */ - @Override - protected Repository createTestData(int number) - { - Repository repository = null; - - switch (number) - { - case 1 : - repository = RepositoryTestData.createHeartOfGold(REPOSITORY_TYPE); - - break; - - case 2 : - repository = RepositoryTestData.createHappyVerticalPeopleTransporter( - REPOSITORY_TYPE); - - break; - - case 3 : - repository = RepositoryTestData.create42Puzzle(REPOSITORY_TYPE); - - break; - - case 4 : - repository = RepositoryTestData.createRestaurantAtTheEndOfTheUniverse( - REPOSITORY_TYPE); - - break; - } - - return repository; - } -} diff --git a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyUserClientHandlerITCase.java b/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyUserClientHandlerITCase.java deleted file mode 100644 index d84deabb42..0000000000 --- a/scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/JerseyUserClientHandlerITCase.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.client.it; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.client.ClientHandler; -import sonia.scm.client.JerseyClientSession; -import sonia.scm.client.it.AbstractClientHandlerTestBase.ModifyTest; -import sonia.scm.user.User; -import sonia.scm.user.UserTestData; - -/** - * - * @author Sebastian Sdorra - */ -public class JerseyUserClientHandlerITCase - extends AbstractClientHandlerTestBase -{ - - /** - * Method description - * - * - * @param session - * - * @return - */ - @Override - protected ClientHandler createHandler(JerseyClientSession session) - { - return session.getUserHandler(); - } - - /** - * Method description - * - * - * @return - */ - @Override - protected ModifyTest createModifyTest() - { - return new ModifyTest() - { - @Override - public void modify(User item) - { - item.setDisplayName("Modified DisplayName"); - } - @Override - public boolean isCorrectModified(User item) - { - return "Modified DisplayName".equals(item.getDisplayName()); - } - }; - } - - /** - * Method description - * - * - * @param number - * - * @return - */ - @Override - protected User createTestData(int number) - { - User user = null; - - switch (number) - { - case 1 : - user = UserTestData.createAdams(); - - break; - - case 2 : - user = UserTestData.createDent(); - - break; - - case 3 : - user = UserTestData.createMarvin(); - - break; - - case 4 : - user = UserTestData.createPerfect(); - - break; - } - - return user; - } -} diff --git a/scm-clients/scm-client-impl/src/test/resources/logback.xml b/scm-clients/scm-client-impl/src/test/resources/logback.xml deleted file mode 100644 index 26effea73e..0000000000 --- a/scm-clients/scm-client-impl/src/test/resources/logback.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n - - - - - - - - - - \ No newline at end of file diff --git a/scm-core/pom.xml b/scm-core/pom.xml index a06eb544dc..f19ad7453e 100644 --- a/scm-core/pom.xml +++ b/scm-core/pom.xml @@ -128,26 +128,24 @@ 2.0.0-SNAPSHOT provided - + + - com.github.sdorra + com.github.sdorra.shiro-static-permissions ssp-lib - ${ssp.version} - com.github.sdorra + com.github.sdorra.shiro-static-permissions ssp-processor - ${ssp.version} true - + com.github.sdorra shiro-unit - 1.0.0 test diff --git a/scm-core/src/main/java/sonia/scm/config/Configuration.java b/scm-core/src/main/java/sonia/scm/config/Configuration.java new file mode 100644 index 0000000000..e9bf3528d5 --- /dev/null +++ b/scm-core/src/main/java/sonia/scm/config/Configuration.java @@ -0,0 +1,28 @@ +package sonia.scm.config; + +import com.github.sdorra.ssp.PermissionObject; +import com.github.sdorra.ssp.StaticPermissions; + +/** + * Base for all kinds of configurations. + * + * Allows for permission like + * + *
    + *
  • "configuration:read:global",
  • + *
  • "configuration:write:svn",
  • + *
  • "configuration:*:git",
  • + *
  • "configuration:*"
  • + *
+ * + *
+ * + * And for permission checks like {@code ConfigurationPermissions.read(configurationObject).check();} + */ +@StaticPermissions( + value = "configuration", + permissions = {"read", "write"}, + globalPermissions = {} +) +public interface Configuration extends PermissionObject { +} diff --git a/scm-core/src/main/java/sonia/scm/config/ScmConfiguration.java b/scm-core/src/main/java/sonia/scm/config/ScmConfiguration.java index ac22c1403e..6e1db68f91 100644 --- a/scm-core/src/main/java/sonia/scm/config/ScmConfiguration.java +++ b/scm-core/src/main/java/sonia/scm/config/ScmConfiguration.java @@ -1,19 +1,19 @@ /** * Copyright (c) 2010, Sebastian Sdorra * All rights reserved. - * + *

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + *

* 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + *

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,39 +24,33 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + *

* http://bitbucket.org/sdorra/scm-manager - * */ - package sonia.scm.config; -//~--- non-JDK imports -------------------------------------------------------- import com.google.common.collect.Sets; import com.google.inject.Singleton; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import sonia.scm.event.ScmEventBus; import sonia.scm.util.HttpUtil; import sonia.scm.xml.XmlSetStringAdapter; -//~--- JDK imports ------------------------------------------------------------ - -import java.io.File; - -import java.util.Set; -import java.util.concurrent.TimeUnit; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import java.io.File; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +//~--- JDK imports ------------------------------------------------------------ /** * The main configuration object for SCM-Manager. @@ -64,41 +58,141 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; * * @author Sebastian Sdorra */ + @Singleton @XmlRootElement(name = "scm-config") @XmlAccessorType(XmlAccessType.FIELD) -public class ScmConfiguration -{ +public class ScmConfiguration implements Configuration { - /** Default JavaScript date format */ + /** + * Default JavaScript date format + */ public static final String DEFAULT_DATEFORMAT = "YYYY-MM-DD HH:mm:ss"; - /** Default plugin url */ + /** + * Default plugin url + */ public static final String DEFAULT_PLUGINURL = "http://plugins.scm-manager.org/scm-plugin-backend/api/{version}/plugins?os={os}&arch={arch}&snapshot=false"; - /** Default plugin url from version 1.0 */ + /** + * Default plugin url from version 1.0 + */ public static final String OLD_PLUGINURL = "http://plugins.scm-manager.org/plugins.xml.gz"; - /** Path to the configuration file */ + /** + * Path to the configuration file + */ public static final String PATH = "config".concat(File.separator).concat("config.xml"); - /** the logger for ScmConfiguration */ + /** + * the logger for ScmConfiguration + */ private static final Logger logger = LoggerFactory.getLogger(ScmConfiguration.class); - //~--- methods -------------------------------------------------------------- + + @XmlElement(name = "admin-groups") + @XmlJavaTypeAdapter(XmlSetStringAdapter.class) + private Set adminGroups; + + + @XmlElement(name = "admin-users") + @XmlJavaTypeAdapter(XmlSetStringAdapter.class) + private Set adminUsers; + + + @XmlElement(name = "base-url") + private String baseUrl; + + + @XmlElement(name = "force-base-url") + private boolean forceBaseUrl; + + /** + * Maximum allowed login attempts. + * + * @since 1.34 + */ + @XmlElement(name = "login-attempt-limit") + private int loginAttemptLimit = -1; + + /** + * glob patterns for urls which are excluded from proxy + */ + @XmlElement(name = "proxy-excludes") + @XmlJavaTypeAdapter(XmlSetStringAdapter.class) + private Set proxyExcludes; + + + private String proxyPassword; + + + private int proxyPort = 8080; + + + private String proxyServer = "proxy.mydomain.com"; + + + private String proxyUser; + + /** + * Skip failed authenticators. + * + * @since 1.36 + */ + @XmlElement(name = "skip-failed-authenticators") + private boolean skipFailedAuthenticators = false; + + + @XmlElement(name = "plugin-url") + private String pluginUrl = DEFAULT_PLUGINURL; + + /** + * Login attempt timeout. + * + * @since 1.34 + */ + @XmlElement(name = "login-attempt-limit-timeout") + private long loginAttemptLimitTimeout = TimeUnit.MINUTES.toSeconds(5l); + + + private boolean enableProxy = false; + + /** + * Authentication realm for basic authentication. + */ + private String realmDescription = HttpUtil.AUTHENTICATION_REALM; + private boolean enableRepositoryArchive = false; + private boolean disableGroupingGrid = false; + /** + * JavaScript date format from moment.js + * + * @see http://momentjs.com/docs/#/parsing/ + */ + private String dateFormat = DEFAULT_DATEFORMAT; + private boolean anonymousAccessEnabled = false; + + /** + * Enables xsrf cookie protection. + * + * @since 1.47 + */ + @XmlElement(name = "xsrf-protection") + private boolean enabledXsrfProtection = true; + + @XmlElement(name = "default-namespace-strategy") + private String defaultNamespaceStrategy = "sonia.scm.repository.DefaultNamespaceStrategy"; + /** * Calls the {@link sonia.scm.ConfigChangedListener#configChanged(Object)} * method of all registered listeners. */ - public void fireChangeEvent() - { - if (logger.isDebugEnabled()) - { + public void fireChangeEvent() { + if (logger.isDebugEnabled()) { logger.debug("fire config changed event"); } @@ -109,12 +203,9 @@ public class ScmConfiguration /** * Load all properties from another {@link ScmConfiguration} object. * - * - * * @param other */ - public void load(ScmConfiguration other) - { + public void load(ScmConfiguration other) { this.realmDescription = other.realmDescription; this.dateFormat = other.dateFormat; this.pluginUrl = other.pluginUrl; @@ -135,29 +226,14 @@ public class ScmConfiguration this.loginAttemptLimit = other.loginAttemptLimit; this.loginAttemptLimitTimeout = other.loginAttemptLimitTimeout; this.enabledXsrfProtection = other.enabledXsrfProtection; + this.defaultNamespaceStrategy = other.defaultNamespaceStrategy; } - //~--- get methods ---------------------------------------------------------- - - /** - * Returns a set of admin group names. - * - * - * @return set of admin group names - */ - public Set getAdminGroups() - { + public Set getAdminGroups() { return adminGroups; } - /** - * Returns a set of admin user names. - * - * - * @return set of admin user names - */ - public Set getAdminUsers() - { + public Set getAdminUsers() { return adminUsers; } @@ -165,11 +241,10 @@ public class ScmConfiguration * Returns the complete base url of the scm-manager including the context path. * For example http://localhost:8080/scm * - * @since 1.5 * @return complete base url of the scm-manager + * @since 1.5 */ - public String getBaseUrl() - { + public String getBaseUrl() { return baseUrl; } @@ -177,23 +252,14 @@ public class ScmConfiguration * Returns the date format for the user interface. This format is a * JavaScript date format, from the library moment.js. * - * @see http://momentjs.com/docs/#/parsing/ * @return moment.js date format + * @see http://momentjs.com/docs/#/parsing/ */ - public String getDateFormat() - { + public String getDateFormat() { return dateFormat; } - /** - * Returns maximum allowed login attempts. - * - * @return maximum allowed login attempts - * - * @since 1.34 - */ - public int getLoginAttemptLimit() - { + public int getLoginAttemptLimit() { return loginAttemptLimit; } @@ -202,11 +268,9 @@ public class ScmConfiguration * because of too many failed login attempts. * * @return login attempt timeout in seconds - * * @since 1.34 */ - public long getLoginAttemptLimitTimeout() - { + public long getLoginAttemptLimitTimeout() { return loginAttemptLimitTimeout; } @@ -222,8 +286,7 @@ public class ScmConfiguration * * @return the complete plugin url. */ - public String getPluginUrl() - { + public String getPluginUrl() { return pluginUrl; } @@ -231,289 +294,141 @@ public class ScmConfiguration * Returns a set of glob patterns for urls which should excluded from * proxy settings. * - * * @return set of glob patterns * @since 1.23 */ - public Set getProxyExcludes() - { - if (proxyExcludes == null) - { + public Set getProxyExcludes() { + if (proxyExcludes == null) { proxyExcludes = Sets.newHashSet(); } return proxyExcludes; } - /** - * Method description - * - * - * @return - * @since 1.7 - */ - public String getProxyPassword() - { + public String getProxyPassword() { return proxyPassword; } - /** - * Returns the proxy port. - * - * - * @return proxy port - */ - public int getProxyPort() - { + public int getProxyPort() { return proxyPort; } /** * Returns the servername or ip of the proxyserver. * - * * @return servername or ip of the proxyserver */ - public String getProxyServer() - { + public String getProxyServer() { return proxyServer; } - /** - * Method description - * - * - * @return - * @since 1.7 - */ - public String getProxyUser() - { + public String getProxyUser() { return proxyUser; } - /** - * Returns the realm description. - * - * - * @return realm description - * @since 1.36 - */ - public String getRealmDescription() - { + public String getRealmDescription() { return realmDescription; } - - /** - * Returns true if the anonymous access to the SCM-Manager is enabled. - * - * - * @return true if the anonymous access to the SCM-Manager is enabled - */ - public boolean isAnonymousAccessEnabled() - { + public boolean isAnonymousAccessEnabled() { return anonymousAccessEnabled; } - /** - * Method description - * - * @since 1.9 - * @return - */ - public boolean isDisableGroupingGrid() - { + public boolean isDisableGroupingGrid() { return disableGroupingGrid; } /** * Returns {@code true} if the cookie xsrf protection is enabled. - * - * @see Issue 793 + * * @return {@code true} if the cookie xsrf protection is enabled - * + * @see Issue 793 * @since 1.47 */ - public boolean isEnabledXsrfProtection() - { + public boolean isEnabledXsrfProtection() { return enabledXsrfProtection; } - /** - * Returns true if proxy is enabled. - * - * - * @return true if proxy is enabled - */ - public boolean isEnableProxy() - { + public boolean isEnableProxy() { return enableProxy; } - /** - * Returns true if the repository archive is enabled. - * - * - * @return true if the repository archive is enabled - * @since 1.14 - */ - public boolean isEnableRepositoryArchive() - { + public boolean isEnableRepositoryArchive() { return enableRepositoryArchive; } - /** - * Returns true if force base url is enabled. - * - * @since 1.5 - * @return true if force base url is enabled - */ - public boolean isForceBaseUrl() - { + public boolean isForceBaseUrl() { return forceBaseUrl; } - /** - * Returns true if the login attempt limit is enabled. - * - * - * @return true if login attempt limit is enabled - * - * @since 1.37 - */ - public boolean isLoginAttemptLimitEnabled() - { + public boolean isLoginAttemptLimitEnabled() { return loginAttemptLimit > 0; } + public String getDefaultNamespaceStrategy() { + return defaultNamespaceStrategy; + } + + /** * Returns true if failed authenticators are skipped. * - * * @return true if failed authenticators are skipped - * * @since 1.36 */ - public boolean isSkipFailedAuthenticators() - { + public boolean isSkipFailedAuthenticators() { return skipFailedAuthenticators; } - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param adminGroups - */ - public void setAdminGroups(Set adminGroups) - { + public void setAdminGroups(Set adminGroups) { this.adminGroups = adminGroups; } - /** - * Method description - * - * - * @param adminUsers - */ - public void setAdminUsers(Set adminUsers) - { + public void setAdminUsers(Set adminUsers) { this.adminUsers = adminUsers; } - /** - * Method description - * - * - * @param anonymousAccessEnabled - */ - public void setAnonymousAccessEnabled(boolean anonymousAccessEnabled) - { + public void setAnonymousAccessEnabled(boolean anonymousAccessEnabled) { this.anonymousAccessEnabled = anonymousAccessEnabled; } - /** - * Method description - * - * - * @param baseUrl - * @since 1.5 - */ - public void setBaseUrl(String baseUrl) - { + public void setBaseUrl(String baseUrl) { this.baseUrl = baseUrl; } - /** - * Sets the date format for the ui. - * - * - * @param dateFormat date format for ui - */ - public void setDateFormat(String dateFormat) - { + public void setDateFormat(String dateFormat) { this.dateFormat = dateFormat; } - /** - * Method description - * - * @since 1.9 - * - * @param disableGroupingGrid - */ - public void setDisableGroupingGrid(boolean disableGroupingGrid) - { + public void setDisableGroupingGrid(boolean disableGroupingGrid) { this.disableGroupingGrid = disableGroupingGrid; } - /** - * Method description - * - * - * @param enableProxy - */ - public void setEnableProxy(boolean enableProxy) - { + public void setEnableProxy(boolean enableProxy) { this.enableProxy = enableProxy; } /** * Enable or disable the repository archive. Default is disabled. * - * * @param enableRepositoryArchive true to disable the repository archive * @since 1.14 */ - public void setEnableRepositoryArchive(boolean enableRepositoryArchive) - { + public void setEnableRepositoryArchive(boolean enableRepositoryArchive) { this.enableRepositoryArchive = enableRepositoryArchive; } - /** - * Method description - * - * - * @param forceBaseUrl - * @since 1.5 - */ - public void setForceBaseUrl(boolean forceBaseUrl) - { + public void setForceBaseUrl(boolean forceBaseUrl) { this.forceBaseUrl = forceBaseUrl; } /** * Set maximum allowed login attempts. * - * * @param loginAttemptLimit login attempt limit - * * @since 1.34 */ - public void setLoginAttemptLimit(int loginAttemptLimit) - { + public void setLoginAttemptLimit(int loginAttemptLimit) { this.loginAttemptLimit = loginAttemptLimit; } @@ -522,22 +437,13 @@ public class ScmConfiguration * because of too many failed login attempts. * * @param loginAttemptLimitTimeout login attempt timeout in seconds - * * @since 1.34 */ - public void setLoginAttemptLimitTimeout(long loginAttemptLimitTimeout) - { + public void setLoginAttemptLimitTimeout(long loginAttemptLimitTimeout) { this.loginAttemptLimitTimeout = loginAttemptLimitTimeout; } - /** - * Method description - * - * - * @param pluginUrl - */ - public void setPluginUrl(String pluginUrl) - { + public void setPluginUrl(String pluginUrl) { this.pluginUrl = pluginUrl; } @@ -545,194 +451,64 @@ public class ScmConfiguration * Set glob patterns for urls which are should be excluded from proxy * settings. * - * * @param proxyExcludes glob patterns * @since 1.23 */ - public void setProxyExcludes(Set proxyExcludes) - { + public void setProxyExcludes(Set proxyExcludes) { this.proxyExcludes = proxyExcludes; } - /** - * Method description - * - * - * @param proxyPassword - * @since 1.7 - */ - public void setProxyPassword(String proxyPassword) - { + public void setProxyPassword(String proxyPassword) { this.proxyPassword = proxyPassword; } - /** - * Method description - * - * - * @param proxyPort - */ - public void setProxyPort(int proxyPort) - { + public void setProxyPort(int proxyPort) { this.proxyPort = proxyPort; } - /** - * Method description - * - * - * @param proxyServer - */ - public void setProxyServer(String proxyServer) - { + public void setProxyServer(String proxyServer) { this.proxyServer = proxyServer; } - /** - * Method description - * - * - * @param proxyUser - * @since 1.7 - */ - public void setProxyUser(String proxyUser) - { + public void setProxyUser(String proxyUser) { this.proxyUser = proxyUser; } - /** - * Sets the realm description. - * - * - * @param realmDescription - * @since 1.36 - */ - public void setRealmDescription(String realmDescription) - { + public void setRealmDescription(String realmDescription) { this.realmDescription = realmDescription; } /** - * If set to true the authentication chain is not stopped, if an + * If set to true the authentication chain is not stopped, if an * authenticator finds the user but fails to authenticate the user. * * @param skipFailedAuthenticators true to skip failed authenticators - * * @since 1.36 */ - public void setSkipFailedAuthenticators(boolean skipFailedAuthenticators) - { + public void setSkipFailedAuthenticators(boolean skipFailedAuthenticators) { this.skipFailedAuthenticators = skipFailedAuthenticators; } /** * Set {@code true} to enable xsrf cookie protection. - * + * * @param enabledXsrfProtection {@code true} to enable xsrf protection * @see Issue 793 - * * @since 1.47 */ - public void setEnabledXsrfProtection(boolean enabledXsrfProtection) - { + public void setEnabledXsrfProtection(boolean enabledXsrfProtection) { this.enabledXsrfProtection = enabledXsrfProtection; } - //~--- fields --------------------------------------------------------------- + public void setDefaultNamespaceStrategy(String defaultNamespaceStrategy) { + this.defaultNamespaceStrategy = defaultNamespaceStrategy; + } - /** Field description */ - @XmlElement(name = "admin-groups") - @XmlJavaTypeAdapter(XmlSetStringAdapter.class) - private Set adminGroups; - - /** Field description */ - @XmlElement(name = "admin-users") - @XmlJavaTypeAdapter(XmlSetStringAdapter.class) - private Set adminUsers; - - /** Field description */ - @XmlElement(name = "base-url") - private String baseUrl; - - /** Field description */ - @XmlElement(name = "force-base-url") - private boolean forceBaseUrl; - - /** - * Maximum allowed login attempts. - * - * @since 1.34 - */ - @XmlElement(name = "login-attempt-limit") - private int loginAttemptLimit = -1; - - /** glob patterns for urls which are excluded from proxy */ - @XmlElement(name = "proxy-excludes") - @XmlJavaTypeAdapter(XmlSetStringAdapter.class) - private Set proxyExcludes; - - /** Field description */ - private String proxyPassword; - - /** Field description */ - private int proxyPort = 8080; - - /** Field description */ - private String proxyServer = "proxy.mydomain.com"; - - /** Field description */ - private String proxyUser; - - /** - * Skip failed authenticators. - * - * @since 1.36 - */ - @XmlElement(name = "skip-failed-authenticators") - private boolean skipFailedAuthenticators = false; - - /** Field description */ - @XmlElement(name = "plugin-url") - private String pluginUrl = DEFAULT_PLUGINURL; - - /** - * Login attempt timeout. - * - * @since 1.34 - */ - @XmlElement(name = "login-attempt-limit-timeout") - private long loginAttemptLimitTimeout = TimeUnit.MINUTES.toSeconds(5l); - - /** Field description */ - private boolean enableProxy = false; - - /** - * - * Authentication realm for basic authentication. - * - */ - private String realmDescription = HttpUtil.AUTHENTICATION_REALM; - - /** Field description */ - private boolean enableRepositoryArchive = false; - - /** Field description */ - private boolean disableGroupingGrid = false; - - /** - * JavaScript date format from moment.js - * @see http://momentjs.com/docs/#/parsing/ - */ - private String dateFormat = DEFAULT_DATEFORMAT; - - /** Field description */ - private boolean anonymousAccessEnabled = false; - - /** - * Enables xsrf cookie protection. - * - * @since 1.47 - */ - @XmlElement(name = "xsrf-protection") - private boolean enabledXsrfProtection = true; + @Override + // Only for permission checks, don't serialize to XML + @XmlTransient + public String getId() { + // Don't change this without migrating SCM permission configuration! + return "global"; + } } diff --git a/scm-core/src/main/java/sonia/scm/repository/AbstactImportHandler.java b/scm-core/src/main/java/sonia/scm/repository/AbstactImportHandler.java index 2da506674d..6e0827af4a 100644 --- a/scm-core/src/main/java/sonia/scm/repository/AbstactImportHandler.java +++ b/scm-core/src/main/java/sonia/scm/repository/AbstactImportHandler.java @@ -36,19 +36,16 @@ package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- import com.google.common.base.Throwables; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import sonia.scm.repository.ImportResult.Builder; -//~--- JDK imports ------------------------------------------------------------ - import java.io.File; import java.io.IOException; - import java.util.List; +//~--- JDK imports ------------------------------------------------------------ + /** * Abstract base class for directory based {@link ImportHandler} and * {@link AdvancedImportHandler}. @@ -164,23 +161,24 @@ public abstract class AbstactImportHandler implements AdvancedImportHandler logger.trace("search for repositories to import"); - try - { - - List repositoryNames = - RepositoryUtil.getRepositoryNames(getRepositoryHandler(), - getDirectoryNames()); - - for (String repositoryName : repositoryNames) - { - importRepository(manager, builder, throwExceptions, repositoryName); - } - - } - catch (IOException ex) - { - handleException(ex, throwExceptions); - } + // TODO #8783 +// try +// { +// +// List repositoryNames = +// RepositoryUtil.getRepositoryNames(getRepositoryHandler(), +// getDirectoryNames()); +// +// for (String repositoryName : repositoryNames) +// { +// importRepository(manager, builder, throwExceptions, repositoryName); +// } +// +// } +// catch (IOException ex) +// { +// handleException(ex, throwExceptions); +// } return builder.build(); } @@ -214,46 +212,48 @@ public abstract class AbstactImportHandler implements AdvancedImportHandler * @param manager * @param builder * @param throwExceptions - * @param repositoryName + * @param directoryName * * @throws IOException * @throws RepositoryException */ private void importRepository(RepositoryManager manager, Builder builder, - boolean throwExceptions, String repositoryName) + boolean throwExceptions, String directoryName) throws IOException, RepositoryException { - logger.trace("check repository {} for import", repositoryName); + logger.trace("check repository {} for import", directoryName); - Repository repository = manager.get(getTypeName(), repositoryName); - - if (repository == null) - { - try - { - importRepository(manager, repositoryName); - builder.addImportedDirectory(repositoryName); - } - catch (IOException ex) - { - builder.addFailedDirectory(repositoryName); - handleException(ex, throwExceptions); - } - catch (IllegalStateException ex) - { - builder.addFailedDirectory(repositoryName); - handleException(ex, throwExceptions); - } - catch (RepositoryException ex) - { - builder.addFailedDirectory(repositoryName); - handleException(ex, throwExceptions); - } - } - else if (logger.isDebugEnabled()) - { - logger.debug("repository {} is allready managed", repositoryName); - } + // TODO #8783 +// +// Repository repository = manager.get(namespaceAndName); +// +// if (repository == null) +// { +// try +// { +// importRepository(manager, repositoryName); +// builder.addImportedDirectory(repositoryName); +// } +// catch (IOException ex) +// { +// builder.addFailedDirectory(repositoryName); +// handleException(ex, throwExceptions); +// } +// catch (IllegalStateException ex) +// { +// builder.addFailedDirectory(repositoryName); +// handleException(ex, throwExceptions); +// } +// catch (RepositoryException ex) +// { +// builder.addFailedDirectory(repositoryName); +// handleException(ex, throwExceptions); +// } +// } +// else if (logger.isDebugEnabled()) +// { +// logger.debug("repository {} is already managed", repositoryName); +// } } /** diff --git a/scm-core/src/main/java/sonia/scm/repository/AbstractRepositoryHandler.java b/scm-core/src/main/java/sonia/scm/repository/AbstractRepositoryHandler.java index a327b50dae..33b6cb8030 100644 --- a/scm-core/src/main/java/sonia/scm/repository/AbstractRepositoryHandler.java +++ b/scm-core/src/main/java/sonia/scm/repository/AbstractRepositoryHandler.java @@ -56,7 +56,7 @@ import sonia.scm.store.ConfigurationStoreFactory; * * @param */ -public abstract class AbstractRepositoryHandler +public abstract class AbstractRepositoryHandler implements RepositoryHandler { diff --git a/scm-core/src/main/java/sonia/scm/repository/AbstractSimpleRepositoryHandler.java b/scm-core/src/main/java/sonia/scm/repository/AbstractSimpleRepositoryHandler.java index b49d4355b9..536b7bd9e9 100644 --- a/scm-core/src/main/java/sonia/scm/repository/AbstractSimpleRepositoryHandler.java +++ b/scm-core/src/main/java/sonia/scm/repository/AbstractSimpleRepositoryHandler.java @@ -1,19 +1,19 @@ /** * Copyright (c) 2010, Sebastian Sdorra * All rights reserved. - * + *

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + *

* 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + *

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,13 +24,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + *

* http://bitbucket.org/sdorra/scm-manager - * */ - package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- @@ -54,91 +52,56 @@ import java.net.URL; //~--- JDK imports ------------------------------------------------------------ /** - * - * @author Sebastian Sdorra - * - * * @param + * @author Sebastian Sdorra */ -public abstract class AbstractSimpleRepositoryHandler - extends AbstractRepositoryHandler implements RepositoryDirectoryHandler -{ +public abstract class AbstractSimpleRepositoryHandler + extends AbstractRepositoryHandler implements RepositoryDirectoryHandler { - /** Field description */ public static final String DEFAULT_VERSION_INFORMATION = "unknown"; - /** Field description */ public static final String DIRECTORY_REPOSITORY = "repositories"; - /** Field description */ public static final String DOT = "."; - /** the logger for AbstractSimpleRepositoryHandler */ + /** + * the logger for AbstractSimpleRepositoryHandler + */ private static final Logger logger = LoggerFactory.getLogger(AbstractSimpleRepositoryHandler.class); - //~--- constructors --------------------------------------------------------- + private FileSystem fileSystem; + - /** - * Constructs ... - * - * - * @param storeFactory - * @param fileSystem - */ public AbstractSimpleRepositoryHandler(ConfigurationStoreFactory storeFactory, - FileSystem fileSystem) - { + FileSystem fileSystem) { super(storeFactory); this.fileSystem = fileSystem; } - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param repository - * - * @throws IOException - * @throws RepositoryException - */ @Override public Repository create(Repository repository) - throws RepositoryException - { + throws RepositoryException { File directory = getDirectory(repository); - if (directory.exists()) - { + if (directory.exists()) { throw RepositoryAlreadyExistsException.create(repository); } checkPath(directory); - try - { + try { fileSystem.create(directory); create(repository, directory); postCreate(repository, directory); return repository; - } - catch (Exception ex) - { - if (directory.exists()) - { - if (logger.isDebugEnabled()) - { - logger.debug( - "delete repository directory {}, because of failed repository creation", - directory); - } - + } catch (Exception ex) { + if (directory.exists()) { + logger.warn("delete repository directory {}, because of failed repository creation", directory); try { fileSystem.destroy(directory); } catch (IOException e) { - logger.error("could not delete directory after failed repository creation: {}", directory, e); + logger.error("Could not destroy directory", e); } } @@ -148,77 +111,48 @@ public abstract class AbstractSimpleRepositoryHandler { + + private final Set strategies; + private final ScmConfiguration scmConfiguration; + + @Inject + public NamespaceStrategyProvider(Set strategies, ScmConfiguration scmConfiguration) { + this.strategies = strategies; + this.scmConfiguration = scmConfiguration; + } + + @Override + public NamespaceStrategy get() { + String namespaceStrategy = scmConfiguration.getDefaultNamespaceStrategy(); + + for (NamespaceStrategy s : this.strategies) { + if (s.getClass().getCanonicalName().equals(namespaceStrategy)) { + return s; + } + } + return null; + } + +} diff --git a/scm-core/src/main/java/sonia/scm/repository/Repository.java b/scm-core/src/main/java/sonia/scm/repository/Repository.java index 0b4d1c4dcd..44841893e7 100644 --- a/scm-core/src/main/java/sonia/scm/repository/Repository.java +++ b/scm-core/src/main/java/sonia/scm/repository/Repository.java @@ -48,6 +48,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -58,7 +59,7 @@ import java.util.List; * @author Sebastian Sdorra */ @StaticPermissions( - value = "repository", + value = "repository", permissions = {"read", "write", "modify", "delete", "healthCheck"} ) @XmlAccessorType(XmlAccessType.FIELD) @@ -99,9 +100,10 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per * @param type type of the {@link Repository} * @param name name of the {@link Repository} */ - public Repository(String id, String type, String name) { + public Repository(String id, String type, String namespace, String name) { this.id = id; this.type = type; + this.namespace = namespace; this.name = name; } @@ -176,44 +178,28 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per return healthCheckFailures; } - /** - * Returns the unique id of the {@link Repository}. - * - * @return unique id - */ @Override public String getId() { return id; } - /** - * Returns the timestamp of the last modified date of the {@link Repository}. - * - * @return timestamp of the last modified date - */ @Override public Long getLastModified() { return lastModified; } - /** - * Returns the name of the {@link Repository}. - * - * @return name of the {@link Repository} - */ + public String getName() { return name; } - public String getNamespace() { - return namespace; + public String getNamespace() { return namespace; } + + @XmlTransient + public NamespaceAndName getNamespaceAndName() { + return new NamespaceAndName(getNamespace(), getName()); } - /** - * Returns the access permissions of the {@link Repository}. - * - * @return access permissions - */ public List getPermissions() { if (permissions == null) { permissions = Lists.newArrayList(); @@ -370,9 +356,7 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per * @since 1.17 */ public String createUrl(String baseUrl) { - String url = HttpUtil.append(baseUrl, type); - - return HttpUtil.append(url, name); + return HttpUtil.concatenate(baseUrl, type, namespace, name); } /** diff --git a/scm-core/src/main/java/sonia/scm/repository/SimpleRepositoryConfig.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryConfig.java similarity index 82% rename from scm-core/src/main/java/sonia/scm/repository/SimpleRepositoryConfig.java rename to scm-core/src/main/java/sonia/scm/repository/RepositoryConfig.java index 3654b9c8b4..3db13e5618 100644 --- a/scm-core/src/main/java/sonia/scm/repository/SimpleRepositoryConfig.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryConfig.java @@ -33,15 +33,12 @@ package sonia.scm.repository; -//~--- non-JDK imports -------------------------------------------------------- - import sonia.scm.Validateable; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.File; +import sonia.scm.config.Configuration; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; +import java.io.File; /** * Basic {@link Repository} configuration class. @@ -49,7 +46,7 @@ import javax.xml.bind.annotation.XmlRootElement; * @author Sebastian Sdorra */ @XmlRootElement -public class SimpleRepositoryConfig implements Validateable +public abstract class RepositoryConfig implements Validateable, Configuration { /** @@ -119,4 +116,19 @@ public class SimpleRepositoryConfig implements Validateable /** directory for repositories */ private File repositoryDirectory; + + /** + * Specifies the identifier of the concrete {@link RepositoryConfig} when checking permissions of an object. + * The permission Strings will have the following format: "configuration:*:ID", where the ID part is defined by this + * method. + * + * For example: "configuration:read:git". + * + * No need to serialize this. + * + * @return identifier of this RepositoryConfig in permission strings + */ + @Override + @XmlTransient // Only for permission checks, don't serialize to XML + public abstract String getId(); } diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryDAO.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryDAO.java index 9a2d4b5662..ce309ecee6 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryDAO.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryDAO.java @@ -49,27 +49,22 @@ public interface RepositoryDAO extends GenericDAO /** * Returns true if a repository with specified - * type and name exists in the backend. + * namespace and name exists in the backend. * * - * @param type type of the repository - * @param name name of the repository + * @param namespaceAndName namespace and name of the repository * * @return true if the repository exists */ - public boolean contains(String type, String name); + boolean contains(NamespaceAndName namespaceAndName); //~--- get methods ---------------------------------------------------------- /** - * Returns the repository with the specified type and name or null + * Returns the repository with the specified namespace and name or null * if no such repository exists in the backend. * - * - * @param type - * @param name - * - * @return repository with the specified type and name or null + * @return repository with the specified namespace and name or null */ - public Repository get(String type, String name); + Repository get(NamespaceAndName namespaceAndName); } diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryDirectoryHandler.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryDirectoryHandler.java index 3fda4a76be..2f766fb1f6 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryDirectoryHandler.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryDirectoryHandler.java @@ -43,13 +43,5 @@ import java.io.File; public interface RepositoryDirectoryHandler extends RepositoryHandler { - /** - * Method description - * - * - * @param repository - * - * @return - */ public File getDirectory(Repository repository); } diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryHandlerConfigChangedEvent.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryHandlerConfigChangedEvent.java index 844c4a78d6..645274e494 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryHandlerConfigChangedEvent.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryHandlerConfigChangedEvent.java @@ -37,7 +37,7 @@ import sonia.scm.event.Event; * @since 2.0.0 */ @Event -public class RepositoryHandlerConfigChangedEvent +public class RepositoryHandlerConfigChangedEvent { private final C configuration; diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryManager.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryManager.java index 0edd21f4c2..493d8f6dbb 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryManager.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryManager.java @@ -82,18 +82,17 @@ public interface RepositoryManager //~--- get methods ---------------------------------------------------------- /** - * Returns a {@link Repository} by its type and name or + * Returns a {@link Repository} by its namespace and name or * null if the {@link Repository} could not be found. * * - * @param type type of the {@link Repository} - * @param name name of the {@link Repository} + * @param namespaceAndName namespace and name of the {@link Repository} * * - * @return {@link Repository} by its type and name or null + * @return {@link Repository} by its namespace and name or null * if the {@link Repository} could not be found */ - public Repository get(String type, String name); + public Repository get(NamespaceAndName namespaceAndName); /** * Returns all configured repository types. @@ -114,18 +113,6 @@ public interface RepositoryManager */ public Repository getFromRequest(HttpServletRequest request); - /** - * Returns the {@link Repository} associated to the given type and path. - * - * - * @param type type of the repository (hg, git ...) - * @param uri - * - * @return the {@link Repository} associated to the given type and path - * @since 1.9 - */ - public Repository getFromTypeAndUri(String type, String uri); - /** * Returns the {@link Repository} associated to the request uri. * diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryManagerDecorator.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryManagerDecorator.java index d99a6483ab..6990baf7c5 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryManagerDecorator.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryManagerDecorator.java @@ -91,9 +91,9 @@ public class RepositoryManagerDecorator //~--- get methods ---------------------------------------------------------- @Override - public Repository get(String namespace, String name) + public Repository get(NamespaceAndName namespaceAndName) { - return decorated.get(namespace, name); + return decorated.get(namespaceAndName); } /** @@ -135,21 +135,6 @@ public class RepositoryManagerDecorator return decorated.getFromRequest(request); } - /** - * {@inheritDoc} - * - * - * @param type - * @param uri - * - * @return - */ - @Override - public Repository getFromTypeAndUri(String type, String uri) - { - return decorated.getFromTypeAndUri(type, uri); - } - /** * {@inheritDoc} * diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryUtil.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryUtil.java index e271992248..a90eb4cc34 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryUtil.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryUtil.java @@ -35,278 +35,86 @@ package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - +import com.google.common.base.Preconditions; import sonia.scm.io.DirectoryFileFilter; import sonia.scm.util.IOUtil; -//~--- JDK imports ------------------------------------------------------------ - import java.io.File; import java.io.IOException; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; +//~--- JDK imports ------------------------------------------------------------ + /** * * @author Sebastian Sdorra * @since 1.11 */ -public final class RepositoryUtil -{ +public final class RepositoryUtil { - /** the logger for RepositoryUtil */ - private static final Logger logger = - LoggerFactory.getLogger(RepositoryUtil.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ private RepositoryUtil() {} - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param directory - * @param names - * - * @return - */ - public static List searchRepositoryDirectories(File directory, - String... names) - { - List repositories = new ArrayList(); + public static List searchRepositoryDirectories(File directory, String... names) { + List repositories = new ArrayList<>(); searchRepositoryDirectories(repositories, directory, Arrays.asList(names)); return repositories; } - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * - * @param handler - * @param directoryPath - * @return - * - * @throws IOException - */ - public static String getRepositoryName(AbstractRepositoryHandler handler, - String directoryPath) - throws IOException - { - return getRepositoryName(handler.getConfig().getRepositoryDirectory(), - new File(directoryPath)); + @SuppressWarnings("squid:S2083") // ignore, because the path is validated at {@link #getRepositoryId(File, File)} + public static String getRepositoryId(AbstractRepositoryHandler handler, String directoryPath) throws IOException { + return getRepositoryId(handler.getConfig().getRepositoryDirectory(), new File(directoryPath)); } - /** - * Method description - * - * - * - * @param config - * @param directoryPath - * @return - * - * @throws IOException - */ - public static String getRepositoryName(SimpleRepositoryConfig config, - String directoryPath) - throws IOException - { - return getRepositoryName(config.getRepositoryDirectory(), - new File(directoryPath)); + public static String getRepositoryId(AbstractRepositoryHandler handler, File directory) throws IOException { + return getRepositoryId(handler.getConfig(), directory); } - /** - * Method description - * - * - * - * @param handler - * @param directory - * @return - * - * @throws IOException - */ - public static String getRepositoryName(AbstractRepositoryHandler handler, - File directory) - throws IOException - { - return getRepositoryName(handler.getConfig().getRepositoryDirectory(), - directory); + public static String getRepositoryId(RepositoryConfig config, File directory) throws IOException { + return getRepositoryId(config.getRepositoryDirectory(), directory); } - /** - * Method description - * - * - * - * @param config - * @param directory - * @return - * - * @throws IOException - */ - public static String getRepositoryName(SimpleRepositoryConfig config, - File directory) - throws IOException - { - return getRepositoryName(config.getRepositoryDirectory(), directory); - } - - /** - * Method description - * - * - * - * @param baseDirectory - * @param directory - * @return - * - * @throws IOException - */ - public static String getRepositoryName(File baseDirectory, File directory) - throws IOException - { - String name = null; + public static String getRepositoryId(File baseDirectory, File directory) throws IOException { String path = directory.getCanonicalPath(); - int directoryLength = baseDirectory.getCanonicalPath().length(); + String basePath = baseDirectory.getCanonicalPath(); - if (directoryLength < path.length()) - { - name = IOUtil.trimSeperatorChars(path.substring(directoryLength)); + Preconditions.checkArgument( + path.startsWith(basePath), + "repository path %s is not in the main repository path %s", path, basePath + ); - // replace windows path seperator - name = name.replaceAll("\\\\", "/"); - } - else if (logger.isWarnEnabled()) - { - logger.warn("path is shorter as the main repository path"); - } + String id = IOUtil.trimSeperatorChars(path.substring(basePath.length())); - return name; + Preconditions.checkArgument( + !id.contains("\\") && !id.contains("/"), + "got illegal repository directory with separators in id: %s", path + ); + + return id; } - /** - * Method description - * - * - * @param handler - * @param directoryNames - * - * @return - * - * @throws IOException - */ - public static List getRepositoryNames( - AbstractRepositoryHandler handler, String... directoryNames) - throws IOException - { - return getRepositoryNames(handler.getConfig(), directoryNames); - } - - /** - * Method description - * - * - * @param config - * @param directoryNames - * - * @return - * - * @throws IOException - */ - public static List getRepositoryNames(SimpleRepositoryConfig config, - String... directoryNames) - throws IOException - { - return getRepositoryNames(config.getRepositoryDirectory(), directoryNames); - } - - /** - * Method description - * - * - * @param baseDirectory - * @param directoryNames - * - * @return - * - * @throws IOException - */ - public static List getRepositoryNames(File baseDirectory, - String... directoryNames) - throws IOException - { - List repositories = new ArrayList(); - List repositoryFiles = searchRepositoryDirectories(baseDirectory, - directoryNames); - - for (File file : repositoryFiles) - { - String name = getRepositoryName(baseDirectory, file); - - if (name != null) - { - repositories.add(name); - } - } - - return repositories; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param repositories - * @param directory - * @param names - */ - private static void searchRepositoryDirectories(List repositories, - File directory, List names) - { + private static void searchRepositoryDirectories(List repositories, File directory, List names) { boolean found = false; - for (String name : names) - { - if (new File(directory, name).exists()) - { + for (String name : names) { + if (new File(directory, name).exists()) { found = true; break; } } - if (found) - { + if (found) { repositories.add(directory); - } - else - { + } else { File[] directories = directory.listFiles(DirectoryFileFilter.instance); - if (directories != null) - { - for (File d : directories) - { + if (directories != null) { + for (File d : directories) { searchRepositoryDirectories(repositories, d, names); } } diff --git a/scm-core/src/main/java/sonia/scm/repository/api/RepositoryServiceFactory.java b/scm-core/src/main/java/sonia/scm/repository/api/RepositoryServiceFactory.java index 315156db0d..2e4ff644f4 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/RepositoryServiceFactory.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/RepositoryServiceFactory.java @@ -50,6 +50,7 @@ import sonia.scm.cache.CacheManager; import sonia.scm.config.ScmConfiguration; import sonia.scm.event.ScmEventBus; import sonia.scm.repository.ClearRepositoryCacheEvent; +import sonia.scm.repository.NamespaceAndName; import sonia.scm.repository.PostReceiveRepositoryHookEvent; import sonia.scm.repository.PreProcessorUtil; import sonia.scm.repository.Repository; @@ -186,8 +187,7 @@ public final class RepositoryServiceFactory * Creates a new RepositoryService for the given repository. * * - * @param type type of the repository - * @param name name of the repository + * @param namespaceAndName namespace and name of the repository * * @return a implementation of RepositoryService * for the given type of repository @@ -200,24 +200,19 @@ public final class RepositoryServiceFactory * @throws ScmSecurityException if current user has not read permissions * for that repository */ - public RepositoryService create(String type, String name) + public RepositoryService create(NamespaceAndName namespaceAndName) throws RepositoryNotFoundException { - Preconditions.checkArgument(!Strings.isNullOrEmpty(type), - "a non empty type is required"); - Preconditions.checkArgument(!Strings.isNullOrEmpty(name), - "a non empty name is required"); + Preconditions.checkArgument(namespaceAndName != null, + "a non empty namespace and name is required"); - Repository repository = repositoryManager.get(type, name); + Repository repository = repositoryManager.get(namespaceAndName); if (repository == null) { - StringBuilder msg = - new StringBuilder("could not find a repository with type "); + String msg = "could not find a repository with namespace/name " + namespaceAndName; - msg.append(type).append(" and name ").append(name); - - throw new RepositoryNotFoundException(msg.toString()); + throw new RepositoryNotFoundException(msg); } return create(repository); diff --git a/scm-core/src/main/java/sonia/scm/repository/spi/HookEventFacade.java b/scm-core/src/main/java/sonia/scm/repository/spi/HookEventFacade.java index 899892a5b7..93ed5f1111 100644 --- a/scm-core/src/main/java/sonia/scm/repository/spi/HookEventFacade.java +++ b/scm-core/src/main/java/sonia/scm/repository/spi/HookEventFacade.java @@ -35,7 +35,7 @@ package sonia.scm.repository.spi; import com.google.inject.Inject; import com.google.inject.Provider; - +import sonia.scm.repository.NamespaceAndName; import sonia.scm.repository.Repository; import sonia.scm.repository.RepositoryException; import sonia.scm.repository.RepositoryHookEvent; @@ -72,50 +72,15 @@ public final class HookEventFacade //~--- methods -------------------------------------------------------------- - /** - * Method description - * - * - * @param id - * - * @return - * - * @throws RepositoryException - */ - public HookEventHandler handle(String id) throws RepositoryException - { + public HookEventHandler handle(String id) throws RepositoryException { return handle(repositoryManagerProvider.get().get(id)); } - /** - * Method description - * - * - * @param type - * @param repositoryName - * - * @return - * - * @throws RepositoryException - */ - public HookEventHandler handle(String type, String repositoryName) - throws RepositoryException - { - return handle(repositoryManagerProvider.get().get(type, repositoryName)); + public HookEventHandler handle(NamespaceAndName namespaceAndName) throws RepositoryException { + return handle(repositoryManagerProvider.get().get(namespaceAndName)); } - /** - * Method description - * - * - * @param repository - * - * @return - * - * @throws RepositoryException - */ - public HookEventHandler handle(Repository repository) - throws RepositoryException + public HookEventHandler handle(Repository repository) throws RepositoryException { if (repository == null) { diff --git a/scm-core/src/main/java/sonia/scm/url/ModelUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/ModelUrlProvider.java deleted file mode 100644 index ea60645d00..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/ModelUrlProvider.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ -package sonia.scm.url; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public interface ModelUrlProvider -{ - - /** - * Method description - * - * - * @param name - * - * @return - */ - public String getDetailUrl(String name); - - /** - * Method description - * - * - * @return - */ - public String getAllUrl(); - -} diff --git a/scm-core/src/main/java/sonia/scm/url/RepositoryUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/RepositoryUrlProvider.java deleted file mode 100644 index ebc3f5b907..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/RepositoryUrlProvider.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public interface RepositoryUrlProvider extends ModelUrlProvider -{ - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - public String getBlameUrl(String repositoryId, String path, String revision); - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - public String getBrowseUrl(String repositoryId, String path, String revision); - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * @param start - * @param limit - * - * @return - */ - public String getChangesetUrl(String repositoryId, String path, - String revision, int start, int limit); - - /** - * Method description - * - * - * @param repositoryId - * @param revision - * - * @return - * - * @since 1.12 - */ - public String getChangesetUrl(String repositoryId, String revision); - - /** - * Method description - * - * - * @param repositoryId - * @param start - * @param limit - * - * @return - */ - public String getChangesetUrl(String repositoryId, int start, int limit); - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - public String getContentUrl(String repositoryId, String path, - String revision); - - /** - * Method description - * - * - * @param type - * @param name - * - * @return - * @since 1.11 - */ - public String getDetailUrl(String type, String name); - - /** - * Method description - * - * - * @param repositoryId - * @param revision - * - * @return - */ - public String getDiffUrl(String repositoryId, String revision); - - /** - * Method description - * - * - * @param repositoryId - * - * @return - * @since 1.18 - */ - public String getTagsUrl(String repositoryId); -} diff --git a/scm-core/src/main/java/sonia/scm/url/RestModelUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/RestModelUrlProvider.java deleted file mode 100644 index 3974135a53..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/RestModelUrlProvider.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public class RestModelUrlProvider implements ModelUrlProvider -{ - - /** - * Constructs ... - * - * - * @param baseUrl - * @param modelSuffix - * @param extension - */ - public RestModelUrlProvider(String baseUrl, String modelSuffix, - String extension) - { - this.base = HttpUtil.append(baseUrl, modelSuffix); - this.extension = extension; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public String getAllUrl() - { - return base.concat(extension); - } - - /** - * Method description - * - * - * @param name - * - * @return - */ - @Override - public String getDetailUrl(String name) - { - return HttpUtil.append(base, name).concat(extension); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - protected String base; - - /** Field description */ - protected String extension; -} diff --git a/scm-core/src/main/java/sonia/scm/url/RestRepositoryUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/RestRepositoryUrlProvider.java deleted file mode 100644 index 6c4f0f3235..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/RestRepositoryUrlProvider.java +++ /dev/null @@ -1,278 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.UrlBuilder; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public class RestRepositoryUrlProvider extends RestModelUrlProvider - implements RepositoryUrlProvider -{ - - /** Field description */ - public static final String PARAMETER_LIMIT = "limit"; - - /** Field description */ - public static final String PARAMETER_PATH = "path"; - - /** Field description */ - public static final String PARAMETER_REVISION = "revision"; - - /** Field description */ - public static final String PARAMETER_START = "start"; - - /** Field description */ - public static final String PART_BLAME = "blame"; - - /** Field description */ - public static final String PART_BROWSE = "browse"; - - /** - * @since 1.12 - */ - public static final String PART_CHANGESET = "changeset"; - - /** Field description */ - public static final String PART_CHANGESETS = "changesets"; - - /** Field description */ - public static final String PART_CONTENT = "content"; - - /** Field description */ - public static final String PART_DIFF = "diff"; - - /** Field description */ - public static final String PART_TAGS = "tags"; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param baseUrl - * @param modelSuffix - * @param extension - */ - public RestRepositoryUrlProvider(String baseUrl, String modelSuffix, - String extension) - { - super(baseUrl, modelSuffix, extension); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - public String getBlameUrl(String repositoryId, String path, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new UrlBuilder(base).appendUrlPart(repositoryId).appendUrlPart( - PART_BLAME).append(extension).appendParameter( - PARAMETER_PATH, path).appendParameter( - PARAMETER_REVISION, revision).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - public String getBrowseUrl(String repositoryId, String path, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new UrlBuilder(base).appendUrlPart(repositoryId).appendUrlPart( - PART_BROWSE).append(extension).appendParameter( - PARAMETER_PATH, path).appendParameter( - PARAMETER_REVISION, revision).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * @param start - * @param limit - * - * @return - */ - @Override - public String getChangesetUrl(String repositoryId, String path, - String revision, int start, int limit) - { - revision = UrlUtil.fixRevision(revision); - - return new UrlBuilder(base).appendUrlPart(repositoryId).appendUrlPart( - PART_CHANGESETS).append(extension).appendParameter( - PARAMETER_PATH, path).appendParameter( - PARAMETER_REVISION, revision).appendParameter( - PARAMETER_START, start).appendParameter( - PARAMETER_LIMIT, limit).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param start - * @param limit - * - * @return - */ - @Override - public String getChangesetUrl(String repositoryId, int start, int limit) - { - return new UrlBuilder(base).appendUrlPart(repositoryId).appendUrlPart( - PART_CHANGESETS).append(extension).appendParameter( - PARAMETER_START, start).appendParameter( - PARAMETER_LIMIT, limit).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param revision - * - * @return - * - * @since 1.12 - */ - @Override - public String getChangesetUrl(String repositoryId, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new UrlBuilder(base).appendUrlPart(repositoryId).appendUrlPart( - PART_CHANGESET).appendUrlPart(revision).append(extension).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - public String getContentUrl(String repositoryId, String path, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new UrlBuilder(base).appendUrlPart(repositoryId).appendUrlPart( - PART_CONTENT).appendParameter(PARAMETER_PATH, path).appendParameter( - PARAMETER_REVISION, revision).toString(); - } - - /** - * Method description - * - * - * @param type - * @param name - * - * @return - * @since 1.11 - */ - @Override - public String getDetailUrl(String type, String name) - { - return new UrlBuilder(base).appendUrlPart(type).appendUrlPart(name).append( - extension).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param revision - * - * @return - */ - @Override - public String getDiffUrl(String repositoryId, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new UrlBuilder(base).appendUrlPart(repositoryId).appendUrlPart( - PART_DIFF).appendParameter(PARAMETER_REVISION, revision).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * - * @return - * @since 1.18 - */ - @Override - public String getTagsUrl(String repositoryId) - { - return new UrlBuilder(base).appendUrlPart(repositoryId).appendUrlPart( - PART_TAGS).append(extension).toString(); - } -} diff --git a/scm-core/src/main/java/sonia/scm/url/RestSecurityUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/RestSecurityUrlProvider.java deleted file mode 100644 index 513f728708..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/RestSecurityUrlProvider.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * - * @author Sebastian Sdorra - * @since 1.41 - */ -public class RestSecurityUrlProvider implements SecurityUrlProvider -{ - - /** Field description */ - private static final String PATH_ENCRYPT = "security/cipher/encrypt"; - - /** Field description */ - private static final String PATH_KEY = "security/key"; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param baseUrl - */ - public RestSecurityUrlProvider(String baseUrl) - { - this.baseUrl = baseUrl; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public String getEncryptUrl() - { - return HttpUtil.append(baseUrl, PATH_ENCRYPT); - } - - /** - * Method description - * - * - * @return - */ - @Override - public String getGenerateKeyUrl() - { - return HttpUtil.append(baseUrl, PATH_KEY); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private final String baseUrl; -} diff --git a/scm-core/src/main/java/sonia/scm/url/RestUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/RestUrlProvider.java deleted file mode 100644 index 4abba6db0b..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/RestUrlProvider.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public class RestUrlProvider implements UrlProvider -{ - - /** Field description */ - public static final String PART_API = "api/rest/"; - - /** Field description */ - public static final String PART_AUTHENTICATION = "auth/access_token"; - - /** Field description */ - public static final String PART_CONFIG = "config"; - - /** Field description */ - public static final String PART_GROUP = "groups"; - - /** Field description */ - public static final String PART_REPOSITORIES = "repositories"; - - /** Field description */ - public static final String PART_STATE = "auth"; - - /** Field description */ - public static final String PART_USER = "users"; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param baseUrl - * @param extension - */ - public RestUrlProvider(String baseUrl, String extension) - { - this.baseUrl = HttpUtil.append(baseUrl, PART_API); - this.extension = extension; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public String getAuthenticationUrl() - { - return HttpUtil.append(baseUrl, PART_AUTHENTICATION).concat(extension); - } - - /** - * Method description - * - * - * @return - * - * @since 1.43 - */ - @Override - public String getBaseUrl() - { - return baseUrl; - } - - /** - * Method description - * - * - * @return - */ - @Override - public String getConfigUrl() - { - return HttpUtil.append(baseUrl, PART_CONFIG).concat(extension); - } - - /** - * Method description - * - * - * @return - */ - @Override - public ModelUrlProvider getGroupUrlProvider() - { - return new RestModelUrlProvider(baseUrl, PART_GROUP, extension); - } - - /** - * Method description - * - * - * @return - */ - @Override - public RepositoryUrlProvider getRepositoryUrlProvider() - { - return new RestRepositoryUrlProvider(baseUrl, PART_REPOSITORIES, extension); - } - - /** - * Method description - * - * - * @return - */ - @Override - public SecurityUrlProvider getSecurityUrlProvider() - { - return new RestSecurityUrlProvider(baseUrl); - } - - /** - * Method description - * - * - * @return - */ - @Override - public String getStateUrl() - { - return HttpUtil.append(baseUrl, PART_STATE).concat(extension); - } - - /** - * Method description - * - * - * @return - */ - @Override - public ModelUrlProvider getUserUrlProvider() - { - return new RestModelUrlProvider(baseUrl, PART_USER, extension); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - protected String baseUrl; - - /** Field description */ - protected String extension; -} diff --git a/scm-core/src/main/java/sonia/scm/url/SecurityUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/SecurityUrlProvider.java deleted file mode 100644 index e000c9b754..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/SecurityUrlProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. 2. Redistributions in - * binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. 3. Neither the name of SCM-Manager; - * nor the names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -/** - * - * @author Sebastian Sdorra - * @since 1.41 - */ -public interface SecurityUrlProvider -{ - - /** - * Method description - * - * - * @return - */ - public String getGenerateKeyUrl(); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public String getEncryptUrl(); -} diff --git a/scm-core/src/main/java/sonia/scm/url/UrlProvider.java b/scm-core/src/main/java/sonia/scm/url/UrlProvider.java deleted file mode 100644 index 1ab798d60b..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/UrlProvider.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public interface UrlProvider -{ - - /** - * Method description - * - * - * @return - */ - public String getAuthenticationUrl(); - - /** - * Method description - * - * - * @return - * - * @since 1.43 - */ - public String getBaseUrl(); - - /** - * Method description - * - * - * @return - */ - public String getConfigUrl(); - - /** - * Method description - * - * - * @return - */ - public ModelUrlProvider getGroupUrlProvider(); - - /** - * Method description - * - * - * @return - */ - public RepositoryUrlProvider getRepositoryUrlProvider(); - - /** - * Method description - * - * - * @return - * - * @since 1.41 - */ - public SecurityUrlProvider getSecurityUrlProvider(); - - /** - * Method description - * - * - * @return - */ - public String getStateUrl(); - - /** - * Method description - * - * - * @return - */ - public ModelUrlProvider getUserUrlProvider(); -} diff --git a/scm-core/src/main/java/sonia/scm/url/UrlProviderFactory.java b/scm-core/src/main/java/sonia/scm/url/UrlProviderFactory.java deleted file mode 100644 index bb4b998817..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/UrlProviderFactory.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public final class UrlProviderFactory -{ - - /** Field description */ - public static final String TYPE_RESTAPI_JSON = "json-rest-api"; - - /** Field description */ - public static final String TYPE_RESTAPI_XML = "xml-rest-api"; - - /** Field description */ - public static final String TYPE_WUI = "wui"; - - /** Field description */ - private static final String EXTENSION_JSON = ".json"; - - /** Field description */ - private static final String EXTENSION_XML = ".xml"; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - */ - private UrlProviderFactory() {} - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * - * @param baseUrl - * @param type - * - * @return - */ - public static UrlProvider createUrlProvider(String baseUrl, String type) - { - UrlProvider provider = null; - - if (TYPE_RESTAPI_JSON.equals(type)) - { - provider = new RestUrlProvider(baseUrl, EXTENSION_JSON); - } - else if (TYPE_RESTAPI_XML.equals(type)) - { - provider = new RestUrlProvider(baseUrl, EXTENSION_XML); - } - else if (TYPE_WUI.equals(type)) - { - provider = new WUIUrlProvider(baseUrl); - } - - return provider; - } -} diff --git a/scm-core/src/main/java/sonia/scm/url/UrlUtil.java b/scm-core/src/main/java/sonia/scm/url/UrlUtil.java deleted file mode 100644 index 0d90da10b6..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/UrlUtil.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.Util; - -/** - * - * @author Sebastian Sdorra - * @since 1.11 - */ -public final class UrlUtil -{ - - /** - * Constructs ... - * - */ - private UrlUtil() {} - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param revision - * - * @return - */ - public static String fixRevision(String revision) - { - String fixedRevision = revision; - - if (Util.isNotEmpty(revision)) - { - int index = revision.indexOf(':'); - - if (index > 0) - { - fixedRevision = revision.substring(index + 1); - } - } - - return fixedRevision; - } -} diff --git a/scm-core/src/main/java/sonia/scm/url/WUIModelUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/WUIModelUrlProvider.java deleted file mode 100644 index bef0ef3b68..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/WUIModelUrlProvider.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public class WUIModelUrlProvider implements ModelUrlProvider -{ - - /** - * Constructs ... - * - * - * @param baseUrl - * @param component - */ - public WUIModelUrlProvider(String baseUrl, String component) - { - this.url = HttpUtil.appendHash(baseUrl, component); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public String getAllUrl() - { - return url; - } - - /** - * Method description - * - * - * @param name - * - * @return - */ - @Override - public String getDetailUrl(String name) - { - return url.concat(WUIUrlBuilder.SEPARATOR).concat(name); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private String url; -} diff --git a/scm-core/src/main/java/sonia/scm/url/WUIRepositoryUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/WUIRepositoryUrlProvider.java deleted file mode 100644 index 7809adbcc3..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/WUIRepositoryUrlProvider.java +++ /dev/null @@ -1,274 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * - * @author Sebastian Sdorra - */ -public class WUIRepositoryUrlProvider extends WUIModelUrlProvider - implements RepositoryUrlProvider -{ - - /** Field description */ - public static final String COMPONENT_BROWSER = "repositoryBrowser"; - - /** - * @since 1.15 - */ - public static final String COMPONENT_CHANGESET = "changesetPanel"; - - /** Field description */ - public static final String COMPONENT_CHANGESETS = - "repositoryChangesetViewerPanel"; - - /** Field description */ - public static final String COMPONENT_CONTENT = "contentPanel"; - - /** Field description */ - public static final String COMPONENT_DETAIL = "repositoryPanel"; - - /** Field description */ - public static final String COMPONENT_DIFF = "diffPanel"; - - /** Field description */ - public static final String VIEW_BLAME = "blame"; - - /** - * @since 1.12 - */ - public static final String VIEW_CHANGESET = "changeset"; - - /** Field description */ - public static final String VIEW_CONTENT = "content"; - - /** Field description */ - public static final String VIEW_HISTORY = "history"; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param baseUrl - * @param component - */ - public WUIRepositoryUrlProvider(String baseUrl, String component) - { - super(baseUrl, component); - this.baseUrl = baseUrl; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - public String getBlameUrl(String repositoryId, String path, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new WUIUrlBuilder(baseUrl, COMPONENT_CONTENT).append( - repositoryId).append(revision).append(path).append(VIEW_BLAME).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - public String getBrowseUrl(String repositoryId, String path, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new WUIUrlBuilder(baseUrl, COMPONENT_BROWSER).append( - repositoryId).append(revision).append(path).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * @param start - * @param limit - * - * @return - */ - @Override - public String getChangesetUrl(String repositoryId, String path, - String revision, int start, int limit) - { - revision = UrlUtil.fixRevision(revision); - - // TODO handle start and limit - return new WUIUrlBuilder(baseUrl, COMPONENT_CONTENT).append( - repositoryId).append(revision).append(path).append( - VIEW_HISTORY).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param start - * @param limit - * - * @return - */ - @Override - public String getChangesetUrl(String repositoryId, int start, int limit) - { - return new WUIUrlBuilder(baseUrl, COMPONENT_CHANGESETS).append( - repositoryId).append(start).append(limit).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param revision - * - * @return - * - * @since 1.12 - */ - @Override - public String getChangesetUrl(String repositoryId, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new WUIUrlBuilder(baseUrl, - COMPONENT_CHANGESET).append(repositoryId).append(revision).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - public String getContentUrl(String repositoryId, String path, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new WUIUrlBuilder(baseUrl, COMPONENT_CONTENT).append( - repositoryId).append(revision).append(path).append( - VIEW_HISTORY).toString(); - } - - /** - * Method description - * - * - * @param type - * @param name - * - * @return - * @since 1.11 - */ - @Override - public String getDetailUrl(String type, String name) - { - name = type.concat(HttpUtil.SEPARATOR_PATH).concat(name); - - return new WUIUrlBuilder(baseUrl, COMPONENT_DETAIL).append(name).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * @param revision - * - * @return - */ - @Override - public String getDiffUrl(String repositoryId, String revision) - { - revision = UrlUtil.fixRevision(revision); - - return new WUIUrlBuilder(baseUrl, - COMPONENT_DIFF).append(repositoryId).append(revision).toString(); - } - - /** - * Method description - * - * - * @param repositoryId - * - * @return - * @since 1.18 - */ - @Override - public String getTagsUrl(String repositoryId) - { - return getBrowseUrl(repositoryId, null, null); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private String baseUrl; -} diff --git a/scm-core/src/main/java/sonia/scm/url/WUIUrlBuilder.java b/scm-core/src/main/java/sonia/scm/url/WUIUrlBuilder.java deleted file mode 100644 index c9744effe3..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/WUIUrlBuilder.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public class WUIUrlBuilder -{ - - /** Field description */ - public static final String NULL = "null"; - - /** Field description */ - public static final String SEPARATOR = ";"; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param baseUrl - * @param component - */ - public WUIUrlBuilder(String baseUrl, String component) - { - this.url = HttpUtil.appendHash(baseUrl, component); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param value - * - * @return - */ - public WUIUrlBuilder append(String value) - { - if (value == null) - { - value = NULL; - } - - if (!this.url.endsWith(SEPARATOR)) - { - this.url = this.url.concat(SEPARATOR); - } - - this.url = this.url.concat(value); - - return this; - } - - /** - * Method description - * - * - * @param value - * - * @return - */ - public WUIUrlBuilder append(int value) - { - return append(String.valueOf(value)); - } - - /** - * Method description - * - * - * @return - */ - @Override - public String toString() - { - return url; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private String url; -} diff --git a/scm-core/src/main/java/sonia/scm/url/WUIUrlProvider.java b/scm-core/src/main/java/sonia/scm/url/WUIUrlProvider.java deleted file mode 100644 index bd94bf562e..0000000000 --- a/scm-core/src/main/java/sonia/scm/url/WUIUrlProvider.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * @since 1.9 - * @author Sebastian Sdorra - */ -public class WUIUrlProvider implements UrlProvider -{ - - /** Field description */ - public static final String COMPONENT_CONFIG = "scmConfig"; - - /** Field description */ - public static final String COMPONENT_GROUP = "groupPanel"; - - /** Field description */ - public static final String COMPONENT_REPOSITORY = "repositoryPanel"; - - /** Field description */ - public static final String COMPONENT_USER = "userPanel"; - - /** Field description */ - public static final String PART_INDEX = "index.html"; - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param baseUrl - */ - public WUIUrlProvider(String baseUrl) - { - this.baseUrl = HttpUtil.append(baseUrl, PART_INDEX); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Returns the baseUrl, because there is no authentication url. - * - * - * @returns the baseUrl, because there is no authentication url - * - * @return - */ - @Override - public String getAuthenticationUrl() - { - return baseUrl; - } - - /** - * Method description - * - * - * @return - * - * @since 1.43 - */ - @Override - public String getBaseUrl() - { - return baseUrl; - } - - /** - * Method description - * - * - * @return - */ - @Override - public String getConfigUrl() - { - return HttpUtil.appendHash(baseUrl, COMPONENT_CONFIG); - } - - /** - * Method description - * - * - * @return - */ - @Override - public ModelUrlProvider getGroupUrlProvider() - { - return new WUIModelUrlProvider(baseUrl, COMPONENT_GROUP); - } - - /** - * Method description - * - * - * @return - */ - @Override - public RepositoryUrlProvider getRepositoryUrlProvider() - { - return new WUIRepositoryUrlProvider(baseUrl, COMPONENT_REPOSITORY); - } - - /** - * Method description - * - * - * @return - */ - @Override - public SecurityUrlProvider getSecurityUrlProvider() - { - throw new UnsupportedOperationException( - "this provider does not support security url provider."); - } - - /** - * Returns the baseUrl, because there is no state url. - * - * - * @return the baseUrl, because there is no state url - */ - @Override - public String getStateUrl() - { - return baseUrl; - } - - /** - * Method description - * - * - * @return - */ - @Override - public ModelUrlProvider getUserUrlProvider() - { - return new WUIModelUrlProvider(baseUrl, COMPONENT_USER); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private String baseUrl; -} diff --git a/scm-core/src/main/java/sonia/scm/util/HttpUtil.java b/scm-core/src/main/java/sonia/scm/util/HttpUtil.java index 27abcaffbe..30995a0b3c 100644 --- a/scm-core/src/main/java/sonia/scm/util/HttpUtil.java +++ b/scm-core/src/main/java/sonia/scm/util/HttpUtil.java @@ -39,27 +39,23 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.CharMatcher; import com.google.common.base.Objects; import com.google.common.base.Strings; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import sonia.scm.config.ScmConfiguration; -//~--- JDK imports ------------------------------------------------------------ - +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; - import java.net.URLDecoder; import java.net.URLEncoder; - +import java.util.Arrays; import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +//~--- JDK imports ------------------------------------------------------------ /** * Util method for the http protocol. @@ -86,9 +82,9 @@ public final class HttpUtil /** * Name of bearer authentication cookie. - * + * * TODO find a better place - * + * * @since 2.0.0 */ public static final String COOKIE_BEARER_AUTHENTICATION = "X-Bearer-Token"; @@ -101,7 +97,7 @@ public final class HttpUtil * @since 2.0.0 */ public static final String HEADER_AUTHORIZATION = "Authorization"; - + /** * content-length header * @since 1.46 @@ -252,13 +248,23 @@ public final class HttpUtil //~--- methods -------------------------------------------------------------- + /** + * Joins all path elements together separated by {@code {@link #SEPARATOR_PATH}}. + * + * @param pathElements path elements + * + * @return concatenated path + * @since 2.0.0 + */ + public static String concatenate(String... pathElements) { + return Arrays.stream(pathElements).reduce(HttpUtil::append).orElse(""); + } + /** * Appends the suffix to given uri. * - * - * @param uri uri + * @param uri uri * @param suffix suffix - * * @return * @since 1.9 */ diff --git a/scm-core/src/main/java/sonia/scm/web/VndMediaType.java b/scm-core/src/main/java/sonia/scm/web/VndMediaType.java index c7b8d369bd..792e8e8f57 100644 --- a/scm-core/src/main/java/sonia/scm/web/VndMediaType.java +++ b/scm-core/src/main/java/sonia/scm/web/VndMediaType.java @@ -18,6 +18,9 @@ public class VndMediaType { public static final String USER_COLLECTION = PREFIX + "userCollection" + SUFFIX; public static final String GROUP_COLLECTION = PREFIX + "groupCollection" + SUFFIX; public static final String REPOSITORY_COLLECTION = PREFIX + "repositoryCollection" + SUFFIX; + public static final String ME = PREFIX + "me" + SUFFIX; + + public static final String CONFIG = PREFIX + "config" + SUFFIX; private VndMediaType() { } diff --git a/scm-core/src/main/java/sonia/scm/web/filter/RegexPermissionFilter.java b/scm-core/src/main/java/sonia/scm/web/filter/RegexPermissionFilter.java deleted file mode 100644 index 40c41a5954..0000000000 --- a/scm-core/src/main/java/sonia/scm/web/filter/RegexPermissionFilter.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.web.filter; - -//~--- non-JDK imports -------------------------------------------------------- - - -import sonia.scm.config.ScmConfiguration; -import sonia.scm.repository.Repository; -import sonia.scm.repository.RepositoryManager; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.servlet.http.HttpServletRequest; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class RegexPermissionFilter extends PermissionFilter -{ - - /** Field description */ - public static final Pattern PATTERN_REPOSITORYNAME = - Pattern.compile("/[^/]+/([^/]+)(?:/.*)?"); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * - * @param configuration - * @param repositoryManager - */ - public RegexPermissionFilter(ScmConfiguration configuration, - RepositoryManager repositoryManager) - { - super(configuration); - this.repositoryManager = repositoryManager; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - protected abstract String getType(); - - /** - * Method description - * - * - * @param request - * - * @return - */ - @Override - protected Repository getRepository(HttpServletRequest request) - { - Repository repository = null; - String uri = request.getRequestURI(); - - uri = uri.substring(request.getContextPath().length()); - - Matcher m = PATTERN_REPOSITORYNAME.matcher(uri); - - if (m.matches()) - { - String repositoryname = m.group(1); - - repository = getRepository(repositoryname); - } - - return repository; - } - - /** - * Method description - * - * - * @param name - * - * @return - */ - protected Repository getRepository(String name) - { - return repositoryManager.get(getType(), name); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private RepositoryManager repositoryManager; -} diff --git a/scm-core/src/test/java/sonia/scm/repository/RepositoryTest.java b/scm-core/src/test/java/sonia/scm/repository/RepositoryTest.java index 11bb602611..f13f4cbc67 100644 --- a/scm-core/src/test/java/sonia/scm/repository/RepositoryTest.java +++ b/scm-core/src/test/java/sonia/scm/repository/RepositoryTest.java @@ -34,7 +34,7 @@ package sonia.scm.repository; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * @@ -50,7 +50,7 @@ public class RepositoryTest @Test public void testCreateUrl() { - Repository repository = new Repository("123", "hg", "test/repo"); + Repository repository = new Repository("123", "hg", "test", "repo"); assertEquals("http://localhost:8080/scm/hg/test/repo", repository.createUrl("http://localhost:8080/scm")); diff --git a/scm-core/src/test/java/sonia/scm/repository/RepositoryUtilTest.java b/scm-core/src/test/java/sonia/scm/repository/RepositoryUtilTest.java new file mode 100644 index 0000000000..82e85568d0 --- /dev/null +++ b/scm-core/src/test/java/sonia/scm/repository/RepositoryUtilTest.java @@ -0,0 +1,78 @@ +package sonia.scm.repository; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import java.io.File; +import java.io.IOException; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +@RunWith(MockitoJUnitRunner.class) +public class RepositoryUtilTest { + + @Rule + public TemporaryFolder temporaryFolder = new TemporaryFolder(); + + @Mock + private AbstractRepositoryHandler repositoryHandler; + + private RepositoryConfig repositoryConfig = new RepositoryConfig() { + @Override + public String getId() { + return "repository"; + } + }; + + @Before + public void setUpMocks() { + when(repositoryHandler.getConfig()).thenReturn(repositoryConfig); + } + + @Test + public void testGetRepositoryId() throws IOException { + File repositoryTypeRoot = temporaryFolder.newFolder(); + repositoryConfig.setRepositoryDirectory(repositoryTypeRoot); + + File repository = new File(repositoryTypeRoot, "abc"); + String id = RepositoryUtil.getRepositoryId(repositoryHandler, repository.getPath()); + assertEquals("abc", id); + } + + @Test(expected = IllegalArgumentException.class) + public void testGetRepositoryIdWithInvalidPath() throws IOException { + File repositoryTypeRoot = temporaryFolder.newFolder(); + repositoryConfig.setRepositoryDirectory(repositoryTypeRoot); + + File repository = new File("/etc/abc"); + String id = RepositoryUtil.getRepositoryId(repositoryHandler, repository.getPath()); + assertEquals("abc", id); + } + + @Test(expected = IllegalArgumentException.class) + public void testGetRepositoryIdWithInvalidPathButSameLength() throws IOException { + File repositoryTypeRoot = temporaryFolder.newFolder(); + repositoryConfig.setRepositoryDirectory(repositoryTypeRoot); + + File repository = new File(temporaryFolder.newFolder(), "abc"); + + String id = RepositoryUtil.getRepositoryId(repositoryHandler, repository.getPath()); + assertEquals("abc", id); + } + + @Test(expected = IllegalArgumentException.class) + public void testGetRepositoryIdWithInvalidId() throws IOException { + File repositoryTypeRoot = temporaryFolder.newFolder(); + repositoryConfig.setRepositoryDirectory(repositoryTypeRoot); + + File repository = new File(repositoryTypeRoot, "abc/123"); + RepositoryUtil.getRepositoryId(repositoryHandler, repository.getPath()); + } + +} diff --git a/scm-core/src/test/java/sonia/scm/url/JSONRestModelUrlProviderTest.java b/scm-core/src/test/java/sonia/scm/url/JSONRestModelUrlProviderTest.java deleted file mode 100644 index 778ca9883b..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/JSONRestModelUrlProviderTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -/** - * - * @author Sebastian Sdorra - */ -public class JSONRestModelUrlProviderTest extends RestModelUrlProviderTestBase -{ - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected UrlProvider createUrlProvider(String baseUrl) - { - return UrlProviderFactory.createUrlProvider(baseUrl, - UrlProviderFactory.TYPE_RESTAPI_JSON); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - protected String getExtension() - { - return EXTENSION_JSON; - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/JSONRestRepositoryUrlProviderTest.java b/scm-core/src/test/java/sonia/scm/url/JSONRestRepositoryUrlProviderTest.java deleted file mode 100644 index 68c38d0446..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/JSONRestRepositoryUrlProviderTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -/** - * - * @author Sebastian Sdorra - */ -public class JSONRestRepositoryUrlProviderTest - extends RestRepositoryUrlProviderTestBase -{ - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected RepositoryUrlProvider createRepositoryUrlProvider(String baseUrl) - { - return UrlProviderFactory.createUrlProvider(baseUrl, - UrlProviderFactory.TYPE_RESTAPI_JSON).getRepositoryUrlProvider(); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - protected String getExtension() - { - return EXTENSION_JSON; - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/JSONRestUrlProviderTest.java b/scm-core/src/test/java/sonia/scm/url/JSONRestUrlProviderTest.java deleted file mode 100644 index a887efa96c..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/JSONRestUrlProviderTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -/** - * - * @author Sebastian Sdorra - */ -public class JSONRestUrlProviderTest extends RestUrlProviderTestBase -{ - - /** - * Method description - * - * - * - * @param baseUrl - * @return - */ - @Override - protected UrlProvider createUrlProvider(String baseUrl) - { - return UrlProviderFactory.createUrlProvider(baseUrl, - UrlProviderFactory.TYPE_RESTAPI_JSON); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - protected String getExtension() - { - return EXTENSION_JSON; - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/ModelUrlProviderTestBase.java b/scm-core/src/test/java/sonia/scm/url/ModelUrlProviderTestBase.java deleted file mode 100644 index 14d38c1928..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/ModelUrlProviderTestBase.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class ModelUrlProviderTestBase extends UrlTestBase -{ - - /** Field description */ - public static final String ITEM = "hitchhiker"; - - /** Field description */ - public static final String MODEL_GROUPS = "groups"; - - /** Field description */ - public static final String MODEL_REPOSITORY = "repositories"; - - /** Field description */ - public static final String MODEL_USERS = "users"; - - /** Field description */ - private static final String[] MODELS = new String[] { MODEL_REPOSITORY, - MODEL_USERS, MODEL_GROUPS }; - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * - * @param baseUrl - * @return - */ - protected abstract ModelUrlProvider createGroupModelUrlProvider( - String baseUrl); - - /** - * Method description - * - * - * - * @param baseUrl - * @return - */ - protected abstract ModelUrlProvider createRepositoryModelUrlProvider( - String baseUrl); - - /** - * Method description - * - * - * - * @param baseUrl - * @return - */ - protected abstract ModelUrlProvider createUserModelUrlProvider( - String baseUrl); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * @param model - * - * @return - */ - protected abstract String getExpectedAllUrl(String baseUrl, String model); - - /** - * Method description - * - * - * @param baseUrl - * @param model - * @param item - * - * @return - */ - protected abstract String getExpectedDetailUrl(String baseUrl, String model, - String item); - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Test - public void testGetAllUrl() - { - for (String model : MODELS) - { - assertEquals(getExpectedAllUrl(BASEURL, model), - createModelUrlProvider(BASEURL, model).getAllUrl()); - } - } - - /** - * Method description - * - */ - @Test - public void testGetDetailUrl() - { - for (String model : MODELS) - { - assertEquals(getExpectedDetailUrl(BASEURL, model, ITEM), - createModelUrlProvider(BASEURL, model).getDetailUrl(ITEM)); - } - } - - /** - * Method description - * - * - * - * @param baseUrl - * @param model - * - * @return - */ - private ModelUrlProvider createModelUrlProvider(String baseUrl, String model) - { - ModelUrlProvider urlProvider = null; - - if (MODEL_REPOSITORY.equals(model)) - { - urlProvider = createRepositoryModelUrlProvider(baseUrl); - } - else if (MODEL_USERS.equals(model)) - { - urlProvider = createUserModelUrlProvider(baseUrl); - } - else if (MODEL_GROUPS.equals(model)) - { - urlProvider = createGroupModelUrlProvider(baseUrl); - } - - return urlProvider; - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/RepositoryUrlProviderTestBase.java b/scm-core/src/test/java/sonia/scm/url/RepositoryUrlProviderTestBase.java deleted file mode 100644 index 0c2e36dfd3..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/RepositoryUrlProviderTestBase.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class RepositoryUrlProviderTestBase extends UrlTestBase -{ - - /** Field description */ - private static final String NAME = "scm/main"; - - /** Field description */ - private static final String PATH = "scm-webapp/pom.xml"; - - /** Field description */ - private static final String REPOSITORY_ID = - "E3882BE7-7D0D-421B-B178-B2AA9E897135"; - - /** Field description */ - private static final String REVISION = "b282fb2dd12a"; - - /** Field description */ - private static final String TYPE = "hg"; - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - protected abstract RepositoryUrlProvider createRepositoryUrlProvider( - String baseUrl); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - protected abstract String getExpectedBlameUrl(String baseUrl, - String repositoryId, String path, String revision); - - /** - * Method description - * - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - protected abstract String getExpectedBrowseUrl(String baseUrl, - String repositoryId, String path, String revision); - - /** - * Method description - * - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * @param start - * @param limit - * - * @return - */ - protected abstract String getExpectedChangesetUrl(String baseUrl, - String repositoryId, String path, String revision, int start, - int limit); - - /** - * Method description - * - * - * - * @param baseUrl - * @param repositoryId - * @param start - * @param limit - * - * @return - */ - protected abstract String getExpectedChangesetUrl(String baseUrl, - String repositoryId, int start, int limit); - - /** - * Method description - * - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - protected abstract String getExpectedContentUrl(String baseUrl, - String repositoryId, String path, String revision); - - /** - * Method description - * - * - * - * @param baseUrl - * @param type - * @param name - * - * @return - * @since 1.11 - */ - protected abstract String getExpectedDetailUrl(String baseUrl, String type, - String name); - - /** - * Method description - * - * - * - * @param baseUrl - * @param repositoryId - * @param revision - * - * @return - */ - protected abstract String getExpectedDiffUrl(String baseUrl, - String repositoryId, String revision); - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Test - public void testGetBlameUrl() - { - assertEquals( - getExpectedBlameUrl(BASEURL, REPOSITORY_ID, PATH, REVISION), - createRepositoryUrlProvider(BASEURL).getBlameUrl( - REPOSITORY_ID, PATH, REVISION)); - } - - /** - * Method description - * - */ - @Test - public void testGetBrowserUrl() - { - assertEquals( - getExpectedBrowseUrl(BASEURL, REPOSITORY_ID, PATH, REVISION), - createRepositoryUrlProvider(BASEURL).getBrowseUrl( - REPOSITORY_ID, PATH, REVISION)); - } - - /** - * Method description - * - */ - @Test - public void testGetChangesetUrl() - { - assertEquals( - getExpectedChangesetUrl(BASEURL, REPOSITORY_ID, PATH, REVISION, 0, 20), - createRepositoryUrlProvider(BASEURL).getChangesetUrl( - REPOSITORY_ID, PATH, REVISION, 0, 20)); - assertEquals( - getExpectedChangesetUrl(BASEURL, REPOSITORY_ID, 0, 20), - createRepositoryUrlProvider(BASEURL).getChangesetUrl( - REPOSITORY_ID, 0, 20)); - } - - /** - * Method description - * - */ - @Test - public void testGetContentUrl() - { - assertEquals( - getExpectedContentUrl(BASEURL, REPOSITORY_ID, PATH, REVISION), - createRepositoryUrlProvider(BASEURL).getContentUrl( - REPOSITORY_ID, PATH, REVISION)); - } - - /** - * Method description - * - */ - @Test - public void testGetDetailUrl() - { - assertEquals(getExpectedDetailUrl(BASEURL, TYPE, NAME), - createRepositoryUrlProvider(BASEURL).getDetailUrl(TYPE, NAME)); - } - - /** - * Method description - * - */ - @Test - public void testGetDiffUrl() - { - assertEquals(getExpectedDiffUrl(BASEURL, REPOSITORY_ID, REVISION), - createRepositoryUrlProvider(BASEURL).getDiffUrl(REPOSITORY_ID, - REVISION)); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/RestModelUrlProviderTestBase.java b/scm-core/src/test/java/sonia/scm/url/RestModelUrlProviderTestBase.java deleted file mode 100644 index 2e7f25818f..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/RestModelUrlProviderTestBase.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class RestModelUrlProviderTestBase - extends ModelUrlProviderTestBase -{ - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - protected abstract UrlProvider createUrlProvider(String baseUrl); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - protected abstract String getExtension(); - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected ModelUrlProvider createGroupModelUrlProvider(String baseUrl) - { - return createUrlProvider(baseUrl).getGroupUrlProvider(); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected ModelUrlProvider createRepositoryModelUrlProvider(String baseUrl) - { - return createUrlProvider(baseUrl).getRepositoryUrlProvider(); - } - - /** - * Method description - * - * - * @param baseUrl - * @param urlPart - * - * @return - */ - protected String createRestUrl(String baseUrl, String urlPart) - { - return createRestUrl(baseUrl, urlPart, getExtension()); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected ModelUrlProvider createUserModelUrlProvider(String baseUrl) - { - return createUrlProvider(baseUrl).getUserUrlProvider(); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * @param model - * - * @return - */ - @Override - protected String getExpectedAllUrl(String baseUrl, String model) - { - return createRestUrl(baseUrl, model); - } - - /** - * Method description - * - * - * @param baseUrl - * @param model - * @param item - * - * @return - */ - @Override - protected String getExpectedDetailUrl(String baseUrl, String model, - String item) - { - return createRestUrl(baseUrl, - model.concat(HttpUtil.SEPARATOR_PATH).concat(item)); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/RestRepositoryUrlProviderTestBase.java b/scm-core/src/test/java/sonia/scm/url/RestRepositoryUrlProviderTestBase.java deleted file mode 100644 index 31783f7eea..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/RestRepositoryUrlProviderTestBase.java +++ /dev/null @@ -1,230 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class RestRepositoryUrlProviderTestBase - extends RepositoryUrlProviderTestBase -{ - - /** Field description */ - public static final String URLPART_PREFIX = "repositories"; - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - protected abstract String getExtension(); - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - protected String getExpectedBlameUrl(String baseUrl, String repositoryId, - String path, String revision) - { - return createRestUrl( - baseUrl, - repositoryId.concat(HttpUtil.SEPARATOR_PATH).concat("blame")).concat( - "?path=").concat(path).concat("&revision=").concat(revision); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - protected String getExpectedBrowseUrl(String baseUrl, String repositoryId, - String path, String revision) - { - return createRestUrl( - baseUrl, - repositoryId.concat(HttpUtil.SEPARATOR_PATH).concat("browse")).concat( - "?path=").concat(path).concat("&revision=").concat(revision); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * @param start - * @param limit - * - * @return - */ - @Override - protected String getExpectedChangesetUrl(String baseUrl, String repositoryId, - String path, String revision, int start, int limit) - { - return createRestUrl( - baseUrl, - repositoryId.concat(HttpUtil.SEPARATOR_PATH).concat( - "changesets")).concat("?path=").concat(path).concat( - "&revision=").concat(revision).concat("&start=").concat( - String.valueOf(start)).concat("&limit=").concat( - String.valueOf(limit)); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param start - * @param limit - * - * @return - */ - @Override - protected String getExpectedChangesetUrl(String baseUrl, String repositoryId, - int start, int limit) - { - return createRestUrl( - baseUrl, - repositoryId.concat(HttpUtil.SEPARATOR_PATH).concat( - "changesets")).concat("?start=").concat(String.valueOf(start)).concat( - "&limit=").concat(String.valueOf(limit)); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - protected String getExpectedContentUrl(String baseUrl, String repositoryId, - String path, String revision) - { - return createRestUrl( - baseUrl, - "repositories".concat(HttpUtil.SEPARATOR_PATH).concat( - repositoryId).concat(HttpUtil.SEPARATOR_PATH).concat( - "content"), "").concat("?path=").concat(path).concat( - "&revision=").concat(revision); - } - - /** - * Method description - * - * - * @param baseUrl - * @param type - * @param name - * - * @return - */ - @Override - protected String getExpectedDetailUrl(String baseUrl, String type, - String name) - { - return createRestUrl(baseUrl, - type.concat(HttpUtil.SEPARATOR_PATH).concat(name)); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param revision - * - * @return - */ - @Override - protected String getExpectedDiffUrl(String baseUrl, String repositoryId, - String revision) - { - return createRestUrl( - baseUrl, - "repositories".concat(HttpUtil.SEPARATOR_PATH).concat( - repositoryId).concat(HttpUtil.SEPARATOR_PATH).concat( - "diff"), "").concat("?revision=").concat(revision); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * @param urlPart - * - * @return - */ - private String createRestUrl(String baseUrl, String urlPart) - { - return createRestUrl( - baseUrl, - URLPART_PREFIX.concat(HttpUtil.SEPARATOR_PATH).concat(urlPart), - getExtension()); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/RestUrlProviderTestBase.java b/scm-core/src/test/java/sonia/scm/url/RestUrlProviderTestBase.java deleted file mode 100644 index 3b39e22816..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/RestUrlProviderTestBase.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class RestUrlProviderTestBase extends UrlProviderTestBase -{ - - /** - * Method description - * - * - * @return - */ - protected abstract String getExtension(); - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * @param urlPart - * - * @return - */ - protected String createRestUrl(String baseUrl, String urlPart) - { - return createRestUrl(baseUrl, urlPart, getExtension()); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected String getExpectedAuthenticationUrl(String baseUrl) - { - return createRestUrl(baseUrl, "auth/access_token"); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected String getExpectedConfigUrl(String baseUrl) - { - return createRestUrl(baseUrl, "config"); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected String getExpectedStateUrl(String baseUrl) - { - return createRestUrl(baseUrl, "auth"); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/UrlProviderTestBase.java b/scm-core/src/test/java/sonia/scm/url/UrlProviderTestBase.java deleted file mode 100644 index 61c35b7b64..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/UrlProviderTestBase.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class UrlProviderTestBase extends UrlTestBase -{ - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * - * @param baseUrl - * @return - */ - protected abstract UrlProvider createUrlProvider(String baseUrl); - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - protected abstract String getExpectedAuthenticationUrl(String baseUrl); - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - protected abstract String getExpectedConfigUrl(String baseUrl); - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - protected abstract String getExpectedStateUrl(String baseUrl); - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Test - public void testGetAuthenticationUrl() - { - assertEquals(getExpectedAuthenticationUrl(BASEURL), - createUrlProvider(BASEURL).getAuthenticationUrl()); - } - - /** - * Method description - * - */ - @Test - public void testGetConfigUrl() - { - assertEquals(getExpectedConfigUrl(BASEURL), - createUrlProvider(BASEURL).getConfigUrl()); - } - - /** - * Method description - * - */ - @Test - public void testGetGroupUrlProvider() - { - assertNotNull(createUrlProvider(BASEURL).getGroupUrlProvider()); - } - - /** - * Method description - * - */ - @Test - public void testGetStateUrl() - { - assertEquals(getExpectedStateUrl(BASEURL), - createUrlProvider(BASEURL).getStateUrl()); - } - - /** - * Method description - * - */ - @Test - public void testGetUserRepositoryUrlProvider() - { - assertNotNull(createUrlProvider(BASEURL).getRepositoryUrlProvider()); - } - - /** - * Method description - * - */ - @Test - public void testGetUserUrlProvider() - { - assertNotNull(createUrlProvider(BASEURL).getUserUrlProvider()); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/UrlTestBase.java b/scm-core/src/test/java/sonia/scm/url/UrlTestBase.java deleted file mode 100644 index 28202cb420..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/UrlTestBase.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * - * @author Sebastian Sdorra - */ -public abstract class UrlTestBase -{ - - /** Field description */ - public static final String EXTENSION_JSON = ".json"; - - /** Field description */ - public static final String EXTENSION_XML = ".xml"; - - /** Field description */ - public static final String URLSUFFIX_INDEX = "/index.html"; - - /** Field description */ - public static final String URLSUFFIX_RESTAPI = "/api/rest/"; - - /** Field description */ - protected static final String BASEURL = "http://scm.scm-manager.org/scm"; - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - protected String createBaseRestUrl(String baseUrl) - { - return baseUrl.concat(URLSUFFIX_RESTAPI); - } - - /** - * Method description - * - * - * @param baseUrl - * @param urlPart - * @param extension - * - * @return - */ - protected String createRestUrl(String baseUrl, String urlPart, - String extension) - { - return createBaseRestUrl(baseUrl).concat(urlPart).concat(extension); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - protected String createWuiUrl(String baseUrl) - { - return baseUrl.concat(URLSUFFIX_INDEX); - } - - /** - * Method description - * - * - * @param baseUrl - * @param param - * - * @return - */ - protected String createWuiUrl(String baseUrl, String param) - { - return baseUrl.concat(URLSUFFIX_INDEX).concat( - HttpUtil.SEPARATOR_HASH).concat(param); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - protected UrlProvider createWuiUrlProvider(String baseUrl) - { - return UrlProviderFactory.createUrlProvider(baseUrl, - UrlProviderFactory.TYPE_WUI); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/UrlUtilTest.java b/scm-core/src/test/java/sonia/scm/url/UrlUtilTest.java deleted file mode 100644 index 255d7912df..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/UrlUtilTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * - * @author Sebastian Sdorra - */ -public class UrlUtilTest -{ - - /** - * Method description - * - */ - @Test - public void testFixRevision() - { - assertEquals("42694c4a4a7a", UrlUtil.fixRevision("42694c4a4a7a")); - assertEquals("42694c4a4a7a", UrlUtil.fixRevision("298:42694c4a4a7a")); - assertNull(UrlUtil.fixRevision(null)); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/WUIModelUrlProviderTest.java b/scm-core/src/test/java/sonia/scm/url/WUIModelUrlProviderTest.java deleted file mode 100644 index b6073a841a..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/WUIModelUrlProviderTest.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author Sebastian Sdorra - */ -public class WUIModelUrlProviderTest extends ModelUrlProviderTestBase -{ - - /** - * Constructs ... - * - */ - public WUIModelUrlProviderTest() - { - modelMap = new HashMap(); - modelMap.put(MODEL_REPOSITORY, "repositoryPanel"); - modelMap.put(MODEL_USERS, "userPanel"); - modelMap.put(MODEL_GROUPS, "groupPanel"); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected ModelUrlProvider createGroupModelUrlProvider(String baseUrl) - { - return createWuiUrlProvider(baseUrl).getGroupUrlProvider(); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected ModelUrlProvider createRepositoryModelUrlProvider(String baseUrl) - { - return createWuiUrlProvider(baseUrl).getRepositoryUrlProvider(); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected ModelUrlProvider createUserModelUrlProvider(String baseUrl) - { - return createWuiUrlProvider(baseUrl).getUserUrlProvider(); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * @param model - * - * @return - */ - @Override - protected String getExpectedAllUrl(String baseUrl, String model) - { - return createModelBaseUrl(baseUrl, model); - } - - /** - * Method description - * - * - * @param baseUrl - * @param model - * @param item - * - * @return - */ - @Override - protected String getExpectedDetailUrl(String baseUrl, String model, - String item) - { - return createModelBaseUrl(baseUrl, model).concat( - WUIUrlBuilder.SEPARATOR).concat(item); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * @param model - * - * @return - */ - private String createModelBaseUrl(String baseUrl, String model) - { - return createWuiUrl(baseUrl, modelMap.get(model)); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private Map modelMap; -} diff --git a/scm-core/src/test/java/sonia/scm/url/WUIRepositoryUrlProviderTest.java b/scm-core/src/test/java/sonia/scm/url/WUIRepositoryUrlProviderTest.java deleted file mode 100644 index 91a1a8fb8a..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/WUIRepositoryUrlProviderTest.java +++ /dev/null @@ -1,218 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import sonia.scm.util.HttpUtil; - -/** - * - * @author Sebastian Sdorra - */ -public class WUIRepositoryUrlProviderTest extends RepositoryUrlProviderTestBase -{ - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected RepositoryUrlProvider createRepositoryUrlProvider(String baseUrl) - { - return UrlProviderFactory.createUrlProvider(baseUrl, - UrlProviderFactory.TYPE_WUI).getRepositoryUrlProvider(); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - protected String getExpectedBlameUrl(String baseUrl, String repositoryId, - String path, String revision) - { - return createRepositoryWuiUrl(baseUrl, "contentPanel", repositoryId).concat( - ";").concat(revision).concat(";").concat(path).concat(";blame"); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - protected String getExpectedBrowseUrl(String baseUrl, String repositoryId, - String path, String revision) - { - return createRepositoryWuiUrl( - baseUrl, "repositoryBrowser", repositoryId).concat(";").concat( - revision).concat(";").concat(path); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * @param start - * @param limit - * - * @return - */ - @Override - protected String getExpectedChangesetUrl(String baseUrl, String repositoryId, - String path, String revision, int start, int limit) - { - return createRepositoryWuiUrl(baseUrl, "contentPanel", repositoryId).concat( - ";").concat(revision).concat(";").concat(path).concat(";history"); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param start - * @param limit - * - * @return - */ - @Override - protected String getExpectedChangesetUrl(String baseUrl, String repositoryId, - int start, int limit) - { - return createRepositoryWuiUrl( - baseUrl, "repositoryChangesetViewerPanel", repositoryId).concat( - ";").concat(String.valueOf(start)).concat(";").concat( - String.valueOf(limit)); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param path - * @param revision - * - * @return - */ - @Override - protected String getExpectedContentUrl(String baseUrl, String repositoryId, - String path, String revision) - { - return createRepositoryWuiUrl(baseUrl, "contentPanel", repositoryId).concat( - ";").concat(revision).concat(";").concat(path).concat(";history"); - } - - /** - * Method description - * - * - * @param baseUrl - * @param type - * @param name - * - * @return - */ - @Override - protected String getExpectedDetailUrl(String baseUrl, String type, - String name) - { - return createRepositoryWuiUrl( - baseUrl, "repositoryPanel", - type.concat(HttpUtil.SEPARATOR_PATH).concat(name)); - } - - /** - * Method description - * - * - * @param baseUrl - * @param repositoryId - * @param revision - * - * @return - */ - @Override - protected String getExpectedDiffUrl(String baseUrl, String repositoryId, - String revision) - { - return createRepositoryWuiUrl(baseUrl, "diffPanel", - repositoryId).concat(";").concat(revision); - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * @param component - * @param repository - * - * @return - */ - private String createRepositoryWuiUrl(String baseUrl, String component, - String repository) - { - return createWuiUrl(baseUrl, component).concat( - WUIUrlBuilder.SEPARATOR).concat(repository); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/WUIUrlBuilderTest.java b/scm-core/src/test/java/sonia/scm/url/WUIUrlBuilderTest.java deleted file mode 100644 index 4fdefc5fb1..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/WUIUrlBuilderTest.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import org.junit.Test; - -import sonia.scm.util.HttpUtil; - -import static org.junit.Assert.*; - -/** - * - * @author Sebastian Sdorra - */ -public class WUIUrlBuilderTest -{ - - /** Field description */ - private static final String BASEURL = - "http://scm.scm-manager.org/scm/index.html"; - - /** Field description */ - private static final String COMPONENT = "testCmp"; - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - */ - @Test - public void testStringAppend() - { - WUIUrlBuilder builder = createBuilder(); - - builder.append("testParam"); - assertEquals(createBaseWuiUrl().concat(";testParam"), builder.toString()); - builder = createBuilder(); - builder.append("param1").append("param2").append("param3"); - assertEquals(createBaseWuiUrl().concat(";param1;param2;param3"), - builder.toString()); - } - - /** - * Method description - * - */ - @Test - public void testIntAppend() - { - WUIUrlBuilder builder = createBuilder(); - - builder.append(3); - assertEquals(createBaseWuiUrl().concat(";3"), builder.toString()); - builder = createBuilder(); - builder.append(1).append(2).append(3); - assertEquals(createBaseWuiUrl().concat(";1;2;3"), - builder.toString()); - } - - /** - * Method description - * - * - * @return - */ - private String createBaseWuiUrl() - { - return BASEURL.concat(HttpUtil.SEPARATOR_HASH).concat(COMPONENT); - } - - /** - * Method description - * - * - * @return - */ - private WUIUrlBuilder createBuilder() - { - return new WUIUrlBuilder(BASEURL, COMPONENT); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/WUIUrlProviderTest.java b/scm-core/src/test/java/sonia/scm/url/WUIUrlProviderTest.java deleted file mode 100644 index 19ec89835a..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/WUIUrlProviderTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -/** - * - * @author Sebastian Sdorra - */ -public class WUIUrlProviderTest extends UrlProviderTestBase -{ - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected UrlProvider createUrlProvider(String baseUrl) - { - return UrlProviderFactory.createUrlProvider(baseUrl, - UrlProviderFactory.TYPE_WUI); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected String getExpectedAuthenticationUrl(String baseUrl) - { - return createWuiUrl(baseUrl); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected String getExpectedConfigUrl(String baseUrl) - { - return createWuiUrl(baseUrl, "scmConfig"); - } - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected String getExpectedStateUrl(String baseUrl) - { - return createWuiUrl(baseUrl); - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/XMLRestModelUrlProviderTest.java b/scm-core/src/test/java/sonia/scm/url/XMLRestModelUrlProviderTest.java deleted file mode 100644 index 7017e0551a..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/XMLRestModelUrlProviderTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -/** - * - * @author Sebastian Sdorra - */ -public class XMLRestModelUrlProviderTest extends RestModelUrlProviderTestBase -{ - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected UrlProvider createUrlProvider(String baseUrl) - { - return UrlProviderFactory.createUrlProvider(baseUrl, - UrlProviderFactory.TYPE_RESTAPI_XML); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - protected String getExtension() - { - return EXTENSION_XML; - } -} diff --git a/scm-core/src/test/java/sonia/scm/url/XMLRestUrlProviderTest.java b/scm-core/src/test/java/sonia/scm/url/XMLRestUrlProviderTest.java deleted file mode 100644 index 33e19aa258..0000000000 --- a/scm-core/src/test/java/sonia/scm/url/XMLRestUrlProviderTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - -package sonia.scm.url; - -/** - * - * @author Sebastian Sdorra - */ -public class XMLRestUrlProviderTest extends RestUrlProviderTestBase -{ - - /** - * Method description - * - * - * @param baseUrl - * - * @return - */ - @Override - protected UrlProvider createUrlProvider(String baseUrl) - { - return UrlProviderFactory.createUrlProvider(baseUrl, - UrlProviderFactory.TYPE_RESTAPI_XML); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - protected String getExtension() - { - return EXTENSION_XML; - } -} diff --git a/scm-core/src/test/java/sonia/scm/util/HttpUtilTest.java b/scm-core/src/test/java/sonia/scm/util/HttpUtilTest.java index b85221f8c8..5e6fa3e10e 100644 --- a/scm-core/src/test/java/sonia/scm/util/HttpUtilTest.java +++ b/scm-core/src/test/java/sonia/scm/util/HttpUtilTest.java @@ -54,6 +54,18 @@ import javax.servlet.http.HttpServletRequest; public class HttpUtilTest { + @Test + public void concatenateTest() { + assertEquals( + "/scm/git/hitchhiker/tricia", + HttpUtil.concatenate("/scm", "git", "hitchhiker", "tricia") + ); + assertEquals( + "scm/git/hitchhiker/tricia", + HttpUtil.concatenate("scm", "git", "hitchhiker", "tricia") + ); + } + /** * Method description * @@ -63,19 +75,19 @@ public class HttpUtilTest { //J- assertEquals( - "http://www.scm-manager/scm/test", + "http://www.scm-manager/scm/test", HttpUtil.append("http://www.scm-manager/scm/", "test") ); assertEquals( - "http://www.scm-manager/scm/test", + "http://www.scm-manager/scm/test", HttpUtil.append("http://www.scm-manager/scm", "test") ); assertEquals( - "http://www.scm-manager/scm/test", + "http://www.scm-manager/scm/test", HttpUtil.append("http://www.scm-manager/scm", "/test") ); assertEquals( - "http://www.scm-manager/scm/test", + "http://www.scm-manager/scm/test", HttpUtil.append("http://www.scm-manager/scm/", "/test") ); //J+ diff --git a/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryDAO.java b/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryDAO.java index 7c17c365aa..4510706721 100644 --- a/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryDAO.java +++ b/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryDAO.java @@ -36,11 +36,11 @@ package sonia.scm.repository.xml; import com.google.inject.Inject; import com.google.inject.Singleton; - +import sonia.scm.repository.NamespaceAndName; import sonia.scm.repository.Repository; import sonia.scm.repository.RepositoryDAO; -import sonia.scm.xml.AbstractXmlDAO; import sonia.scm.store.ConfigurationStoreFactory; +import sonia.scm.xml.AbstractXmlDAO; /** * @@ -71,36 +71,18 @@ public class XmlRepositoryDAO //~--- methods -------------------------------------------------------------- - /** - * Method description - * - * - * @param type - * @param name - * - * @return - */ @Override - public boolean contains(String type, String name) + public boolean contains(NamespaceAndName namespaceAndName) { - return db.contains(type, name); + return db.contains(namespaceAndName); } //~--- get methods ---------------------------------------------------------- - /** - * Method description - * - * - * @param type - * @param name - * - * @return - */ @Override - public Repository get(String type, String name) + public Repository get(NamespaceAndName namespaceAndName) { - return db.get(type, name); + return db.get(namespaceAndName); } //~--- methods -------------------------------------------------------------- diff --git a/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryDatabase.java b/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryDatabase.java index a5c599c291..93be611213 100644 --- a/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryDatabase.java +++ b/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryDatabase.java @@ -35,34 +35,26 @@ package sonia.scm.repository.xml; //~--- non-JDK imports -------------------------------------------------------- +import sonia.scm.repository.NamespaceAndName; import sonia.scm.repository.Repository; import sonia.scm.xml.XmlDatabase; -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; + +//~--- JDK imports ------------------------------------------------------------ -/** - * - * @author Sebastian Sdorra - */ @XmlRootElement(name = "repository-db") @XmlAccessorType(XmlAccessType.FIELD) public class XmlRepositoryDatabase implements XmlDatabase { - /** - * Constructs ... - * - */ public XmlRepositoryDatabase() { long c = System.currentTimeMillis(); @@ -71,108 +63,43 @@ public class XmlRepositoryDatabase implements XmlDatabase lastModified = c; } - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param type - * @param name - * - * @return - */ - static String createKey(String type, String name) + static String createKey(NamespaceAndName namespaceAndName) { - return type.concat(":").concat(name); + return namespaceAndName.getNamespace() + ":" + namespaceAndName.getName(); } - /** - * Method description - * - * - * @param repository - * - * @return - */ static String createKey(Repository repository) { - return createKey(repository.getType(), repository.getName()); + return createKey(repository.getNamespaceAndName()); } - /** - * Method description - * - * - * @param repository - */ @Override public void add(Repository repository) { repositoryMap.put(createKey(repository), repository); } - /** - * Method description - * - * - * - * @param type - * @param name - * - * @return - */ - public boolean contains(String type, String name) + public boolean contains(NamespaceAndName namespaceAndName) { - return repositoryMap.containsKey(createKey(type, name)); + return repositoryMap.containsKey(createKey(namespaceAndName)); } - /** - * Method description - * - * - * @param id - * - * @return - */ @Override public boolean contains(String id) { return get(id) != null; } - /** - * Method description - * - * - * @param repository - * - * @return - */ public boolean contains(Repository repository) { return repositoryMap.containsKey(createKey(repository)); } - /** - * Method description - * - * - * @param repository - */ public void remove(Repository repository) { repositoryMap.remove(createKey(repository)); } - /** - * Method description - * - * - * @param id - * - * @return - */ @Override public Repository remove(String id) { @@ -183,12 +110,6 @@ public class XmlRepositoryDatabase implements XmlDatabase return r; } - /** - * Method description - * - * - * @return - */ @Override public Collection values() { @@ -197,18 +118,9 @@ public class XmlRepositoryDatabase implements XmlDatabase //~--- get methods ---------------------------------------------------------- - /** - * Method description - * - * - * @param type - * @param name - * - * @return - */ - public Repository get(String type, String name) + public Repository get(NamespaceAndName namespaceAndName) { - return repositoryMap.get(createKey(type, name)); + return repositoryMap.get(createKey(namespaceAndName)); } /** @@ -298,6 +210,5 @@ public class XmlRepositoryDatabase implements XmlDatabase /** Field description */ @XmlJavaTypeAdapter(XmlRepositoryMapAdapter.class) @XmlElement(name = "repositories") - private Map repositoryMap = new LinkedHashMap(); + private Map repositoryMap = new LinkedHashMap<>(); } diff --git a/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryMapAdapter.java b/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryMapAdapter.java index a90a2d4fa9..4d6686dfb2 100644 --- a/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryMapAdapter.java +++ b/scm-dao-xml/src/main/java/sonia/scm/repository/xml/XmlRepositoryMapAdapter.java @@ -37,57 +37,28 @@ package sonia.scm.repository.xml; import sonia.scm.repository.Repository; -//~--- JDK imports ------------------------------------------------------------ - +import javax.xml.bind.annotation.adapters.XmlAdapter; import java.util.LinkedHashMap; import java.util.Map; -import javax.xml.bind.annotation.adapters.XmlAdapter; +//~--- JDK imports ------------------------------------------------------------ /** * * @author Sebastian Sdorra */ -public class XmlRepositoryMapAdapter - extends XmlAdapter> -{ +public class XmlRepositoryMapAdapter extends XmlAdapter> { - /** - * Method description - * - * - * @param repositoryMap - * - * @return - * - * @throws Exception - */ @Override - public XmlRepositoryList marshal(Map repositoryMap) - throws Exception - { + public XmlRepositoryList marshal(Map repositoryMap) { return new XmlRepositoryList(repositoryMap); } - /** - * Method description - * - * - * @param repositories - * - * @return - * - * @throws Exception - */ @Override - public Map unmarshal(XmlRepositoryList repositories) - throws Exception - { - Map repositoryMap = new LinkedHashMap(); + public Map unmarshal(XmlRepositoryList repositories) { + Map repositoryMap = new LinkedHashMap<>(); - for (Repository repository : repositories) - { + for (Repository repository : repositories) { repositoryMap.put(XmlRepositoryDatabase.createKey(repository), repository); } diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitConfig.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitConfig.java index 77352c6ca0..3569fee179 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitConfig.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitConfig.java @@ -39,6 +39,7 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; /** * @@ -46,7 +47,7 @@ import javax.xml.bind.annotation.XmlRootElement; */ @XmlRootElement(name = "config") @XmlAccessorType(XmlAccessType.FIELD) -public class GitConfig extends SimpleRepositoryConfig { +public class GitConfig extends RepositoryConfig { @XmlElement(name = "gc-expression") private String gcExpression; @@ -59,4 +60,11 @@ public class GitConfig extends SimpleRepositoryConfig { public void setGcExpression(String gcExpression) { this.gcExpression = gcExpression; } + + @Override + @XmlTransient // Only for permission checks, don't serialize to XML + public String getId() { + // Don't change this without migrating SCM permission configuration! + return "git"; + } } diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryModifyListener.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryModifyListener.java index db2b7b09ec..1cbcdc35bf 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryModifyListener.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryModifyListener.java @@ -30,9 +30,9 @@ */ package sonia.scm.repository; +import com.github.legman.Subscribe; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Objects; -import com.google.common.eventbus.Subscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sonia.scm.EagerSingleton; diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitReceiveHook.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitReceiveHook.java index 3ecd6047e9..eeda60ed02 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitReceiveHook.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitReceiveHook.java @@ -40,24 +40,21 @@ import org.eclipse.jgit.transport.PostReceiveHook; import org.eclipse.jgit.transport.PreReceiveHook; import org.eclipse.jgit.transport.ReceiveCommand; import org.eclipse.jgit.transport.ReceivePack; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import sonia.scm.repository.GitRepositoryHandler; import sonia.scm.repository.RepositoryHookType; import sonia.scm.repository.RepositoryUtil; import sonia.scm.repository.spi.GitHookContextProvider; import sonia.scm.repository.spi.HookEventFacade; -//~--- JDK imports ------------------------------------------------------------ - import java.io.File; import java.io.IOException; - import java.util.Collection; import java.util.List; +//~--- JDK imports ------------------------------------------------------------ + /** * * @author Sebastian Sdorra @@ -131,15 +128,14 @@ public class GitReceiveHook implements PreReceiveHook, PostReceiveHook try { Repository repository = rpack.getRepository(); - String repositoryName = resolveRepositoryName(repository); + String id = resolveRepositoryId(repository); - logger.trace("resolved repository name to {}", repositoryName); + logger.trace("resolved repository to id {}", id); GitHookContextProvider context = new GitHookContextProvider(rpack, receiveCommands); - hookEventFacade.handle(GitRepositoryHandler.TYPE_NAME, - repositoryName).fireHookEvent(type, context); + hookEventFacade.handle(id).fireHookEvent(type, context); } catch (Exception ex) @@ -191,7 +187,7 @@ public class GitReceiveHook implements PreReceiveHook, PostReceiveHook * * @throws IOException */ - private String resolveRepositoryName(Repository repository) throws IOException + private String resolveRepositoryId(Repository repository) throws IOException { File directory; @@ -204,7 +200,7 @@ public class GitReceiveHook implements PreReceiveHook, PostReceiveHook directory = repository.getWorkTree(); } - return RepositoryUtil.getRepositoryName(handler, directory); + return RepositoryUtil.getRepositoryId(handler, directory); } //~--- fields --------------------------------------------------------------- diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitRepositoryResolver.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitRepositoryResolver.java index 2ddf4b3de9..76e742a71a 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitRepositoryResolver.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitRepositoryResolver.java @@ -36,8 +36,8 @@ package sonia.scm.web; //~--- non-JDK imports -------------------------------------------------------- import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; import com.google.inject.Inject; - import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryCache; @@ -46,19 +46,17 @@ import org.eclipse.jgit.transport.resolver.RepositoryResolver; import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException; import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; import org.eclipse.jgit.util.FS; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import sonia.scm.repository.GitConfig; import sonia.scm.repository.GitRepositoryHandler; +import sonia.scm.repository.RepositoryProvider; -//~--- JDK imports ------------------------------------------------------------ - +import javax.servlet.http.HttpServletRequest; import java.io.File; import java.io.IOException; -import javax.servlet.http.HttpServletRequest; +//~--- JDK imports ------------------------------------------------------------ /** * @@ -72,17 +70,11 @@ public class GitRepositoryResolver implements RepositoryResolver env = ImmutableMap.of( "repository", repository, - "branches", createBranchesModel(repository), - "commitViewLink", rup.getChangesetUrl(repository.getId(), 0, 20), - "sourceViewLink", rup.getBrowseUrl(repository.getId(), null, null) + "branches", createBranchesModel(repository) ); //J+ diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/lfs/LfsStoreRemoveListener.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/lfs/LfsStoreRemoveListener.java index 3d69dcabe6..18fb333c74 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/lfs/LfsStoreRemoveListener.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/lfs/LfsStoreRemoveListener.java @@ -32,7 +32,7 @@ package sonia.scm.web.lfs; -import com.google.common.eventbus.Subscribe; +import com.github.legman.Subscribe; import com.google.inject.Inject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/scm-plugins/scm-git-plugin/src/main/resources/sonia/scm/git.index.mustache b/scm-plugins/scm-git-plugin/src/main/resources/sonia/scm/git.index.mustache index 81d7a5bfa3..4571e327e3 100644 --- a/scm-plugins/scm-git-plugin/src/main/resources/sonia/scm/git.index.mustache +++ b/scm-plugins/scm-git-plugin/src/main/resources/sonia/scm/git.index.mustache @@ -118,23 +118,6 @@ {{/branches}} - -

Notes

- -
-

- This page is only a quick view for git commits. - The full commit view is here. -

- -

Git Informations

    @@ -144,4 +127,4 @@
- \ No newline at end of file + diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryHandlerTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryHandlerTest.java index 5d9b338875..47ca08b597 100644 --- a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryHandlerTest.java +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryHandlerTest.java @@ -1,19 +1,19 @@ /** * Copyright (c) 2010, Sebastian Sdorra * All rights reserved. - * + *

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + *

* 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + *

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,50 +24,45 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + *

* http://bitbucket.org/sdorra/scm-manager - * */ - package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- -import sonia.scm.io.DefaultFileSystem; - -import static org.junit.Assert.*; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.File; -import sonia.scm.store.ConfigurationStoreFactory; +import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; +import sonia.scm.io.DefaultFileSystem; import sonia.scm.schedule.Scheduler; +import sonia.scm.store.ConfigurationStoreFactory; + +import java.io.File; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +//~--- JDK imports ------------------------------------------------------------ /** * * @author Sebastian Sdorra */ @RunWith(MockitoJUnitRunner.class) -public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase -{ +public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase { @Mock private Scheduler scheduler; - - /** - * Method description - * - * - * @param directory - */ + + @Mock + private ConfigurationStoreFactory factory; + @Override - protected void checkDirectory(File directory) - { + protected void checkDirectory(File directory) { File head = new File(directory, "HEAD"); assertTrue(head.exists()); @@ -84,21 +79,12 @@ public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase assertTrue(refs.isDirectory()); } - /** - * Method description - * - * - * @param factory - * @param directory - * - * @return - */ + @Override protected RepositoryHandler createRepositoryHandler(ConfigurationStoreFactory factory, - File directory) - { + File directory) { GitRepositoryHandler repositoryHandler = new GitRepositoryHandler(factory, - new DefaultFileSystem(), scheduler); + new DefaultFileSystem(), scheduler); repositoryHandler.init(contextProvider); @@ -110,4 +96,19 @@ public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase return repositoryHandler; } + + @Test + public void getDirectory() { + GitRepositoryHandler repositoryHandler = new GitRepositoryHandler(factory, + new DefaultFileSystem(), scheduler); + + GitConfig gitConfig = new GitConfig(); + gitConfig.setRepositoryDirectory(new File("/path")); + repositoryHandler.setConfig(gitConfig); + + Repository repository = new Repository("id", "git", "Space", "Name"); + + File path = repositoryHandler.getDirectory(repository); + assertEquals("/path/id", path.getAbsolutePath()); + } } diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryPathMatcherTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryPathMatcherTest.java index 7adc4a6913..598d3b6400 100644 --- a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryPathMatcherTest.java +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryPathMatcherTest.java @@ -31,7 +31,9 @@ package sonia.scm.repository; import org.junit.Test; -import static org.junit.Assert.*; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * Unit tests for {@link GitRepositoryPathMatcher}. @@ -45,18 +47,18 @@ public class GitRepositoryPathMatcherTest { @Test public void testIsPathMatching() { - assertFalse(pathMatcher.isPathMatching(repository("my-repo"), "my-repoo")); - assertFalse(pathMatcher.isPathMatching(repository("my"), "my-repo")); - assertFalse(pathMatcher.isPathMatching(repository("my"), "my-repo/with/path")); + assertFalse(pathMatcher.isPathMatching(repository("space", "my-repo"), "my-repoo")); + assertFalse(pathMatcher.isPathMatching(repository("space", "my"), "my-repo")); + assertFalse(pathMatcher.isPathMatching(repository("space", "my"), "my-repo/with/path")); - assertTrue(pathMatcher.isPathMatching(repository("my-repo"), "my-repo")); - assertTrue(pathMatcher.isPathMatching(repository("my-repo"), "my-repo.git")); - assertTrue(pathMatcher.isPathMatching(repository("my-repo"), "my-repo/with/path")); - assertTrue(pathMatcher.isPathMatching(repository("my-repo"), "my-repo.git/with/path")); + assertTrue(pathMatcher.isPathMatching(repository("space", "my-repo"), "my-repo")); + assertTrue(pathMatcher.isPathMatching(repository("space", "my-repo"), "my-repo.git")); + assertTrue(pathMatcher.isPathMatching(repository("space", "my-repo"), "my-repo/with/path")); + assertTrue(pathMatcher.isPathMatching(repository("space", "my-repo"), "my-repo.git/with/path")); } - private Repository repository(String name) { - return new Repository(name, GitRepositoryHandler.TYPE_NAME, name); + private Repository repository(String namespace, String name) { + return new Repository(name, GitRepositoryHandler.TYPE_NAME, namespace, name); } } diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/spi/AbstractRemoteCommandTestBase.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/spi/AbstractRemoteCommandTestBase.java index a76d110561..e2a401bf7d 100644 --- a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/spi/AbstractRemoteCommandTestBase.java +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/spi/AbstractRemoteCommandTestBase.java @@ -38,34 +38,31 @@ package sonia.scm.repository.spi; import com.google.common.base.Charsets; import com.google.common.io.Files; import com.google.inject.Provider; - import org.eclipse.jgit.api.CommitCommand; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.transport.ScmTransportProtocol; import org.eclipse.jgit.transport.Transport; - import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.rules.TemporaryFolder; - import sonia.scm.repository.Changeset; import sonia.scm.repository.GitRepositoryHandler; import sonia.scm.repository.Repository; import sonia.scm.user.User; import sonia.scm.user.UserTestData; -import static org.junit.Assert.*; - -import static org.mockito.Mockito.*; - -//~--- JDK imports ------------------------------------------------------------ - import java.io.File; import java.io.IOException; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +//~--- JDK imports ------------------------------------------------------------ + /** * * @author Sebastian Sdorra @@ -88,8 +85,8 @@ public class AbstractRemoteCommandTestBase outgoingDirectory = tempFolder.newFile("outgoing"); outgoingDirectory.delete(); - incomgingRepository = new Repository("1", "git", "incoming"); - outgoingRepository = new Repository("2", "git", "outgoing"); + incomgingRepository = new Repository("1", "git", "space", "incoming"); + outgoingRepository = new Repository("2", "git", "space", "outgoing"); incoming = Git.init().setDirectory(incomingDirectory).setBare(false).call(); outgoing = Git.init().setDirectory(outgoingDirectory).setBare(false).call(); diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/web/lfs/LfsBlobStoreFactoryTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/web/lfs/LfsBlobStoreFactoryTest.java index 2eb8968405..fe48e403c5 100644 --- a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/web/lfs/LfsBlobStoreFactoryTest.java +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/web/lfs/LfsBlobStoreFactoryTest.java @@ -35,14 +35,15 @@ package sonia.scm.web.lfs; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import static org.mockito.Matchers.matches; import org.mockito.Mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; import org.mockito.runners.MockitoJUnitRunner; import sonia.scm.repository.Repository; import sonia.scm.store.BlobStoreFactory; +import static org.mockito.Matchers.matches; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; + /** * Unit tests for {@link LfsBlobStoreFactory}. * @@ -59,7 +60,7 @@ public class LfsBlobStoreFactoryTest { @Test public void getBlobStore() throws Exception { - lfsBlobStoreFactory.getLfsBlobStore(new Repository("the-id", "GIT", "the-name")); + lfsBlobStoreFactory.getLfsBlobStore(new Repository("the-id", "GIT", "space", "the-name")); // just make sure the right parameter is passed, as properly validating the return value is nearly impossible with // the return value (and should not be part of this test) diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/web/lfs/servlet/LfsServletFactoryTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/web/lfs/servlet/LfsServletFactoryTest.java index c670032089..74674cc9db 100644 --- a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/web/lfs/servlet/LfsServletFactoryTest.java +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/web/lfs/servlet/LfsServletFactoryTest.java @@ -7,8 +7,9 @@ import javax.servlet.http.HttpServletRequest; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; /** * Created by omilke on 18.05.2017. @@ -18,14 +19,15 @@ public class LfsServletFactoryTest { @Test public void buildBaseUri() throws Exception { + String repositoryNamespace = "space"; String repositoryName = "git-lfs-demo"; - String result = LfsServletFactory.buildBaseUri(new Repository("", "GIT", repositoryName), RequestWithUri(repositoryName, true)); + String result = LfsServletFactory.buildBaseUri(new Repository("", "GIT", repositoryNamespace, repositoryName), RequestWithUri(repositoryName, true)); assertThat(result, is(equalTo("http://localhost:8081/scm/git/git-lfs-demo.git/info/lfs/objects/"))); //result will be with dot-gix suffix, ide - result = LfsServletFactory.buildBaseUri(new Repository("", "GIT", repositoryName), RequestWithUri(repositoryName, false)); + result = LfsServletFactory.buildBaseUri(new Repository("", "GIT", repositoryNamespace, repositoryName), RequestWithUri(repositoryName, false)); assertThat(result, is(equalTo("http://localhost:8081/scm/git/git-lfs-demo.git/info/lfs/objects/"))); } diff --git a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgConfig.java b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgConfig.java index b9bd650925..6438f49d4c 100644 --- a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgConfig.java +++ b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgConfig.java @@ -33,20 +33,19 @@ package sonia.scm.repository; -//~--- non-JDK imports -------------------------------------------------------- import sonia.scm.util.Util; -//~--- JDK imports ------------------------------------------------------------ - import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + /** * * @author Sebastian Sdorra */ @XmlRootElement(name = "config") -public class HgConfig extends SimpleRepositoryConfig +public class HgConfig extends RepositoryConfig { /** @@ -223,4 +222,11 @@ public class HgConfig extends SimpleRepositoryConfig /** Field description */ private boolean showRevisionInId = false; + + @Override + @XmlTransient // Only for permission checks, don't serialize to XML + public String getId() { + // Don't change this without migrating SCM permission configuration! + return "hg"; + } } diff --git a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgHookChangesetProvider.java b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgHookChangesetProvider.java index 17c0816686..59ad0c3345 100644 --- a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgHookChangesetProvider.java +++ b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgHookChangesetProvider.java @@ -34,20 +34,18 @@ package sonia.scm.repository.spi; //~--- non-JDK imports -------------------------------------------------------- import com.aragost.javahg.Repository; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import sonia.scm.repository.HgHookManager; import sonia.scm.repository.HgRepositoryHandler; import sonia.scm.repository.RepositoryHookType; import sonia.scm.repository.spi.javahg.HgLogChangesetCommand; import sonia.scm.web.HgUtil; -//~--- JDK imports ------------------------------------------------------------ - import java.io.File; +//~--- JDK imports ------------------------------------------------------------ + /** * * @author Sebastian Sdorra @@ -63,22 +61,12 @@ public class HgHookChangesetProvider implements HookChangesetProvider //~--- constructors --------------------------------------------------------- - /** - * Constructs ... - * - * - * @param handler - * @param repositoryName - * @param hookManager - * @param startRev - * @param type - */ public HgHookChangesetProvider(HgRepositoryHandler handler, - String repositoryName, HgHookManager hookManager, String startRev, + String id, HgHookManager hookManager, String startRev, RepositoryHookType type) { this.handler = handler; - this.repositoryName = repositoryName; + this.id = id; this.hookManager = hookManager; this.startRev = startRev; this.type = type; @@ -136,7 +124,7 @@ public class HgHookChangesetProvider implements HookChangesetProvider private Repository open() { File directory = handler.getConfig().getRepositoryDirectory(); - File repositoryDirectory = new File(directory, repositoryName); + File repositoryDirectory = new File(directory, id); // use HG_PENDING only for pre receive hooks boolean pending = type == RepositoryHookType.PRE_RECEIVE; @@ -155,7 +143,7 @@ public class HgHookChangesetProvider implements HookChangesetProvider private HgHookManager hookManager; /** Field description */ - private String repositoryName; + private String id; /** Field description */ private HookChangesetResponse response; diff --git a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgHookContextProvider.java b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgHookContextProvider.java index dede59796c..5b354ecec4 100644 --- a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgHookContextProvider.java +++ b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgHookContextProvider.java @@ -38,16 +38,16 @@ import sonia.scm.repository.HgRepositoryHandler; import sonia.scm.repository.RepositoryHookType; import sonia.scm.repository.api.HgHookBranchProvider; import sonia.scm.repository.api.HgHookMessageProvider; +import sonia.scm.repository.api.HgHookTagProvider; import sonia.scm.repository.api.HookBranchProvider; import sonia.scm.repository.api.HookFeature; import sonia.scm.repository.api.HookMessageProvider; - -//~--- JDK imports ------------------------------------------------------------ +import sonia.scm.repository.api.HookTagProvider; import java.util.EnumSet; import java.util.Set; -import sonia.scm.repository.api.HgHookTagProvider; -import sonia.scm.repository.api.HookTagProvider; + +//~--- JDK imports ------------------------------------------------------------ /** * Mercurial implementation of {@link HookContextProvider}. @@ -67,17 +67,16 @@ public class HgHookContextProvider extends HookContextProvider * Constructs a new instance. * * @param handler mercurial repository handler - * @param repositoryName name of changed repository + * @param namespaceAndName namespace and name of changed repository * @param hookManager mercurial hook manager * @param startRev start revision * @param type type of hook */ public HgHookContextProvider(HgRepositoryHandler handler, - String repositoryName, HgHookManager hookManager, String startRev, + String id, HgHookManager hookManager, String startRev, RepositoryHookType type) { - this.hookChangesetProvider = new HgHookChangesetProvider(handler, - repositoryName, hookManager, startRev, type); + this.hookChangesetProvider = new HgHookChangesetProvider(handler, id, hookManager, startRev, type); } //~--- get methods ---------------------------------------------------------- diff --git a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/web/HgCGIServlet.java b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/web/HgCGIServlet.java index e00304c977..6cb4d523f0 100644 --- a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/web/HgCGIServlet.java +++ b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/web/HgCGIServlet.java @@ -39,10 +39,8 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Strings; import com.google.inject.Inject; import com.google.inject.Singleton; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import sonia.scm.SCMContext; import sonia.scm.config.ScmConfiguration; import sonia.scm.repository.HgConfig; @@ -60,19 +58,17 @@ import sonia.scm.web.cgi.CGIExecutor; import sonia.scm.web.cgi.CGIExecutorFactory; import sonia.scm.web.cgi.EnvList; -//~--- JDK imports ------------------------------------------------------------ - -import java.io.File; -import java.io.IOException; -import java.util.Base64; - -import java.util.Enumeration; - import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import java.io.File; +import java.io.IOException; +import java.util.Base64; +import java.util.Enumeration; + +//~--- JDK imports ------------------------------------------------------------ /** * @@ -305,7 +301,7 @@ public class HgCGIServlet extends HttpServlet executor.setExceptionHandler(exceptionHandler); executor.setStatusCodeHandler(exceptionHandler); executor.setContentLengthWorkaround(true); - executor.getEnvironment().set(ENV_REPOSITORY_NAME, name); + executor.getEnvironment().set(ENV_REPOSITORY_NAME, repository.getNamespace() + "/" + repository.getName()); executor.getEnvironment().set(ENV_REPOSITORY_PATH, directory.getAbsolutePath()); diff --git a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/web/HgHookCallbackServlet.java b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/web/HgHookCallbackServlet.java index abbf09380a..2734996686 100644 --- a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/web/HgHookCallbackServlet.java +++ b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/web/HgHookCallbackServlet.java @@ -40,13 +40,10 @@ import com.google.common.io.Closeables; import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; - import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import sonia.scm.repository.HgContext; import sonia.scm.repository.HgHookManager; import sonia.scm.repository.HgRepositoryHandler; @@ -62,19 +59,17 @@ import sonia.scm.security.Tokens; import sonia.scm.util.HttpUtil; import sonia.scm.util.Util; -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; -import java.io.PrintWriter; - -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +//~--- JDK imports ------------------------------------------------------------ /** * @@ -167,27 +162,24 @@ public class HgHookCallbackServlet extends HttpServlet } } - /** - * Method description - * - * - * @param request - * @param response - * - * @throws IOException - * @throws ServletException - */ @Override - protected void doPost(HttpServletRequest request, - HttpServletResponse response) - throws ServletException, IOException + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + try { + handlePostRequest(request, response); + } catch (IOException ex) { + logger.warn("error in hook callback execution, sending internal server error", ex); + response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + } + + private void handlePostRequest(HttpServletRequest request, HttpServletResponse response) throws IOException { String strippedURI = HttpUtil.getStrippedURI(request); Matcher m = REGEX_URL.matcher(strippedURI); if (m.matches()) { - String repositoryId = getRepositoryName(request); + String id = getRepositoryId(request); String type = m.group(1); String challenge = request.getParameter(PARAM_CHALLENGE); @@ -204,7 +196,7 @@ public class HgHookCallbackServlet extends HttpServlet authenticate(request, credentials); } - hookCallback(response, repositoryId, type, challenge, node); + hookCallback(response, id, type, challenge, node); } else if (logger.isDebugEnabled()) { @@ -227,13 +219,6 @@ public class HgHookCallbackServlet extends HttpServlet } } - /** - * Method description - * - * - * @param request - * @param credentials - */ private void authenticate(HttpServletRequest request, String credentials) { try @@ -270,18 +255,7 @@ public class HgHookCallbackServlet extends HttpServlet } } - /** - * Method description - * - * - * @param response - * @param repositoryName - * @param node - * @param type - * - * @throws IOException - */ - private void fireHook(HttpServletResponse response, String repositoryName, + private void fireHook(HttpServletResponse response, String id, String node, RepositoryHookType type) throws IOException { @@ -294,11 +268,10 @@ public class HgHookCallbackServlet extends HttpServlet contextProvider.get().setPending(true); } - context = new HgHookContextProvider(handler, repositoryName, hookManager, + context = new HgHookContextProvider(handler, id, hookManager, node, type); - hookEventFacade.handle(HgRepositoryHandler.TYPE_NAME, - repositoryName).fireHookEvent(type, context); + hookEventFacade.handle(id).fireHookEvent(type, context); printMessages(response, context); } @@ -306,7 +279,7 @@ public class HgHookCallbackServlet extends HttpServlet { if (logger.isErrorEnabled()) { - logger.error("could not find repository {}", repositoryName); + logger.error("could not find repository with id {}", id); if (logger.isTraceEnabled()) { @@ -322,22 +295,7 @@ public class HgHookCallbackServlet extends HttpServlet } } - /** - * Method description - * - * - * @param response - * @param repositoryName - * @param typeName - * @param challenge - * @param node - * - * @throws IOException - */ - private void hookCallback(HttpServletResponse response, - String repositoryName, String typeName, String challenge, String node) - throws IOException - { + private void hookCallback(HttpServletResponse response, String id, String typeName, String challenge, String node) throws IOException { if (hookManager.isAcceptAble(challenge)) { RepositoryHookType type = null; @@ -353,7 +311,7 @@ public class HgHookCallbackServlet extends HttpServlet if (type != null) { - fireHook(response, repositoryName, node, type); + fireHook(response, id, node, type); } else { @@ -403,12 +361,12 @@ public class HgHookCallbackServlet extends HttpServlet * Method description * * - * @param resonse + * @param response * @param context * * @throws IOException */ - private void printMessages(HttpServletResponse resonse, + private void printMessages(HttpServletResponse response, HgHookContextProvider context) throws IOException { @@ -420,7 +378,7 @@ public class HgHookCallbackServlet extends HttpServlet try { - writer = resonse.getWriter(); + writer = response.getWriter(); printMessages(writer, msgs); } @@ -506,9 +464,9 @@ public class HgHookCallbackServlet extends HttpServlet * * @return */ - private String getRepositoryName(HttpServletRequest request) + private String getRepositoryId(HttpServletRequest request) { - String name = null; + String id = null; String path = request.getParameter(PARAM_REPOSITORYPATH); if (Util.isNotEmpty(path)) @@ -520,11 +478,11 @@ public class HgHookCallbackServlet extends HttpServlet */ try { - name = RepositoryUtil.getRepositoryName(handler, path); + id = RepositoryUtil.getRepositoryId(handler, path); } catch (IOException ex) { - logger.error("could not find name of repository", ex); + logger.error("could not find namespace and name of repository", ex); } } else if (logger.isWarnEnabled()) @@ -532,7 +490,7 @@ public class HgHookCallbackServlet extends HttpServlet logger.warn("no repository path parameter found"); } - return name; + return id; } //~--- fields --------------------------------------------------------------- diff --git a/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/HgRepositoryHandlerTest.java b/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/HgRepositoryHandlerTest.java index c14e5f1b61..bd14a63b56 100644 --- a/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/HgRepositoryHandlerTest.java +++ b/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/HgRepositoryHandlerTest.java @@ -1,19 +1,19 @@ /** * Copyright (c) 2010, Sebastian Sdorra * All rights reserved. - * + *

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + *

* 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + *

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,43 +24,45 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + *

* http://bitbucket.org/sdorra/scm-manager - * */ - package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; import sonia.scm.io.DefaultFileSystem; - -import static org.junit.Assert.*; - -//~--- JDK imports ------------------------------------------------------------ +import sonia.scm.store.ConfigurationStoreFactory; import java.io.File; -import sonia.scm.store.ConfigurationStoreFactory; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +//~--- JDK imports ------------------------------------------------------------ /** * * @author Sebastian Sdorra */ -public class HgRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase -{ +@RunWith(MockitoJUnitRunner.class) +public class HgRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase { + + @Mock + private ConfigurationStoreFactory factory; + + @Mock + private com.google.inject.Provider provider; - /** - * Method description - * - * - * @param directory - */ @Override - protected void checkDirectory(File directory) - { + protected void checkDirectory(File directory) { File hgDirectory = new File(directory, ".hg"); assertTrue(hgDirectory.exists()); @@ -73,22 +75,12 @@ public class HgRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase assertTrue(hgrc.length() > 0); } - /** - * Method description - * - * - * @param factory - * @param directory - * - * @return - */ @Override protected RepositoryHandler createRepositoryHandler(ConfigurationStoreFactory factory, - File directory) - { + File directory) { HgRepositoryHandler handler = new HgRepositoryHandler(factory, - new DefaultFileSystem(), - new HgContextProvider()); + new DefaultFileSystem(), + new HgContextProvider()); handler.init(contextProvider); handler.getConfig().setRepositoryDirectory(directory); @@ -97,5 +89,21 @@ public class HgRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase return handler; } + + @Test + public void getDirectory() { + HgRepositoryHandler repositoryHandler = new HgRepositoryHandler(factory, + new DefaultFileSystem(), provider); + + HgConfig hgConfig = new HgConfig(); + hgConfig.setRepositoryDirectory(new File("/path")); + hgConfig.setHgBinary("hg"); + hgConfig.setPythonBinary("python"); + repositoryHandler.setConfig(hgConfig); + + Repository repository = new Repository("id", "git", "Space", "Name"); + + File path = repositoryHandler.getDirectory(repository); + assertEquals("/path/id", path.getAbsolutePath()); + } } -//~--- non-JDK imports -------------------------------------------------------- diff --git a/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/spi/IncomingOutgoingTestBase.java b/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/spi/IncomingOutgoingTestBase.java index c45d0af2da..8dca8fdfe6 100644 --- a/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/spi/IncomingOutgoingTestBase.java +++ b/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/spi/IncomingOutgoingTestBase.java @@ -41,14 +41,11 @@ import com.aragost.javahg.Repository; import com.aragost.javahg.RepositoryConfiguration; import com.aragost.javahg.commands.AddCommand; import com.aragost.javahg.commands.CommitCommand; - import com.google.common.base.Charsets; import com.google.common.io.Files; - import org.junit.Before; import org.junit.Rule; import org.junit.rules.TemporaryFolder; - import sonia.scm.AbstractTestBase; import sonia.scm.repository.HgConfig; import sonia.scm.repository.HgContext; @@ -58,15 +55,15 @@ import sonia.scm.user.User; import sonia.scm.user.UserTestData; import sonia.scm.util.MockUtil; -import static org.junit.Assert.*; - -import static org.mockito.Mockito.*; - -//~--- JDK imports ------------------------------------------------------------ - import java.io.File; import java.io.IOException; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +//~--- JDK imports ------------------------------------------------------------ + /** * * @author Sebastian Sdorra @@ -90,10 +87,8 @@ public abstract class IncomingOutgoingTestBase extends AbstractTestBase incomingDirectory = tempFolder.newFolder("incoming"); outgoingDirectory = tempFolder.newFolder("outgoing"); - incomingRepository = new sonia.scm.repository.Repository("1", "hg", - "incoming"); - outgoingRepository = new sonia.scm.repository.Repository("2", "hg", - "outgoing"); + incomingRepository = new sonia.scm.repository.Repository("1", "hg", "space", "incoming"); + outgoingRepository = new sonia.scm.repository.Repository("2", "hg", "space", "outgoing"); incoming = Repository.create(createConfig(temp), incomingDirectory); outgoing = Repository.create(createConfig(temp), outgoingDirectory); diff --git a/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/web/HgHookCallbackServletTest.java b/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/web/HgHookCallbackServletTest.java new file mode 100644 index 0000000000..a586962bb8 --- /dev/null +++ b/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/web/HgHookCallbackServletTest.java @@ -0,0 +1,41 @@ +package sonia.scm.web; + +import org.junit.Test; +import sonia.scm.repository.HgConfig; +import sonia.scm.repository.HgRepositoryHandler; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; + +import static org.mockito.Matchers.anyInt; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static sonia.scm.web.HgHookCallbackServlet.PARAM_REPOSITORYPATH; + +public class HgHookCallbackServletTest { + + @Test + public void shouldExtractCorrectRepositoryId() throws ServletException, IOException { + HgRepositoryHandler handler = mock(HgRepositoryHandler.class); + HgHookCallbackServlet servlet = new HgHookCallbackServlet(null, handler, null, null); + HttpServletRequest request = mock(HttpServletRequest.class); + HttpServletResponse response = mock(HttpServletResponse.class); + HgConfig config = mock(HgConfig.class); + + when(request.getContextPath()).thenReturn("http://example.com/scm"); + when(request.getRequestURI()).thenReturn("http://example.com/scm/hook/hg/pretxnchangegroup"); + when(request.getParameter(PARAM_REPOSITORYPATH)).thenReturn("/tmp/hg/12345"); + + when(handler.getConfig()).thenReturn(config); + when(config.getRepositoryDirectory()).thenReturn(new File("/tmp/hg")); + + servlet.doPost(request, response); + + verify(response, never()).sendError(anyInt()); + } +} diff --git a/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnConfig.java b/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnConfig.java index c4b0af57a1..73b4f39219 100644 --- a/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnConfig.java +++ b/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnConfig.java @@ -33,12 +33,11 @@ package sonia.scm.repository; -//~--- JDK imports ------------------------------------------------------------ - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; /** * @@ -46,7 +45,7 @@ import javax.xml.bind.annotation.XmlRootElement; */ @XmlRootElement(name = "config") @XmlAccessorType(XmlAccessType.FIELD) -public class SvnConfig extends SimpleRepositoryConfig +public class SvnConfig extends RepositoryConfig { /** @@ -108,4 +107,11 @@ public class SvnConfig extends SimpleRepositoryConfig /** Field description */ private Compatibility compatibility = Compatibility.NONE; + + @Override + @XmlTransient // Only for permission checks, don't serialize to XML + public String getId() { + // Don't change this without migrating SCM permission configuration! + return "svn"; + } } diff --git a/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnRepositoryHook.java b/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnRepositoryHook.java index 1de3b2aecb..00958174a4 100644 --- a/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnRepositoryHook.java +++ b/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnRepositoryHook.java @@ -37,7 +37,6 @@ package sonia.scm.repository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import org.tmatesoft.svn.core.SVNCancelException; import org.tmatesoft.svn.core.SVNErrorCode; import org.tmatesoft.svn.core.SVNErrorMessage; @@ -45,21 +44,19 @@ import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.internal.io.fs.FSHook; import org.tmatesoft.svn.core.internal.io.fs.FSHookEvent; import org.tmatesoft.svn.core.internal.io.fs.FSHooks; - import sonia.scm.repository.spi.AbstractSvnHookChangesetProvider; import sonia.scm.repository.spi.HookEventFacade; import sonia.scm.repository.spi.SvnHookContextProvider; import sonia.scm.repository.spi.SvnPostReceiveHookChangesetProvier; import sonia.scm.repository.spi.SvnPreReceiveHookChangesetProvier; import sonia.scm.util.AssertUtil; -import sonia.scm.util.IOUtil; import sonia.scm.util.Util; -//~--- JDK imports ------------------------------------------------------------ - import java.io.File; import java.io.IOException; +//~--- JDK imports ------------------------------------------------------------ + /** * * @author Sebastian Sdorra @@ -166,12 +163,10 @@ public class SvnRepositoryHook implements FSHook { try { - String name = getRepositoryName(directory); - - name = IOUtil.trimSeperatorChars(name); + String id = getRepositoryId(directory); //J- - hookEventFacade.handle(SvnRepositoryHandler.TYPE_NAME, name) + hookEventFacade.handle(id) .fireHookEvent( changesetProvider.getType(), new SvnHookContextProvider(changesetProvider) @@ -202,11 +197,11 @@ public class SvnRepositoryHook implements FSHook * * @throws IOException */ - private String getRepositoryName(File directory) throws IOException + private String getRepositoryId(File directory) throws IOException { AssertUtil.assertIsNotNull(directory); - return RepositoryUtil.getRepositoryName(handler, directory); + return RepositoryUtil.getRepositoryId(handler, directory); } //~--- fields --------------------------------------------------------------- diff --git a/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/web/SvnCollectionRenderer.java b/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/web/SvnCollectionRenderer.java index 0bfb6b4575..2808c2b384 100644 --- a/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/web/SvnCollectionRenderer.java +++ b/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/web/SvnCollectionRenderer.java @@ -57,9 +57,6 @@ import sonia.scm.repository.RepositoryProvider; import sonia.scm.template.Template; import sonia.scm.template.TemplateEngine; import sonia.scm.template.TemplateEngineFactory; -import sonia.scm.url.RepositoryUrlProvider; -import sonia.scm.url.UrlProvider; -import sonia.scm.url.UrlProviderFactory; import sonia.scm.util.HttpUtil; //~--- JDK imports ------------------------------------------------------------ @@ -182,24 +179,15 @@ public class SvnCollectionRenderer implements CollectionRenderer entries.add(new DirectoryEntry(resource, entry)); } - UrlProvider urlProvider = createUrlProvider(); - //J- return new RepositoryWrapper( - urlProvider.getRepositoryUrlProvider(), repositoryProvider.get(), resource, new DirectoryOrdering().immutableSortedCopy(entries.build()) ); //J+ } - - private UrlProvider createUrlProvider() { - String baseUrl = getBaseUrl(); - logger.trace("render subversion collection with base url: {}", baseUrl); - return UrlProviderFactory.createUrlProvider(baseUrl, UrlProviderFactory.TYPE_WUI); - } - + private String getBaseUrl() { return HttpUtil.getCompleteUrl(requestProvider.get()); } @@ -395,15 +383,12 @@ public class SvnCollectionRenderer implements CollectionRenderer * * * - * @param repositoryUrlProvider * @param repository * @param resource * @param entries */ - public RepositoryWrapper(RepositoryUrlProvider repositoryUrlProvider, - Repository repository, DAVResource resource, List entries) + public RepositoryWrapper(Repository repository, DAVResource resource, List entries) { - this.repositoryUrlProvider = repositoryUrlProvider; this.repository = repository; this.resource = resource; this.entries = entries; @@ -411,17 +396,6 @@ public class SvnCollectionRenderer implements CollectionRenderer //~--- get methods -------------------------------------------------------- - /** - * Method description - * - * - * @return - */ - public String getCommitViewLink() - { - return repositoryUrlProvider.getChangesetUrl(repository.getId(), 0, 20); - } - /** * Method description * @@ -455,18 +429,6 @@ public class SvnCollectionRenderer implements CollectionRenderer return repository; } - /** - * Method description - * - * - * @return - */ - public String getSourceViewLink() - { - return repositoryUrlProvider.getBrowseUrl(repository.getId(), - resource.getResourceURI().getPath(), null); - } - //~--- fields ------------------------------------------------------------- /** Field description */ @@ -475,9 +437,6 @@ public class SvnCollectionRenderer implements CollectionRenderer /** Field description */ private final Repository repository; - /** Field description */ - private final RepositoryUrlProvider repositoryUrlProvider; - /** Field description */ private final DAVResource resource; } diff --git a/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/web/SvnDAVServlet.java b/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/web/SvnDAVServlet.java index db22857595..c811179255 100644 --- a/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/web/SvnDAVServlet.java +++ b/scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/web/SvnDAVServlet.java @@ -37,13 +37,10 @@ package sonia.scm.web; import com.google.inject.Inject; import com.google.inject.Singleton; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import org.tmatesoft.svn.core.internal.server.dav.DAVConfig; import org.tmatesoft.svn.core.internal.server.dav.DAVServlet; - import sonia.scm.repository.Repository; import sonia.scm.repository.RepositoryProvider; import sonia.scm.repository.RepositoryRequestListenerUtil; @@ -51,14 +48,13 @@ import sonia.scm.repository.SvnRepositoryHandler; import sonia.scm.util.AssertUtil; import sonia.scm.util.HttpUtil; -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; - import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +//~--- JDK imports ------------------------------------------------------------ /** * @@ -224,7 +220,7 @@ public class SvnDAVServlet extends DAVServlet pathInfo = pathInfo.substring(1); } - pathInfo = pathInfo.substring(repository.getName().length()); + pathInfo = pathInfo.substring(repository.getNamespace().length() + 1 + repository.getName().length()); } return pathInfo; @@ -249,7 +245,7 @@ public class SvnDAVServlet extends DAVServlet servletPath = servletPath.concat(HttpUtil.SEPARATOR_PATH); } - servletPath = servletPath.concat(repository.getName()); + servletPath = servletPath + repository.getNamespace() + "/" + repository.getName(); } return servletPath; diff --git a/scm-plugins/scm-svn-plugin/src/test/java/sonia/scm/repository/SvnRepositoryHandlerTest.java b/scm-plugins/scm-svn-plugin/src/test/java/sonia/scm/repository/SvnRepositoryHandlerTest.java index af80e27bcf..f2c53e413c 100644 --- a/scm-plugins/scm-svn-plugin/src/test/java/sonia/scm/repository/SvnRepositoryHandlerTest.java +++ b/scm-plugins/scm-svn-plugin/src/test/java/sonia/scm/repository/SvnRepositoryHandlerTest.java @@ -1,19 +1,19 @@ /** * Copyright (c) 2010, Sebastian Sdorra * All rights reserved. - * + *

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + *

* 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + *

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,42 +24,56 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + *

* http://bitbucket.org/sdorra/scm-manager - * */ - package sonia.scm.repository; -//~--- non-JDK imports -------------------------------------------------------- +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; import sonia.scm.io.DefaultFileSystem; - -import static org.junit.Assert.*; - -//~--- JDK imports ------------------------------------------------------------ +import sonia.scm.repository.api.HookContextFactory; +import sonia.scm.repository.spi.HookEventFacade; +import sonia.scm.store.ConfigurationStore; +import sonia.scm.store.ConfigurationStoreFactory; import java.io.File; -import sonia.scm.store.ConfigurationStoreFactory; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +//~--- JDK imports ------------------------------------------------------------ /** * * @author Sebastian Sdorra */ -public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase -{ +@RunWith(MockitoJUnitRunner.class) +public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase { + + @Mock + private ConfigurationStoreFactory factory; + + @Mock + private ConfigurationStore store; + + @Mock + private com.google.inject.Provider repositoryManagerProvider; + + private HookContextFactory hookContextFactory = new HookContextFactory(mock(PreProcessorUtil.class)); + + private HookEventFacade facade = new HookEventFacade(repositoryManagerProvider, hookContextFactory); - /** - * Method description - * - * - * @param directory - */ @Override - protected void checkDirectory(File directory) - { + protected void checkDirectory(File directory) { File format = new File(directory, "format"); assertTrue(format.exists()); @@ -71,21 +85,11 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase assertTrue(db.isDirectory()); } - /** - * Method description - * - * - * @param factory - * @param directory - * - * @return - */ @Override protected RepositoryHandler createRepositoryHandler(ConfigurationStoreFactory factory, - File directory) - { + File directory) { SvnRepositoryHandler handler = new SvnRepositoryHandler(factory, - new DefaultFileSystem(), null); + new DefaultFileSystem(), null); handler.init(contextProvider); @@ -98,4 +102,20 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase return handler; } + + @Test + public void getDirectory() { + when(factory.getStore(any(), any())).thenReturn(store); + SvnRepositoryHandler repositoryHandler = new SvnRepositoryHandler(factory, + new DefaultFileSystem(), facade); + + SvnConfig svnConfig = new SvnConfig(); + svnConfig.setRepositoryDirectory(new File("/path")); + repositoryHandler.setConfig(svnConfig); + + Repository repository = new Repository("id", "svn", "Space", "Name"); + + File path = repositoryHandler.getDirectory(repository); + assertEquals("/path/id", path.getAbsolutePath()); + } } diff --git a/scm-test/pom.xml b/scm-test/pom.xml index 94948a830a..086552e864 100644 --- a/scm-test/pom.xml +++ b/scm-test/pom.xml @@ -33,11 +33,11 @@ junit ${junit.version} - + com.github.sdorra shiro-unit - 1.0.0 + test diff --git a/scm-test/src/main/java/sonia/scm/repository/DummyRepositoryHandler.java b/scm-test/src/main/java/sonia/scm/repository/DummyRepositoryHandler.java index 0a85231da0..bf68c27b19 100644 --- a/scm-test/src/main/java/sonia/scm/repository/DummyRepositoryHandler.java +++ b/scm-test/src/main/java/sonia/scm/repository/DummyRepositoryHandler.java @@ -1,19 +1,19 @@ /** * Copyright (c) 2010, Sebastian Sdorra * All rights reserved. - * + *

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + *

* 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + *

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,113 +24,76 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + *

* http://bitbucket.org/sdorra/scm-manager - * */ - package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- import sonia.scm.Type; import sonia.scm.io.DefaultFileSystem; +import sonia.scm.store.ConfigurationStoreFactory; + +import javax.xml.bind.annotation.XmlRootElement; +import java.io.File; +import java.util.HashSet; +import java.util.Set; //~--- JDK imports ------------------------------------------------------------ -import java.io.File; -import java.io.IOException; -import sonia.scm.store.ConfigurationStoreFactory; - /** * * @author Sebastian Sdorra */ public class DummyRepositoryHandler - extends AbstractSimpleRepositoryHandler -{ + extends AbstractSimpleRepositoryHandler { - /** Field description */ public static final String TYPE_DISPLAYNAME = "Dummy"; - /** Field description */ public static final String TYPE_NAME = "dummy"; - /** Field description */ public static final Type TYPE = new Type(TYPE_NAME, TYPE_DISPLAYNAME); - //~--- constructors --------------------------------------------------------- + private final Set existingRepoNames = new HashSet<>(); - /** - * Constructs ... - * - * - * @param storeFactory - */ - public DummyRepositoryHandler(ConfigurationStoreFactory storeFactory) - { + public DummyRepositoryHandler(ConfigurationStoreFactory storeFactory) { super(storeFactory, new DefaultFileSystem()); } - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ @Override - public Type getType() - { + public Type getType() { return TYPE; } - //~--- methods -------------------------------------------------------------- - /** - * Method description - * - * - * @param repository - * @param directory - * - * @throws IOException - * @throws RepositoryException - */ @Override - protected void create(Repository repository, File directory) - throws RepositoryException, IOException - { - - // do nothing + protected void create(Repository repository, File directory) throws RepositoryException { + String key = repository.getNamespace() + "/" + repository.getName(); + if (existingRepoNames.contains(key)) { + throw new RepositoryAlreadyExistsException("Repo exists"); + } else { + existingRepoNames.add(key); + } } - /** - * Method description - * - * - * @return - */ @Override - protected SimpleRepositoryConfig createInitialConfig() - { - return new SimpleRepositoryConfig(); + protected DummyRepositoryConfig createInitialConfig() { + return new DummyRepositoryConfig(); } - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ @Override - protected Class getConfigClass() - { - return SimpleRepositoryConfig.class; + protected Class getConfigClass() { + return DummyRepositoryConfig.class; + } + + @XmlRootElement(name = "config") + public static class DummyRepositoryConfig extends RepositoryConfig { + @Override + public String getId() { + return TYPE_NAME; + } } } diff --git a/scm-test/src/main/java/sonia/scm/repository/RepositoryBuilder.java b/scm-test/src/main/java/sonia/scm/repository/RepositoryBuilder.java new file mode 100644 index 0000000000..9c8ceb4762 --- /dev/null +++ b/scm-test/src/main/java/sonia/scm/repository/RepositoryBuilder.java @@ -0,0 +1,49 @@ +package sonia.scm.repository; + +public class RepositoryBuilder { + + private String id = "id-" + ++nextID; + private String contact = "test@example.com"; + private String description = ""; + private String namespace = "test"; + private String name = "name"; + private String type = "git"; + + private static int nextID = 0; + + public RepositoryBuilder type(String type) { + this.type = type; + return this; + } + + public RepositoryBuilder contact(String contact) { + this.contact = contact; + return this; + } + + public RepositoryBuilder namespace(String namespace) { + this.namespace = namespace; + return this; + } + + public RepositoryBuilder name(String name) { + this.name = name; + return this; + } + + public RepositoryBuilder description(String description) { + this.description = description; + return this; + } + + public Repository build() { + Repository repository = new Repository(); + repository.setId(id); + repository.setType(type); + repository.setContact(contact); + repository.setNamespace(namespace); + repository.setName(name); + repository.setDescription(description); + return repository; + } +} diff --git a/scm-test/src/main/java/sonia/scm/repository/RepositoryTestData.java b/scm-test/src/main/java/sonia/scm/repository/RepositoryTestData.java index d5d443fe31..b81c39ca00 100644 --- a/scm-test/src/main/java/sonia/scm/repository/RepositoryTestData.java +++ b/scm-test/src/main/java/sonia/scm/repository/RepositoryTestData.java @@ -6,13 +6,13 @@ * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -26,154 +26,68 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * http://bitbucket.org/sdorra/scm-manager - * */ - package sonia.scm.repository; -/** - * - * @author Sebastian Sdorra - */ -public final class RepositoryTestData -{ +public final class RepositoryTestData { - /** - * Constructs ... - * - */ - private RepositoryTestData() {} + private RepositoryTestData() { + } - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - public static Repository create42Puzzle() - { + public static Repository create42Puzzle() { return create42Puzzle(DummyRepositoryHandler.TYPE_NAME); } - /** - * Method description - * - * - * @param type - * - * @return - */ - public static Repository create42Puzzle(String type) - { - Repository repository = new Repository(); - - repository.setType(type); - repository.setContact("douglas.adams@hitchhiker.com"); - repository.setName("42Puzzle"); - repository.setDescription("The 42 Puzzle"); - - return repository; + public static Repository create42Puzzle(String type) { + return new RepositoryBuilder() + .type(type) + .contact("douglas.adams@hitchhiker.com") + .name("42Puzzle") + .description("The 42 Puzzle") + .build(); } - /** - * Method description - * - * - * @return - */ - public static Repository createHappyVerticalPeopleTransporter() - { + public static Repository createHappyVerticalPeopleTransporter() { return createHappyVerticalPeopleTransporter( DummyRepositoryHandler.TYPE_NAME); } - /** - * Method description - * - * - * - * @param type - * @return - */ - public static Repository createHappyVerticalPeopleTransporter(String type) - { - Repository happyVerticalPeopleTransporter = new Repository(); - - happyVerticalPeopleTransporter.setType(type); - happyVerticalPeopleTransporter.setContact( - "zaphod.beeblebrox@hitchhiker.com"); - happyVerticalPeopleTransporter.setName("happyVerticalPeopleTransporter"); - happyVerticalPeopleTransporter.setDescription( - "Happy Vertical People Transporter"); - - return happyVerticalPeopleTransporter; + public static Repository createHappyVerticalPeopleTransporter(String type) { + return new RepositoryBuilder() + .type(type) + .contact("zaphod.beeblebrox@hitchhiker.com") + .name("happyVerticalPeopleTransporter") + .description("Happy Vertical People Transporter") + .build(); } - /** - * Method description - * - * - * @return - */ - public static Repository createHeartOfGold() - { + public static Repository createHeartOfGold() { return createHeartOfGold(DummyRepositoryHandler.TYPE_NAME); } - /** - * Method description - * - * - * - * @param type - * @return - */ - public static Repository createHeartOfGold(String type) - { - Repository heartOfGold = new Repository(); - - heartOfGold.setType(type); - heartOfGold.setContact("zaphod.beeblebrox@hitchhiker.com"); - heartOfGold.setName("HeartOfGold"); - heartOfGold.setDescription( - "Heart of Gold is the first prototype ship to successfully utilise the revolutionary Infinite Improbability Drive"); - - return heartOfGold; + public static Repository createHeartOfGold(String type) { + return new RepositoryBuilder() + .type(type) + .contact("zaphod.beeblebrox@hitchhiker.com") + .name("HeartOfGold") + .description( + "Heart of Gold is the first prototype ship to successfully utilise the revolutionary Infinite Improbability Drive") + .build(); } - /** - * Method description - * - * - * @return - */ - public static Repository createRestaurantAtTheEndOfTheUniverse() - { + public static Repository createRestaurantAtTheEndOfTheUniverse() { return createRestaurantAtTheEndOfTheUniverse( DummyRepositoryHandler.TYPE_NAME); } - /** - * Method description - * - * - * @param type - * - * @return - */ - public static Repository createRestaurantAtTheEndOfTheUniverse(String type) - { - Repository repository = new Repository(); - - repository.setType(type); - repository.setContact("douglas.adams@hitchhiker.com"); - repository.setName("RestaurantAtTheEndOfTheUniverse"); - repository.setDescription("The Restaurant at the End of the Universe"); - - return repository; + public static Repository createRestaurantAtTheEndOfTheUniverse(String type) { + return new RepositoryBuilder() + .type(type) + .contact("douglas.adams@hitchhiker.com") + .name("RestaurantAtTheEndOfTheUniverse") + .description("The Restaurant at the End of the Universe") + .build(); } } diff --git a/scm-test/src/main/java/sonia/scm/repository/SimpleRepositoryHandlerTestBase.java b/scm-test/src/main/java/sonia/scm/repository/SimpleRepositoryHandlerTestBase.java index 19af367a1d..680ac83dd9 100644 --- a/scm-test/src/main/java/sonia/scm/repository/SimpleRepositoryHandlerTestBase.java +++ b/scm-test/src/main/java/sonia/scm/repository/SimpleRepositoryHandlerTestBase.java @@ -1,19 +1,19 @@ /** * Copyright (c) 2010, Sebastian Sdorra * All rights reserved. - * + *

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + *

* 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + *

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,169 +24,88 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + *

* http://bitbucket.org/sdorra/scm-manager - * */ - package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- import org.junit.Test; - import sonia.scm.AbstractTestBase; +import sonia.scm.store.ConfigurationStoreFactory; import sonia.scm.store.InMemoryConfigurationStoreFactory; import sonia.scm.util.IOUtil; -import static org.junit.Assert.*; +import java.io.File; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; //~--- JDK imports ------------------------------------------------------------ -import java.io.File; -import java.io.IOException; -import sonia.scm.store.ConfigurationStoreFactory; - /** * * @author Sebastian Sdorra */ -public abstract class SimpleRepositoryHandlerTestBase extends AbstractTestBase -{ +public abstract class SimpleRepositoryHandlerTestBase extends AbstractTestBase { + - /** - * Method description - * - * - * @param directory - */ protected abstract void checkDirectory(File directory); - /** - * Method description - * - * - * @param factory - * @param directory - * - * @return - */ protected abstract RepositoryHandler createRepositoryHandler( - ConfigurationStoreFactory factory, File directory); + ConfigurationStoreFactory factory, File directory); - /** - * Method description - * - * - * @throws IOException - * @throws RepositoryException - */ @Test - public void testCreate() throws RepositoryException, IOException - { + public void testCreate() throws RepositoryException { createRepository(); } - /** - * Method description - * - * - * @throws IOException - * @throws RepositoryException - */ - @Test(expected = RepositoryAlreadyExistsException.class) - public void testCreateExisitingRepository() - throws RepositoryException, IOException - { - createRepository(); - createRepository(); - } - - /** - * Method description - * - * - * @throws IOException - * @throws RepositoryException - */ @Test - public void testCreateResourcePath() throws RepositoryException, IOException - { + public void testCreateResourcePath() throws RepositoryException { Repository repository = createRepository(); String path = handler.createResourcePath(repository); assertNotNull(path); assertTrue(path.trim().length() > 0); - assertTrue(path.contains(repository.getName())); + assertTrue(path.contains(repository.getId())); } - /** - * Method description - * - * - * @throws IOException - * @throws RepositoryException - */ @Test - public void testDelete() throws RepositoryException, IOException - { + public void testDelete() throws RepositoryException { Repository repository = createRepository(); handler.delete(repository); - File directory = new File(baseDirectory, repository.getName()); + File directory = new File(baseDirectory, repository.getId()); assertFalse(directory.exists()); } - /** - * Method description - * - * - * @throws Exception - */ @Override - protected void postSetUp() throws Exception - { + protected void postSetUp() { InMemoryConfigurationStoreFactory storeFactory = new InMemoryConfigurationStoreFactory(); baseDirectory = new File(contextProvider.getBaseDirectory(), "repositories"); IOUtil.mkdirs(baseDirectory); handler = createRepositoryHandler(storeFactory, baseDirectory); } - /** - * Method description - * - * - * @throws Exception - */ @Override - protected void preTearDown() throws Exception - { - if (handler != null) - { + protected void preTearDown() throws Exception { + if (handler != null) { handler.close(); } } - /** - * Method description - * - * - * @return - * - * @throws IOException - * @throws RepositoryException - */ - private Repository createRepository() throws RepositoryException, IOException - { + private Repository createRepository() throws RepositoryException { Repository repository = RepositoryTestData.createHeartOfGold(); handler.create(repository); - File directory = new File(baseDirectory, repository.getName()); + File directory = new File(baseDirectory, repository.getId()); assertTrue(directory.exists()); assertTrue(directory.isDirectory()); @@ -195,11 +114,7 @@ public abstract class SimpleRepositoryHandlerTestBase extends AbstractTestBase return repository; } - //~--- fields --------------------------------------------------------------- - - /** Field description */ protected File baseDirectory; - /** Field description */ private RepositoryHandler handler; } diff --git a/scm-ui/.eslintrc b/scm-ui/.eslintrc new file mode 100644 index 0000000000..d299c1fed5 --- /dev/null +++ b/scm-ui/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": "react-app" +} diff --git a/scm-ui/.flowconfig b/scm-ui/.flowconfig new file mode 100644 index 0000000000..4a58bdcdef --- /dev/null +++ b/scm-ui/.flowconfig @@ -0,0 +1,7 @@ +[ignore] + +[include] + +[libs] + +[options] diff --git a/scm-ui/.vscode/launch.json b/scm-ui/.vscode/launch.json new file mode 100644 index 0000000000..489c044be5 --- /dev/null +++ b/scm-ui/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:3000", + "webRoot": "${workspaceFolder}/src" + } + ] +} diff --git a/scm-ui/.vscode/settings.json b/scm-ui/.vscode/settings.json new file mode 100644 index 0000000000..f5d90fdf4b --- /dev/null +++ b/scm-ui/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "javascript.validate.enable": false, + // Set the default + "editor.formatOnSave": false, + // Enable per-language + "[javascript]": { + "editor.formatOnSave": true + }, + "flow.pathToFlow": "${workspaceRoot}/node_modules/.bin/flow" +} diff --git a/scm-ui/.vscode/snippets/javascript.json b/scm-ui/.vscode/snippets/javascript.json new file mode 100644 index 0000000000..3d40c226aa --- /dev/null +++ b/scm-ui/.vscode/snippets/javascript.json @@ -0,0 +1,97 @@ +{ + "React default component": { + "prefix": "rdc", + "body": [ + "//@flow", + "import React from \"react\";", + "", + "type Props = {};", + "", + "class $1 extends React.Component {", + " render() {", + " return

;", + " }", + "}", + "", + "export default $1;" + ], + "description": "React default component with props" + }, + + "React styled component": { + "prefix": "rsc", + "body": [ + "//@flow", + "import React from \"react\";", + "import injectSheet from \"react-jss\";", + "", + "const styles = {};", + "", + "type Props = {", + " classes: any", + "};", + "", + "class $1 extends React.Component {", + " render() {", + " const { classes } = this.props;", + " return
;", + " }", + "}", + "", + "export default injectSheet(styles)($1);" + ], + "description": "React default component with props" + }, + + "React container component": { + "prefix": "rcc", + "body": [ + "//@flow", + "import React from \"react\";", + "import { connect } from \"react-redux\";", + "", + "type Props = {};", + "", + "class $1 extends React.Component {", + " render() {", + " return
;", + " }", + "}", + "", + "const mapStateToProps = state => {", + " return {};", + "};", + "", + "const mapDispatchToProps = (dispatch) => {", + " return {};", + "};", + "", + "export default connect(", + " mapStateToProps,", + " mapDispatchToProps", + ")($1);" + ], + "description": "React component which is connected to the store" + }, + + "React component test": { + "prefix": "rct", + "body": [ + "//@flow", + "import React from \"react\";", + "import { configure, shallow } from \"enzyme\";", + "import Adapter from \"enzyme-adapter-react-16\";", + "", + "import \"raf/polyfill\";", + "", + "configure({ adapter: new Adapter() });", + "", + "it(\"should render the component\", () => {", + " $0", + " //const label = shallow(
+
} +
+ + ) + } +} + +function createElementReconfirm (properties) { + const divTarget = document.createElement('div') + divTarget.id = 'react-confirm-alert' + document.body.appendChild(divTarget) + render(, divTarget) +} + +function removeElementReconfirm () { + const target = document.getElementById('react-confirm-alert') + unmountComponentAtNode(target) + target.parentNode.removeChild(target) +} + +export function confirmAlert (properties) { + createElementReconfirm(properties) +} + +export default ConfirmAlert; diff --git a/scm-ui/src/components/modals/index.js b/scm-ui/src/components/modals/index.js new file mode 100644 index 0000000000..be161dbe0f --- /dev/null +++ b/scm-ui/src/components/modals/index.js @@ -0,0 +1 @@ +export { default as ConfirmAlert } from "./ConfirmAlert"; diff --git a/scm-ui/src/components/navigation/NavAction.js b/scm-ui/src/components/navigation/NavAction.js new file mode 100644 index 0000000000..5eacbb7407 --- /dev/null +++ b/scm-ui/src/components/navigation/NavAction.js @@ -0,0 +1,20 @@ +//@flow +import React from "react"; + +type Props = { + label: string, + action: () => void +}; + +class NavAction extends React.Component { + render() { + const { label, action } = this.props; + return ( +
  • + {label} +
  • + ); + } +} + +export default NavAction; diff --git a/scm-ui/src/components/navigation/NavLink.js b/scm-ui/src/components/navigation/NavLink.js new file mode 100644 index 0000000000..3a90fd1fc6 --- /dev/null +++ b/scm-ui/src/components/navigation/NavLink.js @@ -0,0 +1,37 @@ +//@flow +import * as React from "react"; +import { Route, Link } from "react-router-dom"; + +// TODO mostly copy of PrimaryNavigationLink + +type Props = { + to: string, + label: string, + activeOnlyWhenExact?: boolean +}; + +class NavLink extends React.Component { + static defaultProps = { + activeOnlyWhenExact: true + }; + + renderLink = (route: any) => { + const { to, label } = this.props; + return ( +
  • + + {label} + +
  • + ); + }; + + render() { + const { to, activeOnlyWhenExact } = this.props; + return ( + + ); + } +} + +export default NavLink; diff --git a/scm-ui/src/components/navigation/Navigation.js b/scm-ui/src/components/navigation/Navigation.js new file mode 100644 index 0000000000..2b9e85a2c5 --- /dev/null +++ b/scm-ui/src/components/navigation/Navigation.js @@ -0,0 +1,14 @@ +//@flow +import * as React from "react"; + +type Props = { + children?: React.Node +}; + +class Navigation extends React.Component { + render() { + return ; + } +} + +export default Navigation; diff --git a/scm-ui/src/components/navigation/PrimaryNavigation.js b/scm-ui/src/components/navigation/PrimaryNavigation.js new file mode 100644 index 0000000000..4fff895d90 --- /dev/null +++ b/scm-ui/src/components/navigation/PrimaryNavigation.js @@ -0,0 +1,36 @@ +//@flow +import React from "react"; +import { translate } from "react-i18next"; +import PrimaryNavigationLink from "./PrimaryNavigationLink"; + +type Props = { + t: string => string +}; + +class PrimaryNavigation extends React.Component { + render() { + const { t } = this.props; + return ( + + ); + } +} + +export default translate("commons")(PrimaryNavigation); diff --git a/scm-ui/src/components/navigation/PrimaryNavigationLink.js b/scm-ui/src/components/navigation/PrimaryNavigationLink.js new file mode 100644 index 0000000000..217a6c9478 --- /dev/null +++ b/scm-ui/src/components/navigation/PrimaryNavigationLink.js @@ -0,0 +1,35 @@ +//@flow +import * as React from "react"; +import { Route, Link } from "react-router-dom"; + +type Props = { + to: string, + label: string, + match?: string, + activeOnlyWhenExact?: boolean +}; + +class PrimaryNavigationLink extends React.Component { + renderLink = (route: any) => { + const { to, label } = this.props; + return ( +
  • + {label} +
  • + ); + }; + + render() { + const { to, match, activeOnlyWhenExact } = this.props; + const path = match ? match : to; + return ( + + ); + } +} + +export default PrimaryNavigationLink; diff --git a/scm-ui/src/components/navigation/Section.js b/scm-ui/src/components/navigation/Section.js new file mode 100644 index 0000000000..58339529e5 --- /dev/null +++ b/scm-ui/src/components/navigation/Section.js @@ -0,0 +1,21 @@ +//@flow +import * as React from "react"; + +type Props = { + label: string, + children?: React.Node +}; + +class Section extends React.Component { + render() { + const { label, children } = this.props; + return ( +
    +

    {label}

    +
      {children}
    +
    + ); + } +} + +export default Section; diff --git a/scm-ui/src/components/navigation/index.js b/scm-ui/src/components/navigation/index.js new file mode 100644 index 0000000000..822f0f8a1e --- /dev/null +++ b/scm-ui/src/components/navigation/index.js @@ -0,0 +1,8 @@ +//primary Navigation +export { default as PrimaryNavigation } from "./PrimaryNavigation"; +export { default as PrimaryNavigationLink } from "./PrimaryNavigationLink"; +//secondary Navigation +export { default as Navigation } from "./Navigation"; +export { default as Section } from "./Section"; +export { default as NavLink } from "./NavLink"; +export { default as NavAction } from "./NavAction"; diff --git a/scm-ui/src/containers/App.css b/scm-ui/src/containers/App.css new file mode 100644 index 0000000000..a2714191ff --- /dev/null +++ b/scm-ui/src/containers/App.css @@ -0,0 +1,6439 @@ +.is-ellipsis-overflow { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } + +.has-rounded-border { + border-radius: 0.25rem; } + +.is-full-width { + width: 100%; } + +.fitParent { + margin: 0 !important; + padding: 0 0 0 3.8em !important; } + +html, body { + background-color: whitesmoke; + height: 100%; } + +/*! bulma.io v0.7.1 | MIT License | github.com/jgthms/bulma */ +@keyframes spinAround { + from { + transform: rotate(0deg); } + to { + transform: rotate(359deg); } } + +.delete, .modal-close, .is-unselectable, .button, .file, .breadcrumb, .pagination-previous, +.pagination-next, +.pagination-link, +.pagination-ellipsis, .tabs { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + +.select:not(.is-multiple):not(.is-loading)::after, .navbar-link::after { + border: 3px solid transparent; + border-radius: 2px; + border-right: 0; + border-top: 0; + content: " "; + display: block; + height: 0.625em; + margin-top: -0.4375em; + pointer-events: none; + position: absolute; + top: 50%; + transform: rotate(-45deg); + transform-origin: center; + width: 0.625em; } + +.box:not(:last-child), .content:not(:last-child), .notification:not(:last-child), .progress:not(:last-child), .table:not(:last-child), .table-container:not(:last-child), .title:not(:last-child), +.subtitle:not(:last-child), .block:not(:last-child), .highlight:not(:last-child), .breadcrumb:not(:last-child), .level:not(:last-child), .message:not(:last-child), .tabs:not(:last-child) { + margin-bottom: 1.5rem; } + +.delete, .modal-close { + -moz-appearance: none; + -webkit-appearance: none; + background-color: rgba(10, 10, 10, 0.2); + border: none; + border-radius: 290486px; + cursor: pointer; + display: inline-block; + flex-grow: 0; + flex-shrink: 0; + font-size: 0; + height: 20px; + max-height: 20px; + max-width: 20px; + min-height: 20px; + min-width: 20px; + outline: none; + position: relative; + vertical-align: top; + width: 20px; } + .delete::before, .modal-close::before, .delete::after, .modal-close::after { + background-color: white; + content: ""; + display: block; + left: 50%; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%) rotate(45deg); + transform-origin: center center; } + .delete::before, .modal-close::before { + height: 2px; + width: 50%; } + .delete::after, .modal-close::after { + height: 50%; + width: 2px; } + .delete:hover, .modal-close:hover, .delete:focus, .modal-close:focus { + background-color: rgba(10, 10, 10, 0.3); } + .delete:active, .modal-close:active { + background-color: rgba(10, 10, 10, 0.4); } + .is-small.delete, .is-small.modal-close { + height: 16px; + max-height: 16px; + max-width: 16px; + min-height: 16px; + min-width: 16px; + width: 16px; } + .is-medium.delete, .is-medium.modal-close { + height: 24px; + max-height: 24px; + max-width: 24px; + min-height: 24px; + min-width: 24px; + width: 24px; } + .is-large.delete, .is-large.modal-close { + height: 32px; + max-height: 32px; + max-width: 32px; + min-height: 32px; + min-width: 32px; + width: 32px; } + +.button.is-loading::after, .select.is-loading::after, .control.is-loading::after, .loader { + animation: spinAround 500ms infinite linear; + border: 2px solid #dbdbdb; + border-radius: 290486px; + border-right-color: transparent; + border-top-color: transparent; + content: ""; + display: block; + height: 1em; + position: relative; + width: 1em; } + +.is-overlay, .image.is-square img, .image.is-1by1 img, .image.is-5by4 img, .image.is-4by3 img, .image.is-3by2 img, .image.is-5by3 img, .image.is-16by9 img, .image.is-2by1 img, .image.is-3by1 img, .image.is-4by5 img, .image.is-3by4 img, .image.is-2by3 img, .image.is-3by5 img, .image.is-9by16 img, .image.is-1by2 img, .image.is-1by3 img, .modal, .modal-background, .hero-video { + bottom: 0; + left: 0; + position: absolute; + right: 0; + top: 0; } + +.button, .input, +.textarea, .select select, .file-cta, +.file-name, .pagination-previous, +.pagination-next, +.pagination-link, +.pagination-ellipsis { + -moz-appearance: none; + -webkit-appearance: none; + align-items: center; + border: 1px solid transparent; + border-radius: 4px; + box-shadow: none; + display: inline-flex; + font-size: 1rem; + height: 2.25em; + justify-content: flex-start; + line-height: 1.5; + padding-bottom: calc(0.375em - 1px); + padding-left: calc(0.625em - 1px); + padding-right: calc(0.625em - 1px); + padding-top: calc(0.375em - 1px); + position: relative; + vertical-align: top; } + .button:focus, .input:focus, + .textarea:focus, .select select:focus, .file-cta:focus, + .file-name:focus, .pagination-previous:focus, + .pagination-next:focus, + .pagination-link:focus, + .pagination-ellipsis:focus, .is-focused.button, .is-focused.input, + .is-focused.textarea, .select select.is-focused, .is-focused.file-cta, + .is-focused.file-name, .is-focused.pagination-previous, + .is-focused.pagination-next, + .is-focused.pagination-link, + .is-focused.pagination-ellipsis, .button:active, .input:active, + .textarea:active, .select select:active, .file-cta:active, + .file-name:active, .pagination-previous:active, + .pagination-next:active, + .pagination-link:active, + .pagination-ellipsis:active, .is-active.button, .is-active.input, + .is-active.textarea, .select select.is-active, .is-active.file-cta, + .is-active.file-name, .is-active.pagination-previous, + .is-active.pagination-next, + .is-active.pagination-link, + .is-active.pagination-ellipsis { + outline: none; } + .button[disabled], .input[disabled], + .textarea[disabled], .select select[disabled], .file-cta[disabled], + .file-name[disabled], .pagination-previous[disabled], + .pagination-next[disabled], + .pagination-link[disabled], + .pagination-ellipsis[disabled] { + cursor: not-allowed; } + +/*! minireset.css v0.0.3 | MIT License | github.com/jgthms/minireset.css */ +html, +body, +p, +ol, +ul, +li, +dl, +dt, +dd, +blockquote, +figure, +fieldset, +legend, +textarea, +pre, +iframe, +hr, +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 0; + padding: 0; } + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: 100%; + font-weight: normal; } + +ul { + list-style: none; } + +button, +input, +select, +textarea { + margin: 0; } + +html { + box-sizing: border-box; } + +*, *::before, *::after { + box-sizing: inherit; } + +img, +audio, +video { + height: auto; + max-width: 100%; } + +iframe { + border: 0; } + +table { + border-collapse: collapse; + border-spacing: 0; } + +td, +th { + padding: 0; + text-align: left; } + +html { + background-color: white; + font-size: 16px; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + min-width: 300px; + overflow-x: hidden; + overflow-y: scroll; + text-rendering: optimizeLegibility; + text-size-adjust: 100%; } + +article, +aside, +figure, +footer, +header, +hgroup, +section { + display: block; } + +body, +button, +input, +select, +textarea { + font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif; } + +code, +pre { + -moz-osx-font-smoothing: auto; + -webkit-font-smoothing: auto; + font-family: monospace; } + +body { + color: #4a4a4a; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; } + +a { + color: #33B2E8; + cursor: pointer; + text-decoration: none; } + a strong { + color: currentColor; } + a:hover { + color: #363636; } + +code { + background-color: whitesmoke; + color: #ff3860; + font-size: 0.875em; + font-weight: normal; + padding: 0.25em 0.5em 0.25em; } + +hr { + background-color: whitesmoke; + border: none; + display: block; + height: 2px; + margin: 1.5rem 0; } + +img { + height: auto; + max-width: 100%; } + +input[type="checkbox"], +input[type="radio"] { + vertical-align: baseline; } + +small { + font-size: 0.875em; } + +span { + font-style: inherit; + font-weight: inherit; } + +strong { + color: #363636; + font-weight: 700; } + +pre { + -webkit-overflow-scrolling: touch; + background-color: whitesmoke; + color: #4a4a4a; + font-size: 0.875em; + overflow-x: auto; + padding: 1.25rem 1.5rem; + white-space: pre; + word-wrap: normal; } + pre code { + background-color: transparent; + color: currentColor; + font-size: 1em; + padding: 0; } + +table td, +table th { + text-align: left; + vertical-align: top; } + +table th { + color: #363636; } + +.is-clearfix::after { + clear: both; + content: " "; + display: table; } + +.is-pulled-left { + float: left !important; } + +.is-pulled-right { + float: right !important; } + +.is-clipped { + overflow: hidden !important; } + +.is-size-1 { + font-size: 3rem !important; } + +.is-size-2 { + font-size: 2.5rem !important; } + +.is-size-3 { + font-size: 2rem !important; } + +.is-size-4 { + font-size: 1.5rem !important; } + +.is-size-5 { + font-size: 1.25rem !important; } + +.is-size-6 { + font-size: 1rem !important; } + +.is-size-7 { + font-size: 0.75rem !important; } + +@media screen and (max-width: 768px) { + .is-size-1-mobile { + font-size: 3rem !important; } + .is-size-2-mobile { + font-size: 2.5rem !important; } + .is-size-3-mobile { + font-size: 2rem !important; } + .is-size-4-mobile { + font-size: 1.5rem !important; } + .is-size-5-mobile { + font-size: 1.25rem !important; } + .is-size-6-mobile { + font-size: 1rem !important; } + .is-size-7-mobile { + font-size: 0.75rem !important; } } + +@media screen and (min-width: 769px), print { + .is-size-1-tablet { + font-size: 3rem !important; } + .is-size-2-tablet { + font-size: 2.5rem !important; } + .is-size-3-tablet { + font-size: 2rem !important; } + .is-size-4-tablet { + font-size: 1.5rem !important; } + .is-size-5-tablet { + font-size: 1.25rem !important; } + .is-size-6-tablet { + font-size: 1rem !important; } + .is-size-7-tablet { + font-size: 0.75rem !important; } } + +@media screen and (max-width: 1087px) { + .is-size-1-touch { + font-size: 3rem !important; } + .is-size-2-touch { + font-size: 2.5rem !important; } + .is-size-3-touch { + font-size: 2rem !important; } + .is-size-4-touch { + font-size: 1.5rem !important; } + .is-size-5-touch { + font-size: 1.25rem !important; } + .is-size-6-touch { + font-size: 1rem !important; } + .is-size-7-touch { + font-size: 0.75rem !important; } } + +@media screen and (min-width: 1088px) { + .is-size-1-desktop { + font-size: 3rem !important; } + .is-size-2-desktop { + font-size: 2.5rem !important; } + .is-size-3-desktop { + font-size: 2rem !important; } + .is-size-4-desktop { + font-size: 1.5rem !important; } + .is-size-5-desktop { + font-size: 1.25rem !important; } + .is-size-6-desktop { + font-size: 1rem !important; } + .is-size-7-desktop { + font-size: 0.75rem !important; } } + +@media screen and (min-width: 1280px) { + .is-size-1-widescreen { + font-size: 3rem !important; } + .is-size-2-widescreen { + font-size: 2.5rem !important; } + .is-size-3-widescreen { + font-size: 2rem !important; } + .is-size-4-widescreen { + font-size: 1.5rem !important; } + .is-size-5-widescreen { + font-size: 1.25rem !important; } + .is-size-6-widescreen { + font-size: 1rem !important; } + .is-size-7-widescreen { + font-size: 0.75rem !important; } } + +@media screen and (min-width: 1472px) { + .is-size-1-fullhd { + font-size: 3rem !important; } + .is-size-2-fullhd { + font-size: 2.5rem !important; } + .is-size-3-fullhd { + font-size: 2rem !important; } + .is-size-4-fullhd { + font-size: 1.5rem !important; } + .is-size-5-fullhd { + font-size: 1.25rem !important; } + .is-size-6-fullhd { + font-size: 1rem !important; } + .is-size-7-fullhd { + font-size: 0.75rem !important; } } + +.has-text-centered { + text-align: center !important; } + +.has-text-justified { + text-align: justify !important; } + +.has-text-left { + text-align: left !important; } + +.has-text-right { + text-align: right !important; } + +@media screen and (max-width: 768px) { + .has-text-centered-mobile { + text-align: center !important; } } + +@media screen and (min-width: 769px), print { + .has-text-centered-tablet { + text-align: center !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .has-text-centered-tablet-only { + text-align: center !important; } } + +@media screen and (max-width: 1087px) { + .has-text-centered-touch { + text-align: center !important; } } + +@media screen and (min-width: 1088px) { + .has-text-centered-desktop { + text-align: center !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .has-text-centered-desktop-only { + text-align: center !important; } } + +@media screen and (min-width: 1280px) { + .has-text-centered-widescreen { + text-align: center !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .has-text-centered-widescreen-only { + text-align: center !important; } } + +@media screen and (min-width: 1472px) { + .has-text-centered-fullhd { + text-align: center !important; } } + +@media screen and (max-width: 768px) { + .has-text-justified-mobile { + text-align: justify !important; } } + +@media screen and (min-width: 769px), print { + .has-text-justified-tablet { + text-align: justify !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .has-text-justified-tablet-only { + text-align: justify !important; } } + +@media screen and (max-width: 1087px) { + .has-text-justified-touch { + text-align: justify !important; } } + +@media screen and (min-width: 1088px) { + .has-text-justified-desktop { + text-align: justify !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .has-text-justified-desktop-only { + text-align: justify !important; } } + +@media screen and (min-width: 1280px) { + .has-text-justified-widescreen { + text-align: justify !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .has-text-justified-widescreen-only { + text-align: justify !important; } } + +@media screen and (min-width: 1472px) { + .has-text-justified-fullhd { + text-align: justify !important; } } + +@media screen and (max-width: 768px) { + .has-text-left-mobile { + text-align: left !important; } } + +@media screen and (min-width: 769px), print { + .has-text-left-tablet { + text-align: left !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .has-text-left-tablet-only { + text-align: left !important; } } + +@media screen and (max-width: 1087px) { + .has-text-left-touch { + text-align: left !important; } } + +@media screen and (min-width: 1088px) { + .has-text-left-desktop { + text-align: left !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .has-text-left-desktop-only { + text-align: left !important; } } + +@media screen and (min-width: 1280px) { + .has-text-left-widescreen { + text-align: left !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .has-text-left-widescreen-only { + text-align: left !important; } } + +@media screen and (min-width: 1472px) { + .has-text-left-fullhd { + text-align: left !important; } } + +@media screen and (max-width: 768px) { + .has-text-right-mobile { + text-align: right !important; } } + +@media screen and (min-width: 769px), print { + .has-text-right-tablet { + text-align: right !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .has-text-right-tablet-only { + text-align: right !important; } } + +@media screen and (max-width: 1087px) { + .has-text-right-touch { + text-align: right !important; } } + +@media screen and (min-width: 1088px) { + .has-text-right-desktop { + text-align: right !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .has-text-right-desktop-only { + text-align: right !important; } } + +@media screen and (min-width: 1280px) { + .has-text-right-widescreen { + text-align: right !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .has-text-right-widescreen-only { + text-align: right !important; } } + +@media screen and (min-width: 1472px) { + .has-text-right-fullhd { + text-align: right !important; } } + +.is-capitalized { + text-transform: capitalize !important; } + +.is-lowercase { + text-transform: lowercase !important; } + +.is-uppercase { + text-transform: uppercase !important; } + +.is-italic { + font-style: italic !important; } + +.has-text-white { + color: white !important; } + +a.has-text-white:hover, a.has-text-white:focus { + color: #e6e6e6 !important; } + +.has-background-white { + background-color: white !important; } + +.has-text-black { + color: #0a0a0a !important; } + +a.has-text-black:hover, a.has-text-black:focus { + color: black !important; } + +.has-background-black { + background-color: #0a0a0a !important; } + +.has-text-light { + color: whitesmoke !important; } + +a.has-text-light:hover, a.has-text-light:focus { + color: #dbdbdb !important; } + +.has-background-light { + background-color: whitesmoke !important; } + +.has-text-dark { + color: #363636 !important; } + +a.has-text-dark:hover, a.has-text-dark:focus { + color: #1c1c1c !important; } + +.has-background-dark { + background-color: #363636 !important; } + +.has-text-primary { + color: #00d1b2 !important; } + +a.has-text-primary:hover, a.has-text-primary:focus { + color: #009e86 !important; } + +.has-background-primary { + background-color: #00d1b2 !important; } + +.has-text-link { + color: #33B2E8 !important; } + +a.has-text-link:hover, a.has-text-link:focus { + color: #1899d0 !important; } + +.has-background-link { + background-color: #33B2E8 !important; } + +.has-text-info { + color: #209cee !important; } + +a.has-text-info:hover, a.has-text-info:focus { + color: #0f81cc !important; } + +.has-background-info { + background-color: #209cee !important; } + +.has-text-success { + color: #23d160 !important; } + +a.has-text-success:hover, a.has-text-success:focus { + color: #1ca64c !important; } + +.has-background-success { + background-color: #23d160 !important; } + +.has-text-warning { + color: #ffdd57 !important; } + +a.has-text-warning:hover, a.has-text-warning:focus { + color: #ffd324 !important; } + +.has-background-warning { + background-color: #ffdd57 !important; } + +.has-text-danger { + color: #ff3860 !important; } + +a.has-text-danger:hover, a.has-text-danger:focus { + color: #ff0537 !important; } + +.has-background-danger { + background-color: #ff3860 !important; } + +.has-text-black-bis { + color: #121212 !important; } + +.has-background-black-bis { + background-color: #121212 !important; } + +.has-text-black-ter { + color: #242424 !important; } + +.has-background-black-ter { + background-color: #242424 !important; } + +.has-text-grey-darker { + color: #363636 !important; } + +.has-background-grey-darker { + background-color: #363636 !important; } + +.has-text-grey-dark { + color: #4a4a4a !important; } + +.has-background-grey-dark { + background-color: #4a4a4a !important; } + +.has-text-grey { + color: #7a7a7a !important; } + +.has-background-grey { + background-color: #7a7a7a !important; } + +.has-text-grey-light { + color: #b5b5b5 !important; } + +.has-background-grey-light { + background-color: #b5b5b5 !important; } + +.has-text-grey-lighter { + color: #dbdbdb !important; } + +.has-background-grey-lighter { + background-color: #dbdbdb !important; } + +.has-text-white-ter { + color: whitesmoke !important; } + +.has-background-white-ter { + background-color: whitesmoke !important; } + +.has-text-white-bis { + color: #fafafa !important; } + +.has-background-white-bis { + background-color: #fafafa !important; } + +.has-text-weight-light { + font-weight: 300 !important; } + +.has-text-weight-normal { + font-weight: 400 !important; } + +.has-text-weight-semibold { + font-weight: 600 !important; } + +.has-text-weight-bold { + font-weight: 700 !important; } + +.is-block { + display: block !important; } + +@media screen and (max-width: 768px) { + .is-block-mobile { + display: block !important; } } + +@media screen and (min-width: 769px), print { + .is-block-tablet { + display: block !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .is-block-tablet-only { + display: block !important; } } + +@media screen and (max-width: 1087px) { + .is-block-touch { + display: block !important; } } + +@media screen and (min-width: 1088px) { + .is-block-desktop { + display: block !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .is-block-desktop-only { + display: block !important; } } + +@media screen and (min-width: 1280px) { + .is-block-widescreen { + display: block !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .is-block-widescreen-only { + display: block !important; } } + +@media screen and (min-width: 1472px) { + .is-block-fullhd { + display: block !important; } } + +.is-flex { + display: flex !important; } + +@media screen and (max-width: 768px) { + .is-flex-mobile { + display: flex !important; } } + +@media screen and (min-width: 769px), print { + .is-flex-tablet { + display: flex !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .is-flex-tablet-only { + display: flex !important; } } + +@media screen and (max-width: 1087px) { + .is-flex-touch { + display: flex !important; } } + +@media screen and (min-width: 1088px) { + .is-flex-desktop { + display: flex !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .is-flex-desktop-only { + display: flex !important; } } + +@media screen and (min-width: 1280px) { + .is-flex-widescreen { + display: flex !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .is-flex-widescreen-only { + display: flex !important; } } + +@media screen and (min-width: 1472px) { + .is-flex-fullhd { + display: flex !important; } } + +.is-inline { + display: inline !important; } + +@media screen and (max-width: 768px) { + .is-inline-mobile { + display: inline !important; } } + +@media screen and (min-width: 769px), print { + .is-inline-tablet { + display: inline !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .is-inline-tablet-only { + display: inline !important; } } + +@media screen and (max-width: 1087px) { + .is-inline-touch { + display: inline !important; } } + +@media screen and (min-width: 1088px) { + .is-inline-desktop { + display: inline !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .is-inline-desktop-only { + display: inline !important; } } + +@media screen and (min-width: 1280px) { + .is-inline-widescreen { + display: inline !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .is-inline-widescreen-only { + display: inline !important; } } + +@media screen and (min-width: 1472px) { + .is-inline-fullhd { + display: inline !important; } } + +.is-inline-block { + display: inline-block !important; } + +@media screen and (max-width: 768px) { + .is-inline-block-mobile { + display: inline-block !important; } } + +@media screen and (min-width: 769px), print { + .is-inline-block-tablet { + display: inline-block !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .is-inline-block-tablet-only { + display: inline-block !important; } } + +@media screen and (max-width: 1087px) { + .is-inline-block-touch { + display: inline-block !important; } } + +@media screen and (min-width: 1088px) { + .is-inline-block-desktop { + display: inline-block !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .is-inline-block-desktop-only { + display: inline-block !important; } } + +@media screen and (min-width: 1280px) { + .is-inline-block-widescreen { + display: inline-block !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .is-inline-block-widescreen-only { + display: inline-block !important; } } + +@media screen and (min-width: 1472px) { + .is-inline-block-fullhd { + display: inline-block !important; } } + +.is-inline-flex { + display: inline-flex !important; } + +@media screen and (max-width: 768px) { + .is-inline-flex-mobile { + display: inline-flex !important; } } + +@media screen and (min-width: 769px), print { + .is-inline-flex-tablet { + display: inline-flex !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .is-inline-flex-tablet-only { + display: inline-flex !important; } } + +@media screen and (max-width: 1087px) { + .is-inline-flex-touch { + display: inline-flex !important; } } + +@media screen and (min-width: 1088px) { + .is-inline-flex-desktop { + display: inline-flex !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .is-inline-flex-desktop-only { + display: inline-flex !important; } } + +@media screen and (min-width: 1280px) { + .is-inline-flex-widescreen { + display: inline-flex !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .is-inline-flex-widescreen-only { + display: inline-flex !important; } } + +@media screen and (min-width: 1472px) { + .is-inline-flex-fullhd { + display: inline-flex !important; } } + +.is-hidden { + display: none !important; } + +@media screen and (max-width: 768px) { + .is-hidden-mobile { + display: none !important; } } + +@media screen and (min-width: 769px), print { + .is-hidden-tablet { + display: none !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .is-hidden-tablet-only { + display: none !important; } } + +@media screen and (max-width: 1087px) { + .is-hidden-touch { + display: none !important; } } + +@media screen and (min-width: 1088px) { + .is-hidden-desktop { + display: none !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .is-hidden-desktop-only { + display: none !important; } } + +@media screen and (min-width: 1280px) { + .is-hidden-widescreen { + display: none !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .is-hidden-widescreen-only { + display: none !important; } } + +@media screen and (min-width: 1472px) { + .is-hidden-fullhd { + display: none !important; } } + +.is-invisible { + visibility: hidden !important; } + +@media screen and (max-width: 768px) { + .is-invisible-mobile { + visibility: hidden !important; } } + +@media screen and (min-width: 769px), print { + .is-invisible-tablet { + visibility: hidden !important; } } + +@media screen and (min-width: 769px) and (max-width: 1087px) { + .is-invisible-tablet-only { + visibility: hidden !important; } } + +@media screen and (max-width: 1087px) { + .is-invisible-touch { + visibility: hidden !important; } } + +@media screen and (min-width: 1088px) { + .is-invisible-desktop { + visibility: hidden !important; } } + +@media screen and (min-width: 1088px) and (max-width: 1279px) { + .is-invisible-desktop-only { + visibility: hidden !important; } } + +@media screen and (min-width: 1280px) { + .is-invisible-widescreen { + visibility: hidden !important; } } + +@media screen and (min-width: 1280px) and (max-width: 1471px) { + .is-invisible-widescreen-only { + visibility: hidden !important; } } + +@media screen and (min-width: 1472px) { + .is-invisible-fullhd { + visibility: hidden !important; } } + +.is-marginless { + margin: 0 !important; } + +.is-paddingless { + padding: 0 !important; } + +.is-radiusless { + border-radius: 0 !important; } + +.is-shadowless { + box-shadow: none !important; } + +.box { + background-color: white; + border-radius: 6px; + box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1); + color: #4a4a4a; + display: block; + padding: 1.25rem; } + +a.box:hover, a.box:focus { + box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px #33B2E8; } + +a.box:active { + box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2), 0 0 0 1px #33B2E8; } + +.button { + background-color: white; + border-color: #dbdbdb; + border-width: 1px; + color: #363636; + cursor: pointer; + justify-content: center; + padding-bottom: calc(0.375em - 1px); + padding-left: 0.75em; + padding-right: 0.75em; + padding-top: calc(0.375em - 1px); + text-align: center; + white-space: nowrap; } + .button strong { + color: inherit; } + .button .icon, .button .icon.is-small, .button .icon.is-medium, .button .icon.is-large { + height: 1.5em; + width: 1.5em; } + .button .icon:first-child:not(:last-child) { + margin-left: calc(-0.375em - 1px); + margin-right: 0.1875em; } + .button .icon:last-child:not(:first-child) { + margin-left: 0.1875em; + margin-right: calc(-0.375em - 1px); } + .button .icon:first-child:last-child { + margin-left: calc(-0.375em - 1px); + margin-right: calc(-0.375em - 1px); } + .button:hover, .button.is-hovered { + border-color: #b5b5b5; + color: #363636; } + .button:focus, .button.is-focused { + border-color: #33B2E8; + color: #363636; } + .button:focus:not(:active), .button.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(51, 178, 232, 0.25); } + .button:active, .button.is-active { + border-color: #4a4a4a; + color: #363636; } + .button.is-text { + background-color: transparent; + border-color: transparent; + color: #4a4a4a; + text-decoration: underline; } + .button.is-text:hover, .button.is-text.is-hovered, .button.is-text:focus, .button.is-text.is-focused { + background-color: whitesmoke; + color: #363636; } + .button.is-text:active, .button.is-text.is-active { + background-color: #e8e8e8; + color: #363636; } + .button.is-text[disabled] { + background-color: transparent; + border-color: transparent; + box-shadow: none; } + .button.is-white { + background-color: white; + border-color: transparent; + color: #0a0a0a; } + .button.is-white:hover, .button.is-white.is-hovered { + background-color: #f9f9f9; + border-color: transparent; + color: #0a0a0a; } + .button.is-white:focus, .button.is-white.is-focused { + border-color: transparent; + color: #0a0a0a; } + .button.is-white:focus:not(:active), .button.is-white.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(255, 255, 255, 0.25); } + .button.is-white:active, .button.is-white.is-active { + background-color: #f2f2f2; + border-color: transparent; + color: #0a0a0a; } + .button.is-white[disabled] { + background-color: white; + border-color: transparent; + box-shadow: none; } + .button.is-white.is-inverted { + background-color: #0a0a0a; + color: white; } + .button.is-white.is-inverted:hover { + background-color: black; } + .button.is-white.is-inverted[disabled] { + background-color: #0a0a0a; + border-color: transparent; + box-shadow: none; + color: white; } + .button.is-white.is-loading::after { + border-color: transparent transparent #0a0a0a #0a0a0a !important; } + .button.is-white.is-outlined { + background-color: transparent; + border-color: white; + color: white; } + .button.is-white.is-outlined:hover, .button.is-white.is-outlined:focus { + background-color: white; + border-color: white; + color: #0a0a0a; } + .button.is-white.is-outlined.is-loading::after { + border-color: transparent transparent white white !important; } + .button.is-white.is-outlined[disabled] { + background-color: transparent; + border-color: white; + box-shadow: none; + color: white; } + .button.is-white.is-inverted.is-outlined { + background-color: transparent; + border-color: #0a0a0a; + color: #0a0a0a; } + .button.is-white.is-inverted.is-outlined:hover, .button.is-white.is-inverted.is-outlined:focus { + background-color: #0a0a0a; + color: white; } + .button.is-white.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: #0a0a0a; + box-shadow: none; + color: #0a0a0a; } + .button.is-black { + background-color: #0a0a0a; + border-color: transparent; + color: white; } + .button.is-black:hover, .button.is-black.is-hovered { + background-color: #040404; + border-color: transparent; + color: white; } + .button.is-black:focus, .button.is-black.is-focused { + border-color: transparent; + color: white; } + .button.is-black:focus:not(:active), .button.is-black.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(10, 10, 10, 0.25); } + .button.is-black:active, .button.is-black.is-active { + background-color: black; + border-color: transparent; + color: white; } + .button.is-black[disabled] { + background-color: #0a0a0a; + border-color: transparent; + box-shadow: none; } + .button.is-black.is-inverted { + background-color: white; + color: #0a0a0a; } + .button.is-black.is-inverted:hover { + background-color: #f2f2f2; } + .button.is-black.is-inverted[disabled] { + background-color: white; + border-color: transparent; + box-shadow: none; + color: #0a0a0a; } + .button.is-black.is-loading::after { + border-color: transparent transparent white white !important; } + .button.is-black.is-outlined { + background-color: transparent; + border-color: #0a0a0a; + color: #0a0a0a; } + .button.is-black.is-outlined:hover, .button.is-black.is-outlined:focus { + background-color: #0a0a0a; + border-color: #0a0a0a; + color: white; } + .button.is-black.is-outlined.is-loading::after { + border-color: transparent transparent #0a0a0a #0a0a0a !important; } + .button.is-black.is-outlined[disabled] { + background-color: transparent; + border-color: #0a0a0a; + box-shadow: none; + color: #0a0a0a; } + .button.is-black.is-inverted.is-outlined { + background-color: transparent; + border-color: white; + color: white; } + .button.is-black.is-inverted.is-outlined:hover, .button.is-black.is-inverted.is-outlined:focus { + background-color: white; + color: #0a0a0a; } + .button.is-black.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: white; + box-shadow: none; + color: white; } + .button.is-light { + background-color: whitesmoke; + border-color: transparent; + color: #363636; } + .button.is-light:hover, .button.is-light.is-hovered { + background-color: #eeeeee; + border-color: transparent; + color: #363636; } + .button.is-light:focus, .button.is-light.is-focused { + border-color: transparent; + color: #363636; } + .button.is-light:focus:not(:active), .button.is-light.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(245, 245, 245, 0.25); } + .button.is-light:active, .button.is-light.is-active { + background-color: #e8e8e8; + border-color: transparent; + color: #363636; } + .button.is-light[disabled] { + background-color: whitesmoke; + border-color: transparent; + box-shadow: none; } + .button.is-light.is-inverted { + background-color: #363636; + color: whitesmoke; } + .button.is-light.is-inverted:hover { + background-color: #292929; } + .button.is-light.is-inverted[disabled] { + background-color: #363636; + border-color: transparent; + box-shadow: none; + color: whitesmoke; } + .button.is-light.is-loading::after { + border-color: transparent transparent #363636 #363636 !important; } + .button.is-light.is-outlined { + background-color: transparent; + border-color: whitesmoke; + color: whitesmoke; } + .button.is-light.is-outlined:hover, .button.is-light.is-outlined:focus { + background-color: whitesmoke; + border-color: whitesmoke; + color: #363636; } + .button.is-light.is-outlined.is-loading::after { + border-color: transparent transparent whitesmoke whitesmoke !important; } + .button.is-light.is-outlined[disabled] { + background-color: transparent; + border-color: whitesmoke; + box-shadow: none; + color: whitesmoke; } + .button.is-light.is-inverted.is-outlined { + background-color: transparent; + border-color: #363636; + color: #363636; } + .button.is-light.is-inverted.is-outlined:hover, .button.is-light.is-inverted.is-outlined:focus { + background-color: #363636; + color: whitesmoke; } + .button.is-light.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: #363636; + box-shadow: none; + color: #363636; } + .button.is-dark { + background-color: #363636; + border-color: transparent; + color: whitesmoke; } + .button.is-dark:hover, .button.is-dark.is-hovered { + background-color: #2f2f2f; + border-color: transparent; + color: whitesmoke; } + .button.is-dark:focus, .button.is-dark.is-focused { + border-color: transparent; + color: whitesmoke; } + .button.is-dark:focus:not(:active), .button.is-dark.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(54, 54, 54, 0.25); } + .button.is-dark:active, .button.is-dark.is-active { + background-color: #292929; + border-color: transparent; + color: whitesmoke; } + .button.is-dark[disabled] { + background-color: #363636; + border-color: transparent; + box-shadow: none; } + .button.is-dark.is-inverted { + background-color: whitesmoke; + color: #363636; } + .button.is-dark.is-inverted:hover { + background-color: #e8e8e8; } + .button.is-dark.is-inverted[disabled] { + background-color: whitesmoke; + border-color: transparent; + box-shadow: none; + color: #363636; } + .button.is-dark.is-loading::after { + border-color: transparent transparent whitesmoke whitesmoke !important; } + .button.is-dark.is-outlined { + background-color: transparent; + border-color: #363636; + color: #363636; } + .button.is-dark.is-outlined:hover, .button.is-dark.is-outlined:focus { + background-color: #363636; + border-color: #363636; + color: whitesmoke; } + .button.is-dark.is-outlined.is-loading::after { + border-color: transparent transparent #363636 #363636 !important; } + .button.is-dark.is-outlined[disabled] { + background-color: transparent; + border-color: #363636; + box-shadow: none; + color: #363636; } + .button.is-dark.is-inverted.is-outlined { + background-color: transparent; + border-color: whitesmoke; + color: whitesmoke; } + .button.is-dark.is-inverted.is-outlined:hover, .button.is-dark.is-inverted.is-outlined:focus { + background-color: whitesmoke; + color: #363636; } + .button.is-dark.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: whitesmoke; + box-shadow: none; + color: whitesmoke; } + .button.is-primary { + background-color: #00d1b2; + border-color: transparent; + color: #fff; } + .button.is-primary:hover, .button.is-primary.is-hovered { + background-color: #00c4a7; + border-color: transparent; + color: #fff; } + .button.is-primary:focus, .button.is-primary.is-focused { + border-color: transparent; + color: #fff; } + .button.is-primary:focus:not(:active), .button.is-primary.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(0, 209, 178, 0.25); } + .button.is-primary:active, .button.is-primary.is-active { + background-color: #00b89c; + border-color: transparent; + color: #fff; } + .button.is-primary[disabled] { + background-color: #00d1b2; + border-color: transparent; + box-shadow: none; } + .button.is-primary.is-inverted { + background-color: #fff; + color: #00d1b2; } + .button.is-primary.is-inverted:hover { + background-color: #f2f2f2; } + .button.is-primary.is-inverted[disabled] { + background-color: #fff; + border-color: transparent; + box-shadow: none; + color: #00d1b2; } + .button.is-primary.is-loading::after { + border-color: transparent transparent #fff #fff !important; } + .button.is-primary.is-outlined { + background-color: transparent; + border-color: #00d1b2; + color: #00d1b2; } + .button.is-primary.is-outlined:hover, .button.is-primary.is-outlined:focus { + background-color: #00d1b2; + border-color: #00d1b2; + color: #fff; } + .button.is-primary.is-outlined.is-loading::after { + border-color: transparent transparent #00d1b2 #00d1b2 !important; } + .button.is-primary.is-outlined[disabled] { + background-color: transparent; + border-color: #00d1b2; + box-shadow: none; + color: #00d1b2; } + .button.is-primary.is-inverted.is-outlined { + background-color: transparent; + border-color: #fff; + color: #fff; } + .button.is-primary.is-inverted.is-outlined:hover, .button.is-primary.is-inverted.is-outlined:focus { + background-color: #fff; + color: #00d1b2; } + .button.is-primary.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: #fff; + box-shadow: none; + color: #fff; } + .button.is-link { + background-color: #33B2E8; + border-color: transparent; + color: #fff; } + .button.is-link:hover, .button.is-link.is-hovered { + background-color: #28aee7; + border-color: transparent; + color: #fff; } + .button.is-link:focus, .button.is-link.is-focused { + border-color: transparent; + color: #fff; } + .button.is-link:focus:not(:active), .button.is-link.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(51, 178, 232, 0.25); } + .button.is-link:active, .button.is-link.is-active { + background-color: #1ca9e5; + border-color: transparent; + color: #fff; } + .button.is-link[disabled] { + background-color: #33B2E8; + border-color: transparent; + box-shadow: none; } + .button.is-link.is-inverted { + background-color: #fff; + color: #33B2E8; } + .button.is-link.is-inverted:hover { + background-color: #f2f2f2; } + .button.is-link.is-inverted[disabled] { + background-color: #fff; + border-color: transparent; + box-shadow: none; + color: #33B2E8; } + .button.is-link.is-loading::after { + border-color: transparent transparent #fff #fff !important; } + .button.is-link.is-outlined { + background-color: transparent; + border-color: #33B2E8; + color: #33B2E8; } + .button.is-link.is-outlined:hover, .button.is-link.is-outlined:focus { + background-color: #33B2E8; + border-color: #33B2E8; + color: #fff; } + .button.is-link.is-outlined.is-loading::after { + border-color: transparent transparent #33B2E8 #33B2E8 !important; } + .button.is-link.is-outlined[disabled] { + background-color: transparent; + border-color: #33B2E8; + box-shadow: none; + color: #33B2E8; } + .button.is-link.is-inverted.is-outlined { + background-color: transparent; + border-color: #fff; + color: #fff; } + .button.is-link.is-inverted.is-outlined:hover, .button.is-link.is-inverted.is-outlined:focus { + background-color: #fff; + color: #33B2E8; } + .button.is-link.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: #fff; + box-shadow: none; + color: #fff; } + .button.is-info { + background-color: #209cee; + border-color: transparent; + color: #fff; } + .button.is-info:hover, .button.is-info.is-hovered { + background-color: #1496ed; + border-color: transparent; + color: #fff; } + .button.is-info:focus, .button.is-info.is-focused { + border-color: transparent; + color: #fff; } + .button.is-info:focus:not(:active), .button.is-info.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(32, 156, 238, 0.25); } + .button.is-info:active, .button.is-info.is-active { + background-color: #118fe4; + border-color: transparent; + color: #fff; } + .button.is-info[disabled] { + background-color: #209cee; + border-color: transparent; + box-shadow: none; } + .button.is-info.is-inverted { + background-color: #fff; + color: #209cee; } + .button.is-info.is-inverted:hover { + background-color: #f2f2f2; } + .button.is-info.is-inverted[disabled] { + background-color: #fff; + border-color: transparent; + box-shadow: none; + color: #209cee; } + .button.is-info.is-loading::after { + border-color: transparent transparent #fff #fff !important; } + .button.is-info.is-outlined { + background-color: transparent; + border-color: #209cee; + color: #209cee; } + .button.is-info.is-outlined:hover, .button.is-info.is-outlined:focus { + background-color: #209cee; + border-color: #209cee; + color: #fff; } + .button.is-info.is-outlined.is-loading::after { + border-color: transparent transparent #209cee #209cee !important; } + .button.is-info.is-outlined[disabled] { + background-color: transparent; + border-color: #209cee; + box-shadow: none; + color: #209cee; } + .button.is-info.is-inverted.is-outlined { + background-color: transparent; + border-color: #fff; + color: #fff; } + .button.is-info.is-inverted.is-outlined:hover, .button.is-info.is-inverted.is-outlined:focus { + background-color: #fff; + color: #209cee; } + .button.is-info.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: #fff; + box-shadow: none; + color: #fff; } + .button.is-success { + background-color: #23d160; + border-color: transparent; + color: #fff; } + .button.is-success:hover, .button.is-success.is-hovered { + background-color: #22c65b; + border-color: transparent; + color: #fff; } + .button.is-success:focus, .button.is-success.is-focused { + border-color: transparent; + color: #fff; } + .button.is-success:focus:not(:active), .button.is-success.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(35, 209, 96, 0.25); } + .button.is-success:active, .button.is-success.is-active { + background-color: #20bc56; + border-color: transparent; + color: #fff; } + .button.is-success[disabled] { + background-color: #23d160; + border-color: transparent; + box-shadow: none; } + .button.is-success.is-inverted { + background-color: #fff; + color: #23d160; } + .button.is-success.is-inverted:hover { + background-color: #f2f2f2; } + .button.is-success.is-inverted[disabled] { + background-color: #fff; + border-color: transparent; + box-shadow: none; + color: #23d160; } + .button.is-success.is-loading::after { + border-color: transparent transparent #fff #fff !important; } + .button.is-success.is-outlined { + background-color: transparent; + border-color: #23d160; + color: #23d160; } + .button.is-success.is-outlined:hover, .button.is-success.is-outlined:focus { + background-color: #23d160; + border-color: #23d160; + color: #fff; } + .button.is-success.is-outlined.is-loading::after { + border-color: transparent transparent #23d160 #23d160 !important; } + .button.is-success.is-outlined[disabled] { + background-color: transparent; + border-color: #23d160; + box-shadow: none; + color: #23d160; } + .button.is-success.is-inverted.is-outlined { + background-color: transparent; + border-color: #fff; + color: #fff; } + .button.is-success.is-inverted.is-outlined:hover, .button.is-success.is-inverted.is-outlined:focus { + background-color: #fff; + color: #23d160; } + .button.is-success.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: #fff; + box-shadow: none; + color: #fff; } + .button.is-warning { + background-color: #ffdd57; + border-color: transparent; + color: rgba(0, 0, 0, 0.7); } + .button.is-warning:hover, .button.is-warning.is-hovered { + background-color: #ffdb4a; + border-color: transparent; + color: rgba(0, 0, 0, 0.7); } + .button.is-warning:focus, .button.is-warning.is-focused { + border-color: transparent; + color: rgba(0, 0, 0, 0.7); } + .button.is-warning:focus:not(:active), .button.is-warning.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(255, 221, 87, 0.25); } + .button.is-warning:active, .button.is-warning.is-active { + background-color: #ffd83d; + border-color: transparent; + color: rgba(0, 0, 0, 0.7); } + .button.is-warning[disabled] { + background-color: #ffdd57; + border-color: transparent; + box-shadow: none; } + .button.is-warning.is-inverted { + background-color: rgba(0, 0, 0, 0.7); + color: #ffdd57; } + .button.is-warning.is-inverted:hover { + background-color: rgba(0, 0, 0, 0.7); } + .button.is-warning.is-inverted[disabled] { + background-color: rgba(0, 0, 0, 0.7); + border-color: transparent; + box-shadow: none; + color: #ffdd57; } + .button.is-warning.is-loading::after { + border-color: transparent transparent rgba(0, 0, 0, 0.7) rgba(0, 0, 0, 0.7) !important; } + .button.is-warning.is-outlined { + background-color: transparent; + border-color: #ffdd57; + color: #ffdd57; } + .button.is-warning.is-outlined:hover, .button.is-warning.is-outlined:focus { + background-color: #ffdd57; + border-color: #ffdd57; + color: rgba(0, 0, 0, 0.7); } + .button.is-warning.is-outlined.is-loading::after { + border-color: transparent transparent #ffdd57 #ffdd57 !important; } + .button.is-warning.is-outlined[disabled] { + background-color: transparent; + border-color: #ffdd57; + box-shadow: none; + color: #ffdd57; } + .button.is-warning.is-inverted.is-outlined { + background-color: transparent; + border-color: rgba(0, 0, 0, 0.7); + color: rgba(0, 0, 0, 0.7); } + .button.is-warning.is-inverted.is-outlined:hover, .button.is-warning.is-inverted.is-outlined:focus { + background-color: rgba(0, 0, 0, 0.7); + color: #ffdd57; } + .button.is-warning.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: rgba(0, 0, 0, 0.7); + box-shadow: none; + color: rgba(0, 0, 0, 0.7); } + .button.is-danger { + background-color: #ff3860; + border-color: transparent; + color: #fff; } + .button.is-danger:hover, .button.is-danger.is-hovered { + background-color: #ff2b56; + border-color: transparent; + color: #fff; } + .button.is-danger:focus, .button.is-danger.is-focused { + border-color: transparent; + color: #fff; } + .button.is-danger:focus:not(:active), .button.is-danger.is-focused:not(:active) { + box-shadow: 0 0 0 0.125em rgba(255, 56, 96, 0.25); } + .button.is-danger:active, .button.is-danger.is-active { + background-color: #ff1f4b; + border-color: transparent; + color: #fff; } + .button.is-danger[disabled] { + background-color: #ff3860; + border-color: transparent; + box-shadow: none; } + .button.is-danger.is-inverted { + background-color: #fff; + color: #ff3860; } + .button.is-danger.is-inverted:hover { + background-color: #f2f2f2; } + .button.is-danger.is-inverted[disabled] { + background-color: #fff; + border-color: transparent; + box-shadow: none; + color: #ff3860; } + .button.is-danger.is-loading::after { + border-color: transparent transparent #fff #fff !important; } + .button.is-danger.is-outlined { + background-color: transparent; + border-color: #ff3860; + color: #ff3860; } + .button.is-danger.is-outlined:hover, .button.is-danger.is-outlined:focus { + background-color: #ff3860; + border-color: #ff3860; + color: #fff; } + .button.is-danger.is-outlined.is-loading::after { + border-color: transparent transparent #ff3860 #ff3860 !important; } + .button.is-danger.is-outlined[disabled] { + background-color: transparent; + border-color: #ff3860; + box-shadow: none; + color: #ff3860; } + .button.is-danger.is-inverted.is-outlined { + background-color: transparent; + border-color: #fff; + color: #fff; } + .button.is-danger.is-inverted.is-outlined:hover, .button.is-danger.is-inverted.is-outlined:focus { + background-color: #fff; + color: #ff3860; } + .button.is-danger.is-inverted.is-outlined[disabled] { + background-color: transparent; + border-color: #fff; + box-shadow: none; + color: #fff; } + .button.is-small { + border-radius: 2px; + font-size: 0.75rem; } + .button.is-medium { + font-size: 1.25rem; } + .button.is-large { + font-size: 1.5rem; } + .button[disabled] { + background-color: white; + border-color: #dbdbdb; + box-shadow: none; + opacity: 0.5; } + .button.is-fullwidth { + display: flex; + width: 100%; } + .button.is-loading { + color: transparent !important; + pointer-events: none; } + .button.is-loading::after { + position: absolute; + left: calc(50% - (1em / 2)); + top: calc(50% - (1em / 2)); + position: absolute !important; } + .button.is-static { + background-color: whitesmoke; + border-color: #dbdbdb; + color: #7a7a7a; + box-shadow: none; + pointer-events: none; } + .button.is-rounded { + border-radius: 290486px; + padding-left: 1em; + padding-right: 1em; } + +.buttons { + align-items: center; + display: flex; + flex-wrap: wrap; + justify-content: flex-start; } + .buttons .button { + margin-bottom: 0.5rem; } + .buttons .button:not(:last-child) { + margin-right: 0.5rem; } + .buttons:last-child { + margin-bottom: -0.5rem; } + .buttons:not(:last-child) { + margin-bottom: 1rem; } + .buttons.has-addons .button:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; } + .buttons.has-addons .button:not(:last-child) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; + margin-right: -1px; } + .buttons.has-addons .button:last-child { + margin-right: 0; } + .buttons.has-addons .button:hover, .buttons.has-addons .button.is-hovered { + z-index: 2; } + .buttons.has-addons .button:focus, .buttons.has-addons .button.is-focused, .buttons.has-addons .button:active, .buttons.has-addons .button.is-active, .buttons.has-addons .button.is-selected { + z-index: 3; } + .buttons.has-addons .button:focus:hover, .buttons.has-addons .button.is-focused:hover, .buttons.has-addons .button:active:hover, .buttons.has-addons .button.is-active:hover, .buttons.has-addons .button.is-selected:hover { + z-index: 4; } + .buttons.has-addons .button.is-expanded { + flex-grow: 1; } + .buttons.is-centered { + justify-content: center; } + .buttons.is-right { + justify-content: flex-end; } + +.container { + margin: 0 auto; + position: relative; } + @media screen and (min-width: 1088px) { + .container { + max-width: 960px; + width: 960px; } + .container.is-fluid { + margin-left: 64px; + margin-right: 64px; + max-width: none; + width: auto; } } + @media screen and (max-width: 1279px) { + .container.is-widescreen { + max-width: 1152px; + width: auto; } } + @media screen and (max-width: 1471px) { + .container.is-fullhd { + max-width: 1344px; + width: auto; } } + @media screen and (min-width: 1280px) { + .container { + max-width: 1152px; + width: 1152px; } } + @media screen and (min-width: 1472px) { + .container { + max-width: 1344px; + width: 1344px; } } + +.content li + li { + margin-top: 0.25em; } + +.content p:not(:last-child), +.content dl:not(:last-child), +.content ol:not(:last-child), +.content ul:not(:last-child), +.content blockquote:not(:last-child), +.content pre:not(:last-child), +.content table:not(:last-child) { + margin-bottom: 1em; } + +.content h1, +.content h2, +.content h3, +.content h4, +.content h5, +.content h6 { + color: #363636; + font-weight: 600; + line-height: 1.125; } + +.content h1 { + font-size: 2em; + margin-bottom: 0.5em; } + .content h1:not(:first-child) { + margin-top: 1em; } + +.content h2 { + font-size: 1.75em; + margin-bottom: 0.5714em; } + .content h2:not(:first-child) { + margin-top: 1.1428em; } + +.content h3 { + font-size: 1.5em; + margin-bottom: 0.6666em; } + .content h3:not(:first-child) { + margin-top: 1.3333em; } + +.content h4 { + font-size: 1.25em; + margin-bottom: 0.8em; } + +.content h5 { + font-size: 1.125em; + margin-bottom: 0.8888em; } + +.content h6 { + font-size: 1em; + margin-bottom: 1em; } + +.content blockquote { + background-color: whitesmoke; + border-left: 5px solid #dbdbdb; + padding: 1.25em 1.5em; } + +.content ol { + list-style: decimal outside; + margin-left: 2em; + margin-top: 1em; } + +.content ul { + list-style: disc outside; + margin-left: 2em; + margin-top: 1em; } + .content ul ul { + list-style-type: circle; + margin-top: 0.5em; } + .content ul ul ul { + list-style-type: square; } + +.content dd { + margin-left: 2em; } + +.content figure { + margin-left: 2em; + margin-right: 2em; + text-align: center; } + .content figure:not(:first-child) { + margin-top: 2em; } + .content figure:not(:last-child) { + margin-bottom: 2em; } + .content figure img { + display: inline-block; } + .content figure figcaption { + font-style: italic; } + +.content pre { + -webkit-overflow-scrolling: touch; + overflow-x: auto; + padding: 1.25em 1.5em; + white-space: pre; + word-wrap: normal; } + +.content sup, +.content sub { + font-size: 75%; } + +.content table { + width: 100%; } + .content table td, + .content table th { + border: 1px solid #dbdbdb; + border-width: 0 0 1px; + padding: 0.5em 0.75em; + vertical-align: top; } + .content table th { + color: #363636; + text-align: left; } + .content table thead td, + .content table thead th { + border-width: 0 0 2px; + color: #363636; } + .content table tfoot td, + .content table tfoot th { + border-width: 2px 0 0; + color: #363636; } + .content table tbody tr:last-child td, + .content table tbody tr:last-child th { + border-bottom-width: 0; } + +.content.is-small { + font-size: 0.75rem; } + +.content.is-medium { + font-size: 1.25rem; } + +.content.is-large { + font-size: 1.5rem; } + +.input, +.textarea { + background-color: white; + border-color: #dbdbdb; + color: #363636; + box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); + max-width: 100%; + width: 100%; } + .input::-moz-placeholder, + .textarea::-moz-placeholder { + color: rgba(54, 54, 54, 0.3); } + .input::-webkit-input-placeholder, + .textarea::-webkit-input-placeholder { + color: rgba(54, 54, 54, 0.3); } + .input:-moz-placeholder, + .textarea:-moz-placeholder { + color: rgba(54, 54, 54, 0.3); } + .input:-ms-input-placeholder, + .textarea:-ms-input-placeholder { + color: rgba(54, 54, 54, 0.3); } + .input:hover, .input.is-hovered, + .textarea:hover, + .textarea.is-hovered { + border-color: #b5b5b5; } + .input:focus, .input.is-focused, .input:active, .input.is-active, + .textarea:focus, + .textarea.is-focused, + .textarea:active, + .textarea.is-active { + border-color: #33B2E8; + box-shadow: 0 0 0 0.125em rgba(51, 178, 232, 0.25); } + .input[disabled], + .textarea[disabled] { + background-color: whitesmoke; + border-color: whitesmoke; + box-shadow: none; + color: #7a7a7a; } + .input[disabled]::-moz-placeholder, + .textarea[disabled]::-moz-placeholder { + color: rgba(122, 122, 122, 0.3); } + .input[disabled]::-webkit-input-placeholder, + .textarea[disabled]::-webkit-input-placeholder { + color: rgba(122, 122, 122, 0.3); } + .input[disabled]:-moz-placeholder, + .textarea[disabled]:-moz-placeholder { + color: rgba(122, 122, 122, 0.3); } + .input[disabled]:-ms-input-placeholder, + .textarea[disabled]:-ms-input-placeholder { + color: rgba(122, 122, 122, 0.3); } + .input[readonly], + .textarea[readonly] { + box-shadow: none; } + .input.is-white, + .textarea.is-white { + border-color: white; } + .input.is-white:focus, .input.is-white.is-focused, .input.is-white:active, .input.is-white.is-active, + .textarea.is-white:focus, + .textarea.is-white.is-focused, + .textarea.is-white:active, + .textarea.is-white.is-active { + box-shadow: 0 0 0 0.125em rgba(255, 255, 255, 0.25); } + .input.is-black, + .textarea.is-black { + border-color: #0a0a0a; } + .input.is-black:focus, .input.is-black.is-focused, .input.is-black:active, .input.is-black.is-active, + .textarea.is-black:focus, + .textarea.is-black.is-focused, + .textarea.is-black:active, + .textarea.is-black.is-active { + box-shadow: 0 0 0 0.125em rgba(10, 10, 10, 0.25); } + .input.is-light, + .textarea.is-light { + border-color: whitesmoke; } + .input.is-light:focus, .input.is-light.is-focused, .input.is-light:active, .input.is-light.is-active, + .textarea.is-light:focus, + .textarea.is-light.is-focused, + .textarea.is-light:active, + .textarea.is-light.is-active { + box-shadow: 0 0 0 0.125em rgba(245, 245, 245, 0.25); } + .input.is-dark, + .textarea.is-dark { + border-color: #363636; } + .input.is-dark:focus, .input.is-dark.is-focused, .input.is-dark:active, .input.is-dark.is-active, + .textarea.is-dark:focus, + .textarea.is-dark.is-focused, + .textarea.is-dark:active, + .textarea.is-dark.is-active { + box-shadow: 0 0 0 0.125em rgba(54, 54, 54, 0.25); } + .input.is-primary, + .textarea.is-primary { + border-color: #00d1b2; } + .input.is-primary:focus, .input.is-primary.is-focused, .input.is-primary:active, .input.is-primary.is-active, + .textarea.is-primary:focus, + .textarea.is-primary.is-focused, + .textarea.is-primary:active, + .textarea.is-primary.is-active { + box-shadow: 0 0 0 0.125em rgba(0, 209, 178, 0.25); } + .input.is-link, + .textarea.is-link { + border-color: #33B2E8; } + .input.is-link:focus, .input.is-link.is-focused, .input.is-link:active, .input.is-link.is-active, + .textarea.is-link:focus, + .textarea.is-link.is-focused, + .textarea.is-link:active, + .textarea.is-link.is-active { + box-shadow: 0 0 0 0.125em rgba(51, 178, 232, 0.25); } + .input.is-info, + .textarea.is-info { + border-color: #209cee; } + .input.is-info:focus, .input.is-info.is-focused, .input.is-info:active, .input.is-info.is-active, + .textarea.is-info:focus, + .textarea.is-info.is-focused, + .textarea.is-info:active, + .textarea.is-info.is-active { + box-shadow: 0 0 0 0.125em rgba(32, 156, 238, 0.25); } + .input.is-success, + .textarea.is-success { + border-color: #23d160; } + .input.is-success:focus, .input.is-success.is-focused, .input.is-success:active, .input.is-success.is-active, + .textarea.is-success:focus, + .textarea.is-success.is-focused, + .textarea.is-success:active, + .textarea.is-success.is-active { + box-shadow: 0 0 0 0.125em rgba(35, 209, 96, 0.25); } + .input.is-warning, + .textarea.is-warning { + border-color: #ffdd57; } + .input.is-warning:focus, .input.is-warning.is-focused, .input.is-warning:active, .input.is-warning.is-active, + .textarea.is-warning:focus, + .textarea.is-warning.is-focused, + .textarea.is-warning:active, + .textarea.is-warning.is-active { + box-shadow: 0 0 0 0.125em rgba(255, 221, 87, 0.25); } + .input.is-danger, + .textarea.is-danger { + border-color: #ff3860; } + .input.is-danger:focus, .input.is-danger.is-focused, .input.is-danger:active, .input.is-danger.is-active, + .textarea.is-danger:focus, + .textarea.is-danger.is-focused, + .textarea.is-danger:active, + .textarea.is-danger.is-active { + box-shadow: 0 0 0 0.125em rgba(255, 56, 96, 0.25); } + .input.is-small, + .textarea.is-small { + border-radius: 2px; + font-size: 0.75rem; } + .input.is-medium, + .textarea.is-medium { + font-size: 1.25rem; } + .input.is-large, + .textarea.is-large { + font-size: 1.5rem; } + .input.is-fullwidth, + .textarea.is-fullwidth { + display: block; + width: 100%; } + .input.is-inline, + .textarea.is-inline { + display: inline; + width: auto; } + +.input.is-rounded { + border-radius: 290486px; + padding-left: 1em; + padding-right: 1em; } + +.input.is-static { + background-color: transparent; + border-color: transparent; + box-shadow: none; + padding-left: 0; + padding-right: 0; } + +.textarea { + display: block; + max-width: 100%; + min-width: 100%; + padding: 0.625em; + resize: vertical; } + .textarea:not([rows]) { + max-height: 600px; + min-height: 120px; } + .textarea[rows] { + height: initial; } + .textarea.has-fixed-size { + resize: none; } + +.checkbox, +.radio { + cursor: pointer; + display: inline-block; + line-height: 1.25; + position: relative; } + .checkbox input, + .radio input { + cursor: pointer; } + .checkbox:hover, + .radio:hover { + color: #363636; } + .checkbox[disabled], + .radio[disabled] { + color: #7a7a7a; + cursor: not-allowed; } + +.radio + .radio { + margin-left: 0.5em; } + +.select { + display: inline-block; + max-width: 100%; + position: relative; + vertical-align: top; } + .select:not(.is-multiple) { + height: 2.25em; } + .select:not(.is-multiple):not(.is-loading)::after { + border-color: #33B2E8; + right: 1.125em; + z-index: 4; } + .select.is-rounded select { + border-radius: 290486px; + padding-left: 1em; } + .select select { + background-color: white; + border-color: #dbdbdb; + color: #363636; + cursor: pointer; + display: block; + font-size: 1em; + max-width: 100%; + outline: none; } + .select select::-moz-placeholder { + color: rgba(54, 54, 54, 0.3); } + .select select::-webkit-input-placeholder { + color: rgba(54, 54, 54, 0.3); } + .select select:-moz-placeholder { + color: rgba(54, 54, 54, 0.3); } + .select select:-ms-input-placeholder { + color: rgba(54, 54, 54, 0.3); } + .select select:hover, .select select.is-hovered { + border-color: #b5b5b5; } + .select select:focus, .select select.is-focused, .select select:active, .select select.is-active { + border-color: #33B2E8; + box-shadow: 0 0 0 0.125em rgba(51, 178, 232, 0.25); } + .select select[disabled] { + background-color: whitesmoke; + border-color: whitesmoke; + box-shadow: none; + color: #7a7a7a; } + .select select[disabled]::-moz-placeholder { + color: rgba(122, 122, 122, 0.3); } + .select select[disabled]::-webkit-input-placeholder { + color: rgba(122, 122, 122, 0.3); } + .select select[disabled]:-moz-placeholder { + color: rgba(122, 122, 122, 0.3); } + .select select[disabled]:-ms-input-placeholder { + color: rgba(122, 122, 122, 0.3); } + .select select::-ms-expand { + display: none; } + .select select[disabled]:hover { + border-color: whitesmoke; } + .select select:not([multiple]) { + padding-right: 2.5em; } + .select select[multiple] { + height: initial; + padding: 0; } + .select select[multiple] option { + padding: 0.5em 1em; } + .select:not(.is-multiple):not(.is-loading):hover::after { + border-color: #363636; } + .select.is-white:not(:hover)::after { + border-color: white; } + .select.is-white select { + border-color: white; } + .select.is-white select:hover, .select.is-white select.is-hovered { + border-color: #f2f2f2; } + .select.is-white select:focus, .select.is-white select.is-focused, .select.is-white select:active, .select.is-white select.is-active { + box-shadow: 0 0 0 0.125em rgba(255, 255, 255, 0.25); } + .select.is-black:not(:hover)::after { + border-color: #0a0a0a; } + .select.is-black select { + border-color: #0a0a0a; } + .select.is-black select:hover, .select.is-black select.is-hovered { + border-color: black; } + .select.is-black select:focus, .select.is-black select.is-focused, .select.is-black select:active, .select.is-black select.is-active { + box-shadow: 0 0 0 0.125em rgba(10, 10, 10, 0.25); } + .select.is-light:not(:hover)::after { + border-color: whitesmoke; } + .select.is-light select { + border-color: whitesmoke; } + .select.is-light select:hover, .select.is-light select.is-hovered { + border-color: #e8e8e8; } + .select.is-light select:focus, .select.is-light select.is-focused, .select.is-light select:active, .select.is-light select.is-active { + box-shadow: 0 0 0 0.125em rgba(245, 245, 245, 0.25); } + .select.is-dark:not(:hover)::after { + border-color: #363636; } + .select.is-dark select { + border-color: #363636; } + .select.is-dark select:hover, .select.is-dark select.is-hovered { + border-color: #292929; } + .select.is-dark select:focus, .select.is-dark select.is-focused, .select.is-dark select:active, .select.is-dark select.is-active { + box-shadow: 0 0 0 0.125em rgba(54, 54, 54, 0.25); } + .select.is-primary:not(:hover)::after { + border-color: #00d1b2; } + .select.is-primary select { + border-color: #00d1b2; } + .select.is-primary select:hover, .select.is-primary select.is-hovered { + border-color: #00b89c; } + .select.is-primary select:focus, .select.is-primary select.is-focused, .select.is-primary select:active, .select.is-primary select.is-active { + box-shadow: 0 0 0 0.125em rgba(0, 209, 178, 0.25); } + .select.is-link:not(:hover)::after { + border-color: #33B2E8; } + .select.is-link select { + border-color: #33B2E8; } + .select.is-link select:hover, .select.is-link select.is-hovered { + border-color: #1ca9e5; } + .select.is-link select:focus, .select.is-link select.is-focused, .select.is-link select:active, .select.is-link select.is-active { + box-shadow: 0 0 0 0.125em rgba(51, 178, 232, 0.25); } + .select.is-info:not(:hover)::after { + border-color: #209cee; } + .select.is-info select { + border-color: #209cee; } + .select.is-info select:hover, .select.is-info select.is-hovered { + border-color: #118fe4; } + .select.is-info select:focus, .select.is-info select.is-focused, .select.is-info select:active, .select.is-info select.is-active { + box-shadow: 0 0 0 0.125em rgba(32, 156, 238, 0.25); } + .select.is-success:not(:hover)::after { + border-color: #23d160; } + .select.is-success select { + border-color: #23d160; } + .select.is-success select:hover, .select.is-success select.is-hovered { + border-color: #20bc56; } + .select.is-success select:focus, .select.is-success select.is-focused, .select.is-success select:active, .select.is-success select.is-active { + box-shadow: 0 0 0 0.125em rgba(35, 209, 96, 0.25); } + .select.is-warning:not(:hover)::after { + border-color: #ffdd57; } + .select.is-warning select { + border-color: #ffdd57; } + .select.is-warning select:hover, .select.is-warning select.is-hovered { + border-color: #ffd83d; } + .select.is-warning select:focus, .select.is-warning select.is-focused, .select.is-warning select:active, .select.is-warning select.is-active { + box-shadow: 0 0 0 0.125em rgba(255, 221, 87, 0.25); } + .select.is-danger:not(:hover)::after { + border-color: #ff3860; } + .select.is-danger select { + border-color: #ff3860; } + .select.is-danger select:hover, .select.is-danger select.is-hovered { + border-color: #ff1f4b; } + .select.is-danger select:focus, .select.is-danger select.is-focused, .select.is-danger select:active, .select.is-danger select.is-active { + box-shadow: 0 0 0 0.125em rgba(255, 56, 96, 0.25); } + .select.is-small { + border-radius: 2px; + font-size: 0.75rem; } + .select.is-medium { + font-size: 1.25rem; } + .select.is-large { + font-size: 1.5rem; } + .select.is-disabled::after { + border-color: #7a7a7a; } + .select.is-fullwidth { + width: 100%; } + .select.is-fullwidth select { + width: 100%; } + .select.is-loading::after { + margin-top: 0; + position: absolute; + right: 0.625em; + top: 0.625em; + transform: none; } + .select.is-loading.is-small:after { + font-size: 0.75rem; } + .select.is-loading.is-medium:after { + font-size: 1.25rem; } + .select.is-loading.is-large:after { + font-size: 1.5rem; } + +.file { + align-items: stretch; + display: flex; + justify-content: flex-start; + position: relative; } + .file.is-white .file-cta { + background-color: white; + border-color: transparent; + color: #0a0a0a; } + .file.is-white:hover .file-cta, .file.is-white.is-hovered .file-cta { + background-color: #f9f9f9; + border-color: transparent; + color: #0a0a0a; } + .file.is-white:focus .file-cta, .file.is-white.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(255, 255, 255, 0.25); + color: #0a0a0a; } + .file.is-white:active .file-cta, .file.is-white.is-active .file-cta { + background-color: #f2f2f2; + border-color: transparent; + color: #0a0a0a; } + .file.is-black .file-cta { + background-color: #0a0a0a; + border-color: transparent; + color: white; } + .file.is-black:hover .file-cta, .file.is-black.is-hovered .file-cta { + background-color: #040404; + border-color: transparent; + color: white; } + .file.is-black:focus .file-cta, .file.is-black.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(10, 10, 10, 0.25); + color: white; } + .file.is-black:active .file-cta, .file.is-black.is-active .file-cta { + background-color: black; + border-color: transparent; + color: white; } + .file.is-light .file-cta { + background-color: whitesmoke; + border-color: transparent; + color: #363636; } + .file.is-light:hover .file-cta, .file.is-light.is-hovered .file-cta { + background-color: #eeeeee; + border-color: transparent; + color: #363636; } + .file.is-light:focus .file-cta, .file.is-light.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(245, 245, 245, 0.25); + color: #363636; } + .file.is-light:active .file-cta, .file.is-light.is-active .file-cta { + background-color: #e8e8e8; + border-color: transparent; + color: #363636; } + .file.is-dark .file-cta { + background-color: #363636; + border-color: transparent; + color: whitesmoke; } + .file.is-dark:hover .file-cta, .file.is-dark.is-hovered .file-cta { + background-color: #2f2f2f; + border-color: transparent; + color: whitesmoke; } + .file.is-dark:focus .file-cta, .file.is-dark.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(54, 54, 54, 0.25); + color: whitesmoke; } + .file.is-dark:active .file-cta, .file.is-dark.is-active .file-cta { + background-color: #292929; + border-color: transparent; + color: whitesmoke; } + .file.is-primary .file-cta { + background-color: #00d1b2; + border-color: transparent; + color: #fff; } + .file.is-primary:hover .file-cta, .file.is-primary.is-hovered .file-cta { + background-color: #00c4a7; + border-color: transparent; + color: #fff; } + .file.is-primary:focus .file-cta, .file.is-primary.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(0, 209, 178, 0.25); + color: #fff; } + .file.is-primary:active .file-cta, .file.is-primary.is-active .file-cta { + background-color: #00b89c; + border-color: transparent; + color: #fff; } + .file.is-link .file-cta { + background-color: #33B2E8; + border-color: transparent; + color: #fff; } + .file.is-link:hover .file-cta, .file.is-link.is-hovered .file-cta { + background-color: #28aee7; + border-color: transparent; + color: #fff; } + .file.is-link:focus .file-cta, .file.is-link.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(51, 178, 232, 0.25); + color: #fff; } + .file.is-link:active .file-cta, .file.is-link.is-active .file-cta { + background-color: #1ca9e5; + border-color: transparent; + color: #fff; } + .file.is-info .file-cta { + background-color: #209cee; + border-color: transparent; + color: #fff; } + .file.is-info:hover .file-cta, .file.is-info.is-hovered .file-cta { + background-color: #1496ed; + border-color: transparent; + color: #fff; } + .file.is-info:focus .file-cta, .file.is-info.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(32, 156, 238, 0.25); + color: #fff; } + .file.is-info:active .file-cta, .file.is-info.is-active .file-cta { + background-color: #118fe4; + border-color: transparent; + color: #fff; } + .file.is-success .file-cta { + background-color: #23d160; + border-color: transparent; + color: #fff; } + .file.is-success:hover .file-cta, .file.is-success.is-hovered .file-cta { + background-color: #22c65b; + border-color: transparent; + color: #fff; } + .file.is-success:focus .file-cta, .file.is-success.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(35, 209, 96, 0.25); + color: #fff; } + .file.is-success:active .file-cta, .file.is-success.is-active .file-cta { + background-color: #20bc56; + border-color: transparent; + color: #fff; } + .file.is-warning .file-cta { + background-color: #ffdd57; + border-color: transparent; + color: rgba(0, 0, 0, 0.7); } + .file.is-warning:hover .file-cta, .file.is-warning.is-hovered .file-cta { + background-color: #ffdb4a; + border-color: transparent; + color: rgba(0, 0, 0, 0.7); } + .file.is-warning:focus .file-cta, .file.is-warning.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(255, 221, 87, 0.25); + color: rgba(0, 0, 0, 0.7); } + .file.is-warning:active .file-cta, .file.is-warning.is-active .file-cta { + background-color: #ffd83d; + border-color: transparent; + color: rgba(0, 0, 0, 0.7); } + .file.is-danger .file-cta { + background-color: #ff3860; + border-color: transparent; + color: #fff; } + .file.is-danger:hover .file-cta, .file.is-danger.is-hovered .file-cta { + background-color: #ff2b56; + border-color: transparent; + color: #fff; } + .file.is-danger:focus .file-cta, .file.is-danger.is-focused .file-cta { + border-color: transparent; + box-shadow: 0 0 0.5em rgba(255, 56, 96, 0.25); + color: #fff; } + .file.is-danger:active .file-cta, .file.is-danger.is-active .file-cta { + background-color: #ff1f4b; + border-color: transparent; + color: #fff; } + .file.is-small { + font-size: 0.75rem; } + .file.is-medium { + font-size: 1.25rem; } + .file.is-medium .file-icon .fa { + font-size: 21px; } + .file.is-large { + font-size: 1.5rem; } + .file.is-large .file-icon .fa { + font-size: 28px; } + .file.has-name .file-cta { + border-bottom-right-radius: 0; + border-top-right-radius: 0; } + .file.has-name .file-name { + border-bottom-left-radius: 0; + border-top-left-radius: 0; } + .file.has-name.is-empty .file-cta { + border-radius: 4px; } + .file.has-name.is-empty .file-name { + display: none; } + .file.is-boxed .file-label { + flex-direction: column; } + .file.is-boxed .file-cta { + flex-direction: column; + height: auto; + padding: 1em 3em; } + .file.is-boxed .file-name { + border-width: 0 1px 1px; } + .file.is-boxed .file-icon { + height: 1.5em; + width: 1.5em; } + .file.is-boxed .file-icon .fa { + font-size: 21px; } + .file.is-boxed.is-small .file-icon .fa { + font-size: 14px; } + .file.is-boxed.is-medium .file-icon .fa { + font-size: 28px; } + .file.is-boxed.is-large .file-icon .fa { + font-size: 35px; } + .file.is-boxed.has-name .file-cta { + border-radius: 4px 4px 0 0; } + .file.is-boxed.has-name .file-name { + border-radius: 0 0 4px 4px; + border-width: 0 1px 1px; } + .file.is-centered { + justify-content: center; } + .file.is-fullwidth .file-label { + width: 100%; } + .file.is-fullwidth .file-name { + flex-grow: 1; + max-width: none; } + .file.is-right { + justify-content: flex-end; } + .file.is-right .file-cta { + border-radius: 0 4px 4px 0; } + .file.is-right .file-name { + border-radius: 4px 0 0 4px; + border-width: 1px 0 1px 1px; + order: -1; } + +.file-label { + align-items: stretch; + display: flex; + cursor: pointer; + justify-content: flex-start; + overflow: hidden; + position: relative; } + .file-label:hover .file-cta { + background-color: #eeeeee; + color: #363636; } + .file-label:hover .file-name { + border-color: #d5d5d5; } + .file-label:active .file-cta { + background-color: #e8e8e8; + color: #363636; } + .file-label:active .file-name { + border-color: #cfcfcf; } + +.file-input { + height: 0.01em; + left: 0; + outline: none; + position: absolute; + top: 0; + width: 0.01em; } + +.file-cta, +.file-name { + border-color: #dbdbdb; + border-radius: 4px; + font-size: 1em; + padding-left: 1em; + padding-right: 1em; + white-space: nowrap; } + +.file-cta { + background-color: whitesmoke; + color: #4a4a4a; } + +.file-name { + border-color: #dbdbdb; + border-style: solid; + border-width: 1px 1px 1px 0; + display: block; + max-width: 16em; + overflow: hidden; + text-align: left; + text-overflow: ellipsis; } + +.file-icon { + align-items: center; + display: flex; + height: 1em; + justify-content: center; + margin-right: 0.5em; + width: 1em; } + .file-icon .fa { + font-size: 14px; } + +.label { + color: #363636; + display: block; + font-size: 1rem; + font-weight: 700; } + .label:not(:last-child) { + margin-bottom: 0.5em; } + .label.is-small { + font-size: 0.75rem; } + .label.is-medium { + font-size: 1.25rem; } + .label.is-large { + font-size: 1.5rem; } + +.help { + display: block; + font-size: 0.75rem; + margin-top: 0.25rem; } + .help.is-white { + color: white; } + .help.is-black { + color: #0a0a0a; } + .help.is-light { + color: whitesmoke; } + .help.is-dark { + color: #363636; } + .help.is-primary { + color: #00d1b2; } + .help.is-link { + color: #33B2E8; } + .help.is-info { + color: #209cee; } + .help.is-success { + color: #23d160; } + .help.is-warning { + color: #ffdd57; } + .help.is-danger { + color: #ff3860; } + +.field:not(:last-child) { + margin-bottom: 0.75rem; } + +.field.has-addons { + display: flex; + justify-content: flex-start; } + .field.has-addons .control:not(:last-child) { + margin-right: -1px; } + .field.has-addons .control:not(:first-child):not(:last-child) .button, + .field.has-addons .control:not(:first-child):not(:last-child) .input, + .field.has-addons .control:not(:first-child):not(:last-child) .select select { + border-radius: 0; } + .field.has-addons .control:first-child .button, + .field.has-addons .control:first-child .input, + .field.has-addons .control:first-child .select select { + border-bottom-right-radius: 0; + border-top-right-radius: 0; } + .field.has-addons .control:last-child .button, + .field.has-addons .control:last-child .input, + .field.has-addons .control:last-child .select select { + border-bottom-left-radius: 0; + border-top-left-radius: 0; } + .field.has-addons .control .button:hover, .field.has-addons .control .button.is-hovered, + .field.has-addons .control .input:hover, + .field.has-addons .control .input.is-hovered, + .field.has-addons .control .select select:hover, + .field.has-addons .control .select select.is-hovered { + z-index: 2; } + .field.has-addons .control .button:focus, .field.has-addons .control .button.is-focused, .field.has-addons .control .button:active, .field.has-addons .control .button.is-active, + .field.has-addons .control .input:focus, + .field.has-addons .control .input.is-focused, + .field.has-addons .control .input:active, + .field.has-addons .control .input.is-active, + .field.has-addons .control .select select:focus, + .field.has-addons .control .select select.is-focused, + .field.has-addons .control .select select:active, + .field.has-addons .control .select select.is-active { + z-index: 3; } + .field.has-addons .control .button:focus:hover, .field.has-addons .control .button.is-focused:hover, .field.has-addons .control .button:active:hover, .field.has-addons .control .button.is-active:hover, + .field.has-addons .control .input:focus:hover, + .field.has-addons .control .input.is-focused:hover, + .field.has-addons .control .input:active:hover, + .field.has-addons .control .input.is-active:hover, + .field.has-addons .control .select select:focus:hover, + .field.has-addons .control .select select.is-focused:hover, + .field.has-addons .control .select select:active:hover, + .field.has-addons .control .select select.is-active:hover { + z-index: 4; } + .field.has-addons .control.is-expanded { + flex-grow: 1; } + .field.has-addons.has-addons-centered { + justify-content: center; } + .field.has-addons.has-addons-right { + justify-content: flex-end; } + .field.has-addons.has-addons-fullwidth .control { + flex-grow: 1; + flex-shrink: 0; } + +.field.is-grouped { + display: flex; + justify-content: flex-start; } + .field.is-grouped > .control { + flex-shrink: 0; } + .field.is-grouped > .control:not(:last-child) { + margin-bottom: 0; + margin-right: 0.75rem; } + .field.is-grouped > .control.is-expanded { + flex-grow: 1; + flex-shrink: 1; } + .field.is-grouped.is-grouped-centered { + justify-content: center; } + .field.is-grouped.is-grouped-right { + justify-content: flex-end; } + .field.is-grouped.is-grouped-multiline { + flex-wrap: wrap; } + .field.is-grouped.is-grouped-multiline > .control:last-child, .field.is-grouped.is-grouped-multiline > .control:not(:last-child) { + margin-bottom: 0.75rem; } + .field.is-grouped.is-grouped-multiline:last-child { + margin-bottom: -0.75rem; } + .field.is-grouped.is-grouped-multiline:not(:last-child) { + margin-bottom: 0; } + +@media screen and (min-width: 769px), print { + .field.is-horizontal { + display: flex; } } + +.field-label .label { + font-size: inherit; } + +@media screen and (max-width: 768px) { + .field-label { + margin-bottom: 0.5rem; } } + +@media screen and (min-width: 769px), print { + .field-label { + flex-basis: 0; + flex-grow: 1; + flex-shrink: 0; + margin-right: 1.5rem; + text-align: right; } + .field-label.is-small { + font-size: 0.75rem; + padding-top: 0.375em; } + .field-label.is-normal { + padding-top: 0.375em; } + .field-label.is-medium { + font-size: 1.25rem; + padding-top: 0.375em; } + .field-label.is-large { + font-size: 1.5rem; + padding-top: 0.375em; } } + +.field-body .field .field { + margin-bottom: 0; } + +@media screen and (min-width: 769px), print { + .field-body { + display: flex; + flex-basis: 0; + flex-grow: 5; + flex-shrink: 1; } + .field-body .field { + margin-bottom: 0; } + .field-body > .field { + flex-shrink: 1; } + .field-body > .field:not(.is-narrow) { + flex-grow: 1; } + .field-body > .field:not(:last-child) { + margin-right: 0.75rem; } } + +.control { + font-size: 1rem; + position: relative; + text-align: left; } + .control.has-icon .icon { + color: #dbdbdb; + height: 2.25em; + pointer-events: none; + position: absolute; + top: 0; + width: 2.25em; + z-index: 4; } + .control.has-icon .input:focus + .icon { + color: #7a7a7a; } + .control.has-icon .input.is-small + .icon { + font-size: 0.75rem; } + .control.has-icon .input.is-medium + .icon { + font-size: 1.25rem; } + .control.has-icon .input.is-large + .icon { + font-size: 1.5rem; } + .control.has-icon:not(.has-icon-right) .icon { + left: 0; } + .control.has-icon:not(.has-icon-right) .input { + padding-left: 2.25em; } + .control.has-icon.has-icon-right .icon { + right: 0; } + .control.has-icon.has-icon-right .input { + padding-right: 2.25em; } + .control.has-icons-left .input:focus ~ .icon, + .control.has-icons-left .select:focus ~ .icon, .control.has-icons-right .input:focus ~ .icon, + .control.has-icons-right .select:focus ~ .icon { + color: #7a7a7a; } + .control.has-icons-left .input.is-small ~ .icon, + .control.has-icons-left .select.is-small ~ .icon, .control.has-icons-right .input.is-small ~ .icon, + .control.has-icons-right .select.is-small ~ .icon { + font-size: 0.75rem; } + .control.has-icons-left .input.is-medium ~ .icon, + .control.has-icons-left .select.is-medium ~ .icon, .control.has-icons-right .input.is-medium ~ .icon, + .control.has-icons-right .select.is-medium ~ .icon { + font-size: 1.25rem; } + .control.has-icons-left .input.is-large ~ .icon, + .control.has-icons-left .select.is-large ~ .icon, .control.has-icons-right .input.is-large ~ .icon, + .control.has-icons-right .select.is-large ~ .icon { + font-size: 1.5rem; } + .control.has-icons-left .icon, .control.has-icons-right .icon { + color: #dbdbdb; + height: 2.25em; + pointer-events: none; + position: absolute; + top: 0; + width: 2.25em; + z-index: 4; } + .control.has-icons-left .input, + .control.has-icons-left .select select { + padding-left: 2.25em; } + .control.has-icons-left .icon.is-left { + left: 0; } + .control.has-icons-right .input, + .control.has-icons-right .select select { + padding-right: 2.25em; } + .control.has-icons-right .icon.is-right { + right: 0; } + .control.is-loading::after { + position: absolute !important; + right: 0.625em; + top: 0.625em; + z-index: 4; } + .control.is-loading.is-small:after { + font-size: 0.75rem; } + .control.is-loading.is-medium:after { + font-size: 1.25rem; } + .control.is-loading.is-large:after { + font-size: 1.5rem; } + +.icon { + align-items: center; + display: inline-flex; + justify-content: center; + height: 1.5rem; + width: 1.5rem; } + .icon.is-small { + height: 1rem; + width: 1rem; } + .icon.is-medium { + height: 2rem; + width: 2rem; } + .icon.is-large { + height: 3rem; + width: 3rem; } + +.image { + display: block; + position: relative; } + .image img { + display: block; + height: auto; + width: 100%; } + .image img.is-rounded { + border-radius: 290486px; } + .image.is-square img, .image.is-1by1 img, .image.is-5by4 img, .image.is-4by3 img, .image.is-3by2 img, .image.is-5by3 img, .image.is-16by9 img, .image.is-2by1 img, .image.is-3by1 img, .image.is-4by5 img, .image.is-3by4 img, .image.is-2by3 img, .image.is-3by5 img, .image.is-9by16 img, .image.is-1by2 img, .image.is-1by3 img { + height: 100%; + width: 100%; } + .image.is-square, .image.is-1by1 { + padding-top: 100%; } + .image.is-5by4 { + padding-top: 80%; } + .image.is-4by3 { + padding-top: 75%; } + .image.is-3by2 { + padding-top: 66.6666%; } + .image.is-5by3 { + padding-top: 60%; } + .image.is-16by9 { + padding-top: 56.25%; } + .image.is-2by1 { + padding-top: 50%; } + .image.is-3by1 { + padding-top: 33.3333%; } + .image.is-4by5 { + padding-top: 125%; } + .image.is-3by4 { + padding-top: 133.3333%; } + .image.is-2by3 { + padding-top: 150%; } + .image.is-3by5 { + padding-top: 166.6666%; } + .image.is-9by16 { + padding-top: 177.7777%; } + .image.is-1by2 { + padding-top: 200%; } + .image.is-1by3 { + padding-top: 300%; } + .image.is-16x16 { + height: 16px; + width: 16px; } + .image.is-24x24 { + height: 24px; + width: 24px; } + .image.is-32x32 { + height: 32px; + width: 32px; } + .image.is-48x48 { + height: 48px; + width: 48px; } + .image.is-64x64 { + height: 64px; + width: 64px; } + .image.is-96x96 { + height: 96px; + width: 96px; } + .image.is-128x128 { + height: 128px; + width: 128px; } + +.notification { + background-color: whitesmoke; + border-radius: 4px; + padding: 1.25rem 2.5rem 1.25rem 1.5rem; + position: relative; } + .notification a:not(.button) { + color: currentColor; + text-decoration: underline; } + .notification strong { + color: currentColor; } + .notification code, + .notification pre { + background: white; } + .notification pre code { + background: transparent; } + .notification > .delete { + position: absolute; + right: 0.5rem; + top: 0.5rem; } + .notification .title, + .notification .subtitle, + .notification .content { + color: currentColor; } + .notification.is-white { + background-color: white; + color: #0a0a0a; } + .notification.is-black { + background-color: #0a0a0a; + color: white; } + .notification.is-light { + background-color: whitesmoke; + color: #363636; } + .notification.is-dark { + background-color: #363636; + color: whitesmoke; } + .notification.is-primary { + background-color: #00d1b2; + color: #fff; } + .notification.is-link { + background-color: #33B2E8; + color: #fff; } + .notification.is-info { + background-color: #209cee; + color: #fff; } + .notification.is-success { + background-color: #23d160; + color: #fff; } + .notification.is-warning { + background-color: #ffdd57; + color: rgba(0, 0, 0, 0.7); } + .notification.is-danger { + background-color: #ff3860; + color: #fff; } + +.progress { + -moz-appearance: none; + -webkit-appearance: none; + border: none; + border-radius: 290486px; + display: block; + height: 1rem; + overflow: hidden; + padding: 0; + width: 100%; } + .progress::-webkit-progress-bar { + background-color: #dbdbdb; } + .progress::-webkit-progress-value { + background-color: #4a4a4a; } + .progress::-moz-progress-bar { + background-color: #4a4a4a; } + .progress::-ms-fill { + background-color: #4a4a4a; + border: none; } + .progress.is-white::-webkit-progress-value { + background-color: white; } + .progress.is-white::-moz-progress-bar { + background-color: white; } + .progress.is-white::-ms-fill { + background-color: white; } + .progress.is-black::-webkit-progress-value { + background-color: #0a0a0a; } + .progress.is-black::-moz-progress-bar { + background-color: #0a0a0a; } + .progress.is-black::-ms-fill { + background-color: #0a0a0a; } + .progress.is-light::-webkit-progress-value { + background-color: whitesmoke; } + .progress.is-light::-moz-progress-bar { + background-color: whitesmoke; } + .progress.is-light::-ms-fill { + background-color: whitesmoke; } + .progress.is-dark::-webkit-progress-value { + background-color: #363636; } + .progress.is-dark::-moz-progress-bar { + background-color: #363636; } + .progress.is-dark::-ms-fill { + background-color: #363636; } + .progress.is-primary::-webkit-progress-value { + background-color: #00d1b2; } + .progress.is-primary::-moz-progress-bar { + background-color: #00d1b2; } + .progress.is-primary::-ms-fill { + background-color: #00d1b2; } + .progress.is-link::-webkit-progress-value { + background-color: #33B2E8; } + .progress.is-link::-moz-progress-bar { + background-color: #33B2E8; } + .progress.is-link::-ms-fill { + background-color: #33B2E8; } + .progress.is-info::-webkit-progress-value { + background-color: #209cee; } + .progress.is-info::-moz-progress-bar { + background-color: #209cee; } + .progress.is-info::-ms-fill { + background-color: #209cee; } + .progress.is-success::-webkit-progress-value { + background-color: #23d160; } + .progress.is-success::-moz-progress-bar { + background-color: #23d160; } + .progress.is-success::-ms-fill { + background-color: #23d160; } + .progress.is-warning::-webkit-progress-value { + background-color: #ffdd57; } + .progress.is-warning::-moz-progress-bar { + background-color: #ffdd57; } + .progress.is-warning::-ms-fill { + background-color: #ffdd57; } + .progress.is-danger::-webkit-progress-value { + background-color: #ff3860; } + .progress.is-danger::-moz-progress-bar { + background-color: #ff3860; } + .progress.is-danger::-ms-fill { + background-color: #ff3860; } + .progress.is-small { + height: 0.75rem; } + .progress.is-medium { + height: 1.25rem; } + .progress.is-large { + height: 1.5rem; } + +.table { + background-color: white; + color: #363636; } + .table td, + .table th { + border: 1px solid #dbdbdb; + border-width: 0 0 1px; + padding: 0.5em 0.75em; + vertical-align: top; } + .table td.is-white, + .table th.is-white { + background-color: white; + border-color: white; + color: #0a0a0a; } + .table td.is-black, + .table th.is-black { + background-color: #0a0a0a; + border-color: #0a0a0a; + color: white; } + .table td.is-light, + .table th.is-light { + background-color: whitesmoke; + border-color: whitesmoke; + color: #363636; } + .table td.is-dark, + .table th.is-dark { + background-color: #363636; + border-color: #363636; + color: whitesmoke; } + .table td.is-primary, + .table th.is-primary { + background-color: #00d1b2; + border-color: #00d1b2; + color: #fff; } + .table td.is-link, + .table th.is-link { + background-color: #33B2E8; + border-color: #33B2E8; + color: #fff; } + .table td.is-info, + .table th.is-info { + background-color: #209cee; + border-color: #209cee; + color: #fff; } + .table td.is-success, + .table th.is-success { + background-color: #23d160; + border-color: #23d160; + color: #fff; } + .table td.is-warning, + .table th.is-warning { + background-color: #ffdd57; + border-color: #ffdd57; + color: rgba(0, 0, 0, 0.7); } + .table td.is-danger, + .table th.is-danger { + background-color: #ff3860; + border-color: #ff3860; + color: #fff; } + .table td.is-narrow, + .table th.is-narrow { + white-space: nowrap; + width: 1%; } + .table td.is-selected, + .table th.is-selected { + background-color: #00d1b2; + color: #fff; } + .table td.is-selected a, + .table td.is-selected strong, + .table th.is-selected a, + .table th.is-selected strong { + color: currentColor; } + .table th { + color: #363636; + text-align: left; } + .table tr.is-selected { + background-color: #00d1b2; + color: #fff; } + .table tr.is-selected a, + .table tr.is-selected strong { + color: currentColor; } + .table tr.is-selected td, + .table tr.is-selected th { + border-color: #fff; + color: currentColor; } + .table thead td, + .table thead th { + border-width: 0 0 2px; + color: #363636; } + .table tfoot td, + .table tfoot th { + border-width: 2px 0 0; + color: #363636; } + .table tbody tr:last-child td, + .table tbody tr:last-child th { + border-bottom-width: 0; } + .table.is-bordered td, + .table.is-bordered th { + border-width: 1px; } + .table.is-bordered tr:last-child td, + .table.is-bordered tr:last-child th { + border-bottom-width: 1px; } + .table.is-fullwidth { + width: 100%; } + .table.is-hoverable tbody tr:not(.is-selected):hover { + background-color: #fafafa; } + .table.is-hoverable.is-striped tbody tr:not(.is-selected):hover { + background-color: whitesmoke; } + .table.is-narrow td, + .table.is-narrow th { + padding: 0.25em 0.5em; } + .table.is-striped tbody tr:not(.is-selected):nth-child(even) { + background-color: #fafafa; } + +.table-container { + -webkit-overflow-scrolling: touch; + overflow: auto; + overflow-y: hidden; + max-width: 100%; } + +.tags { + align-items: center; + display: flex; + flex-wrap: wrap; + justify-content: flex-start; } + .tags .tag { + margin-bottom: 0.5rem; } + .tags .tag:not(:last-child) { + margin-right: 0.5rem; } + .tags:last-child { + margin-bottom: -0.5rem; } + .tags:not(:last-child) { + margin-bottom: 1rem; } + .tags.has-addons .tag { + margin-right: 0; } + .tags.has-addons .tag:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; } + .tags.has-addons .tag:not(:last-child) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; } + .tags.is-centered { + justify-content: center; } + .tags.is-centered .tag { + margin-right: 0.25rem; + margin-left: 0.25rem; } + .tags.is-right { + justify-content: flex-end; } + .tags.is-right .tag:not(:first-child) { + margin-left: 0.5rem; } + .tags.is-right .tag:not(:last-child) { + margin-right: 0; } + +.tag:not(body) { + align-items: center; + background-color: whitesmoke; + border-radius: 4px; + color: #4a4a4a; + display: inline-flex; + font-size: 0.75rem; + height: 2em; + justify-content: center; + line-height: 1.5; + padding-left: 0.75em; + padding-right: 0.75em; + white-space: nowrap; } + .tag:not(body) .delete { + margin-left: 0.25rem; + margin-right: -0.375rem; } + .tag:not(body).is-white { + background-color: white; + color: #0a0a0a; } + .tag:not(body).is-black { + background-color: #0a0a0a; + color: white; } + .tag:not(body).is-light { + background-color: whitesmoke; + color: #363636; } + .tag:not(body).is-dark { + background-color: #363636; + color: whitesmoke; } + .tag:not(body).is-primary { + background-color: #00d1b2; + color: #fff; } + .tag:not(body).is-link { + background-color: #33B2E8; + color: #fff; } + .tag:not(body).is-info { + background-color: #209cee; + color: #fff; } + .tag:not(body).is-success { + background-color: #23d160; + color: #fff; } + .tag:not(body).is-warning { + background-color: #ffdd57; + color: rgba(0, 0, 0, 0.7); } + .tag:not(body).is-danger { + background-color: #ff3860; + color: #fff; } + .tag:not(body).is-medium { + font-size: 1rem; } + .tag:not(body).is-large { + font-size: 1.25rem; } + .tag:not(body) .icon:first-child:not(:last-child) { + margin-left: -0.375em; + margin-right: 0.1875em; } + .tag:not(body) .icon:last-child:not(:first-child) { + margin-left: 0.1875em; + margin-right: -0.375em; } + .tag:not(body) .icon:first-child:last-child { + margin-left: -0.375em; + margin-right: -0.375em; } + .tag:not(body).is-delete { + margin-left: 1px; + padding: 0; + position: relative; + width: 2em; } + .tag:not(body).is-delete::before, .tag:not(body).is-delete::after { + background-color: currentColor; + content: ""; + display: block; + left: 50%; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%) rotate(45deg); + transform-origin: center center; } + .tag:not(body).is-delete::before { + height: 1px; + width: 50%; } + .tag:not(body).is-delete::after { + height: 50%; + width: 1px; } + .tag:not(body).is-delete:hover, .tag:not(body).is-delete:focus { + background-color: #e8e8e8; } + .tag:not(body).is-delete:active { + background-color: #dbdbdb; } + .tag:not(body).is-rounded { + border-radius: 290486px; } + +a.tag:hover { + text-decoration: underline; } + +.title, +.subtitle { + word-break: break-word; } + .title em, + .title span, + .subtitle em, + .subtitle span { + font-weight: inherit; } + .title sub, + .subtitle sub { + font-size: 0.75em; } + .title sup, + .subtitle sup { + font-size: 0.75em; } + .title .tag, + .subtitle .tag { + vertical-align: middle; } + +.title { + color: #363636; + font-size: 2rem; + font-weight: 600; + line-height: 1.125; } + .title strong { + color: inherit; + font-weight: inherit; } + .title + .highlight { + margin-top: -0.75rem; } + .title:not(.is-spaced) + .subtitle { + margin-top: -1.25rem; } + .title.is-1 { + font-size: 3rem; } + .title.is-2 { + font-size: 2.5rem; } + .title.is-3 { + font-size: 2rem; } + .title.is-4 { + font-size: 1.5rem; } + .title.is-5 { + font-size: 1.25rem; } + .title.is-6 { + font-size: 1rem; } + .title.is-7 { + font-size: 0.75rem; } + +.subtitle { + color: #4a4a4a; + font-size: 1.25rem; + font-weight: 400; + line-height: 1.25; } + .subtitle strong { + color: #363636; + font-weight: 600; } + .subtitle:not(.is-spaced) + .title { + margin-top: -1.25rem; } + .subtitle.is-1 { + font-size: 3rem; } + .subtitle.is-2 { + font-size: 2.5rem; } + .subtitle.is-3 { + font-size: 2rem; } + .subtitle.is-4 { + font-size: 1.5rem; } + .subtitle.is-5 { + font-size: 1.25rem; } + .subtitle.is-6 { + font-size: 1rem; } + .subtitle.is-7 { + font-size: 0.75rem; } + +.heading { + display: block; + font-size: 11px; + letter-spacing: 1px; + margin-bottom: 5px; + text-transform: uppercase; } + +.highlight { + font-weight: 400; + max-width: 100%; + overflow: hidden; + padding: 0; } + .highlight pre { + overflow: auto; + max-width: 100%; } + +.number { + align-items: center; + background-color: whitesmoke; + border-radius: 290486px; + display: inline-flex; + font-size: 1.25rem; + height: 2em; + justify-content: center; + margin-right: 1.5rem; + min-width: 2.5em; + padding: 0.25rem 0.5rem; + text-align: center; + vertical-align: top; } + +.breadcrumb { + font-size: 1rem; + white-space: nowrap; } + .breadcrumb a { + align-items: center; + color: #33B2E8; + display: flex; + justify-content: center; + padding: 0 0.75em; } + .breadcrumb a:hover { + color: #363636; } + .breadcrumb li { + align-items: center; + display: flex; } + .breadcrumb li:first-child a { + padding-left: 0; } + .breadcrumb li.is-active a { + color: #363636; + cursor: default; + pointer-events: none; } + .breadcrumb li + li::before { + color: #b5b5b5; + content: "\0002f"; } + .breadcrumb ul, + .breadcrumb ol { + align-items: flex-start; + display: flex; + flex-wrap: wrap; + justify-content: flex-start; } + .breadcrumb .icon:first-child { + margin-right: 0.5em; } + .breadcrumb .icon:last-child { + margin-left: 0.5em; } + .breadcrumb.is-centered ol, + .breadcrumb.is-centered ul { + justify-content: center; } + .breadcrumb.is-right ol, + .breadcrumb.is-right ul { + justify-content: flex-end; } + .breadcrumb.is-small { + font-size: 0.75rem; } + .breadcrumb.is-medium { + font-size: 1.25rem; } + .breadcrumb.is-large { + font-size: 1.5rem; } + .breadcrumb.has-arrow-separator li + li::before { + content: "\02192"; } + .breadcrumb.has-bullet-separator li + li::before { + content: "\02022"; } + .breadcrumb.has-dot-separator li + li::before { + content: "\000b7"; } + .breadcrumb.has-succeeds-separator li + li::before { + content: "\0227B"; } + +.card { + background-color: white; + box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1); + color: #4a4a4a; + max-width: 100%; + position: relative; } + +.card-header { + background-color: none; + align-items: stretch; + box-shadow: 0 1px 2px rgba(10, 10, 10, 0.1); + display: flex; } + +.card-header-title { + align-items: center; + color: #363636; + display: flex; + flex-grow: 1; + font-weight: 700; + padding: 0.75rem; } + .card-header-title.is-centered { + justify-content: center; } + +.card-header-icon { + align-items: center; + cursor: pointer; + display: flex; + justify-content: center; + padding: 0.75rem; } + +.card-image { + display: block; + position: relative; } + +.card-content { + background-color: none; + padding: 1.5rem; } + +.card-footer { + background-color: none; + border-top: 1px solid #dbdbdb; + align-items: stretch; + display: flex; } + +.card-footer-item { + align-items: center; + display: flex; + flex-basis: 0; + flex-grow: 1; + flex-shrink: 0; + justify-content: center; + padding: 0.75rem; } + .card-footer-item:not(:last-child) { + border-right: 1px solid #dbdbdb; } + +.card .media:not(:last-child) { + margin-bottom: 0.75rem; } + +.dropdown { + display: inline-flex; + position: relative; + vertical-align: top; } + .dropdown.is-active .dropdown-menu, .dropdown.is-hoverable:hover .dropdown-menu { + display: block; } + .dropdown.is-right .dropdown-menu { + left: auto; + right: 0; } + .dropdown.is-up .dropdown-menu { + bottom: 100%; + padding-bottom: 4px; + padding-top: initial; + top: auto; } + +.dropdown-menu { + display: none; + left: 0; + min-width: 12rem; + padding-top: 4px; + position: absolute; + top: 100%; + z-index: 20; } + +.dropdown-content { + background-color: white; + border-radius: 4px; + box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1); + padding-bottom: 0.5rem; + padding-top: 0.5rem; } + +.dropdown-item { + color: #4a4a4a; + display: block; + font-size: 0.875rem; + line-height: 1.5; + padding: 0.375rem 1rem; + position: relative; } + +a.dropdown-item { + padding-right: 3rem; + white-space: nowrap; } + a.dropdown-item:hover { + background-color: whitesmoke; + color: #0a0a0a; } + a.dropdown-item.is-active { + background-color: #33B2E8; + color: #fff; } + +.dropdown-divider { + background-color: #dbdbdb; + border: none; + display: block; + height: 1px; + margin: 0.5rem 0; } + +.level { + align-items: center; + justify-content: space-between; } + .level code { + border-radius: 4px; } + .level img { + display: inline-block; + vertical-align: top; } + .level.is-mobile { + display: flex; } + .level.is-mobile .level-left, + .level.is-mobile .level-right { + display: flex; } + .level.is-mobile .level-left + .level-right { + margin-top: 0; } + .level.is-mobile .level-item { + margin-right: 0.75rem; } + .level.is-mobile .level-item:not(:last-child) { + margin-bottom: 0; } + .level.is-mobile .level-item:not(.is-narrow) { + flex-grow: 1; } + @media screen and (min-width: 769px), print { + .level { + display: flex; } + .level > .level-item:not(.is-narrow) { + flex-grow: 1; } } + +.level-item { + align-items: center; + display: flex; + flex-basis: auto; + flex-grow: 0; + flex-shrink: 0; + justify-content: center; } + .level-item .title, + .level-item .subtitle { + margin-bottom: 0; } + @media screen and (max-width: 768px) { + .level-item:not(:last-child) { + margin-bottom: 0.75rem; } } + +.level-left, +.level-right { + flex-basis: auto; + flex-grow: 0; + flex-shrink: 0; } + .level-left .level-item.is-flexible, + .level-right .level-item.is-flexible { + flex-grow: 1; } + @media screen and (min-width: 769px), print { + .level-left .level-item:not(:last-child), + .level-right .level-item:not(:last-child) { + margin-right: 0.75rem; } } + +.level-left { + align-items: center; + justify-content: flex-start; } + @media screen and (max-width: 768px) { + .level-left + .level-right { + margin-top: 1.5rem; } } + @media screen and (min-width: 769px), print { + .level-left { + display: flex; } } + +.level-right { + align-items: center; + justify-content: flex-end; } + @media screen and (min-width: 769px), print { + .level-right { + display: flex; } } + +.media { + align-items: flex-start; + display: flex; + text-align: left; } + .media .content:not(:last-child) { + margin-bottom: 0.75rem; } + .media .media { + border-top: 1px solid rgba(219, 219, 219, 0.5); + display: flex; + padding-top: 0.75rem; } + .media .media .content:not(:last-child), + .media .media .control:not(:last-child) { + margin-bottom: 0.5rem; } + .media .media .media { + padding-top: 0.5rem; } + .media .media .media + .media { + margin-top: 0.5rem; } + .media + .media { + border-top: 1px solid rgba(219, 219, 219, 0.5); + margin-top: 1rem; + padding-top: 1rem; } + .media.is-large + .media { + margin-top: 1.5rem; + padding-top: 1.5rem; } + +.media-left, +.media-right { + flex-basis: auto; + flex-grow: 0; + flex-shrink: 0; } + +.media-left { + margin-right: 1rem; } + +.media-right { + margin-left: 1rem; } + +.media-content { + flex-basis: auto; + flex-grow: 1; + flex-shrink: 1; + text-align: left; } + +.menu { + font-size: 1rem; } + .menu.is-small { + font-size: 0.75rem; } + .menu.is-medium { + font-size: 1.25rem; } + .menu.is-large { + font-size: 1.5rem; } + +.menu-list { + line-height: 1.25; } + .menu-list a { + border-radius: 2px; + color: #4a4a4a; + display: block; + padding: 0.5em 0.75em; } + .menu-list a:hover { + background-color: whitesmoke; + color: #363636; } + .menu-list a.is-active { + background-color: #33B2E8; + color: #fff; } + .menu-list li ul { + border-left: 1px solid #dbdbdb; + margin: 0.75em; + padding-left: 0.75em; } + +.menu-label { + color: #7a7a7a; + font-size: 0.75em; + letter-spacing: 0.1em; + text-transform: uppercase; } + .menu-label:not(:first-child) { + margin-top: 1em; } + .menu-label:not(:last-child) { + margin-bottom: 1em; } + +.message { + background-color: whitesmoke; + border-radius: 4px; + font-size: 1rem; } + .message strong { + color: currentColor; } + .message a:not(.button):not(.tag) { + color: currentColor; + text-decoration: underline; } + .message.is-small { + font-size: 0.75rem; } + .message.is-medium { + font-size: 1.25rem; } + .message.is-large { + font-size: 1.5rem; } + .message.is-white { + background-color: white; } + .message.is-white .message-header { + background-color: white; + color: #0a0a0a; } + .message.is-white .message-body { + border-color: white; + color: #4d4d4d; } + .message.is-black { + background-color: #fafafa; } + .message.is-black .message-header { + background-color: #0a0a0a; + color: white; } + .message.is-black .message-body { + border-color: #0a0a0a; + color: #090909; } + .message.is-light { + background-color: #fafafa; } + .message.is-light .message-header { + background-color: whitesmoke; + color: #363636; } + .message.is-light .message-body { + border-color: whitesmoke; + color: #505050; } + .message.is-dark { + background-color: #fafafa; } + .message.is-dark .message-header { + background-color: #363636; + color: whitesmoke; } + .message.is-dark .message-body { + border-color: #363636; + color: #2a2a2a; } + .message.is-primary { + background-color: #f5fffd; } + .message.is-primary .message-header { + background-color: #00d1b2; + color: #fff; } + .message.is-primary .message-body { + border-color: #00d1b2; + color: #021310; } + .message.is-link { + background-color: #f6fcfe; } + .message.is-link .message-header { + background-color: #33B2E8; + color: #fff; } + .message.is-link .message-body { + border-color: #33B2E8; + color: #15516a; } + .message.is-info { + background-color: #f6fbfe; } + .message.is-info .message-header { + background-color: #209cee; + color: #fff; } + .message.is-info .message-body { + border-color: #209cee; + color: #12537e; } + .message.is-success { + background-color: #f6fef9; } + .message.is-success .message-header { + background-color: #23d160; + color: #fff; } + .message.is-success .message-body { + border-color: #23d160; + color: #0e301a; } + .message.is-warning { + background-color: #fffdf5; } + .message.is-warning .message-header { + background-color: #ffdd57; + color: rgba(0, 0, 0, 0.7); } + .message.is-warning .message-body { + border-color: #ffdd57; + color: #3b3108; } + .message.is-danger { + background-color: #fff5f7; } + .message.is-danger .message-header { + background-color: #ff3860; + color: #fff; } + .message.is-danger .message-body { + border-color: #ff3860; + color: #cd0930; } + +.message-header { + align-items: center; + background-color: #4a4a4a; + border-radius: 4px 4px 0 0; + color: #fff; + display: flex; + font-weight: 700; + justify-content: space-between; + line-height: 1.25; + padding: 0.75em 1em; + position: relative; } + .message-header .delete { + flex-grow: 0; + flex-shrink: 0; + margin-left: 0.75em; } + .message-header + .message-body { + border-width: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; } + +.message-body { + border-color: #dbdbdb; + border-radius: 4px; + border-style: solid; + border-width: 0 0 0 4px; + color: #4a4a4a; + padding: 1.25em 1.5em; } + .message-body code, + .message-body pre { + background-color: white; } + .message-body pre code { + background-color: transparent; } + +.modal { + align-items: center; + display: none; + justify-content: center; + overflow: hidden; + position: fixed; + z-index: 40; } + .modal.is-active { + display: flex; } + +.modal-background { + background-color: rgba(10, 10, 10, 0.86); } + +.modal-content, +.modal-card { + margin: 0 20px; + max-height: calc(100vh - 160px); + overflow: auto; + position: relative; + width: 100%; } + @media screen and (min-width: 769px), print { + .modal-content, + .modal-card { + margin: 0 auto; + max-height: calc(100vh - 40px); + width: 640px; } } + +.modal-close { + background: none; + height: 40px; + position: fixed; + right: 20px; + top: 20px; + width: 40px; } + +.modal-card { + display: flex; + flex-direction: column; + max-height: calc(100vh - 40px); + overflow: hidden; } + +.modal-card-head, +.modal-card-foot { + align-items: center; + background-color: whitesmoke; + display: flex; + flex-shrink: 0; + justify-content: flex-start; + padding: 20px; + position: relative; } + +.modal-card-head { + border-bottom: 1px solid #dbdbdb; + border-top-left-radius: 6px; + border-top-right-radius: 6px; } + +.modal-card-title { + color: #363636; + flex-grow: 1; + flex-shrink: 0; + font-size: 1.5rem; + line-height: 1; } + +.modal-card-foot { + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + border-top: 1px solid #dbdbdb; } + .modal-card-foot .button:not(:last-child) { + margin-right: 10px; } + +.modal-card-body { + -webkit-overflow-scrolling: touch; + background-color: white; + flex-grow: 1; + flex-shrink: 1; + overflow: auto; + padding: 20px; } + +.navbar { + background-color: white; + min-height: 3.25rem; + position: relative; + z-index: 30; } + .navbar.is-white { + background-color: white; + color: #0a0a0a; } + .navbar.is-white .navbar-brand > .navbar-item, + .navbar.is-white .navbar-brand .navbar-link { + color: #0a0a0a; } + .navbar.is-white .navbar-brand > a.navbar-item:hover, .navbar.is-white .navbar-brand > a.navbar-item.is-active, + .navbar.is-white .navbar-brand .navbar-link:hover, + .navbar.is-white .navbar-brand .navbar-link.is-active { + background-color: #f2f2f2; + color: #0a0a0a; } + .navbar.is-white .navbar-brand .navbar-link::after { + border-color: #0a0a0a; } + @media screen and (min-width: 1088px) { + .navbar.is-white .navbar-start > .navbar-item, + .navbar.is-white .navbar-start .navbar-link, + .navbar.is-white .navbar-end > .navbar-item, + .navbar.is-white .navbar-end .navbar-link { + color: #0a0a0a; } + .navbar.is-white .navbar-start > a.navbar-item:hover, .navbar.is-white .navbar-start > a.navbar-item.is-active, + .navbar.is-white .navbar-start .navbar-link:hover, + .navbar.is-white .navbar-start .navbar-link.is-active, + .navbar.is-white .navbar-end > a.navbar-item:hover, + .navbar.is-white .navbar-end > a.navbar-item.is-active, + .navbar.is-white .navbar-end .navbar-link:hover, + .navbar.is-white .navbar-end .navbar-link.is-active { + background-color: #f2f2f2; + color: #0a0a0a; } + .navbar.is-white .navbar-start .navbar-link::after, + .navbar.is-white .navbar-end .navbar-link::after { + border-color: #0a0a0a; } + .navbar.is-white .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-white .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #f2f2f2; + color: #0a0a0a; } + .navbar.is-white .navbar-dropdown a.navbar-item.is-active { + background-color: white; + color: #0a0a0a; } } + .navbar.is-black { + background-color: #0a0a0a; + color: white; } + .navbar.is-black .navbar-brand > .navbar-item, + .navbar.is-black .navbar-brand .navbar-link { + color: white; } + .navbar.is-black .navbar-brand > a.navbar-item:hover, .navbar.is-black .navbar-brand > a.navbar-item.is-active, + .navbar.is-black .navbar-brand .navbar-link:hover, + .navbar.is-black .navbar-brand .navbar-link.is-active { + background-color: black; + color: white; } + .navbar.is-black .navbar-brand .navbar-link::after { + border-color: white; } + @media screen and (min-width: 1088px) { + .navbar.is-black .navbar-start > .navbar-item, + .navbar.is-black .navbar-start .navbar-link, + .navbar.is-black .navbar-end > .navbar-item, + .navbar.is-black .navbar-end .navbar-link { + color: white; } + .navbar.is-black .navbar-start > a.navbar-item:hover, .navbar.is-black .navbar-start > a.navbar-item.is-active, + .navbar.is-black .navbar-start .navbar-link:hover, + .navbar.is-black .navbar-start .navbar-link.is-active, + .navbar.is-black .navbar-end > a.navbar-item:hover, + .navbar.is-black .navbar-end > a.navbar-item.is-active, + .navbar.is-black .navbar-end .navbar-link:hover, + .navbar.is-black .navbar-end .navbar-link.is-active { + background-color: black; + color: white; } + .navbar.is-black .navbar-start .navbar-link::after, + .navbar.is-black .navbar-end .navbar-link::after { + border-color: white; } + .navbar.is-black .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-black .navbar-item.has-dropdown.is-active .navbar-link { + background-color: black; + color: white; } + .navbar.is-black .navbar-dropdown a.navbar-item.is-active { + background-color: #0a0a0a; + color: white; } } + .navbar.is-light { + background-color: whitesmoke; + color: #363636; } + .navbar.is-light .navbar-brand > .navbar-item, + .navbar.is-light .navbar-brand .navbar-link { + color: #363636; } + .navbar.is-light .navbar-brand > a.navbar-item:hover, .navbar.is-light .navbar-brand > a.navbar-item.is-active, + .navbar.is-light .navbar-brand .navbar-link:hover, + .navbar.is-light .navbar-brand .navbar-link.is-active { + background-color: #e8e8e8; + color: #363636; } + .navbar.is-light .navbar-brand .navbar-link::after { + border-color: #363636; } + @media screen and (min-width: 1088px) { + .navbar.is-light .navbar-start > .navbar-item, + .navbar.is-light .navbar-start .navbar-link, + .navbar.is-light .navbar-end > .navbar-item, + .navbar.is-light .navbar-end .navbar-link { + color: #363636; } + .navbar.is-light .navbar-start > a.navbar-item:hover, .navbar.is-light .navbar-start > a.navbar-item.is-active, + .navbar.is-light .navbar-start .navbar-link:hover, + .navbar.is-light .navbar-start .navbar-link.is-active, + .navbar.is-light .navbar-end > a.navbar-item:hover, + .navbar.is-light .navbar-end > a.navbar-item.is-active, + .navbar.is-light .navbar-end .navbar-link:hover, + .navbar.is-light .navbar-end .navbar-link.is-active { + background-color: #e8e8e8; + color: #363636; } + .navbar.is-light .navbar-start .navbar-link::after, + .navbar.is-light .navbar-end .navbar-link::after { + border-color: #363636; } + .navbar.is-light .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-light .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #e8e8e8; + color: #363636; } + .navbar.is-light .navbar-dropdown a.navbar-item.is-active { + background-color: whitesmoke; + color: #363636; } } + .navbar.is-dark { + background-color: #363636; + color: whitesmoke; } + .navbar.is-dark .navbar-brand > .navbar-item, + .navbar.is-dark .navbar-brand .navbar-link { + color: whitesmoke; } + .navbar.is-dark .navbar-brand > a.navbar-item:hover, .navbar.is-dark .navbar-brand > a.navbar-item.is-active, + .navbar.is-dark .navbar-brand .navbar-link:hover, + .navbar.is-dark .navbar-brand .navbar-link.is-active { + background-color: #292929; + color: whitesmoke; } + .navbar.is-dark .navbar-brand .navbar-link::after { + border-color: whitesmoke; } + @media screen and (min-width: 1088px) { + .navbar.is-dark .navbar-start > .navbar-item, + .navbar.is-dark .navbar-start .navbar-link, + .navbar.is-dark .navbar-end > .navbar-item, + .navbar.is-dark .navbar-end .navbar-link { + color: whitesmoke; } + .navbar.is-dark .navbar-start > a.navbar-item:hover, .navbar.is-dark .navbar-start > a.navbar-item.is-active, + .navbar.is-dark .navbar-start .navbar-link:hover, + .navbar.is-dark .navbar-start .navbar-link.is-active, + .navbar.is-dark .navbar-end > a.navbar-item:hover, + .navbar.is-dark .navbar-end > a.navbar-item.is-active, + .navbar.is-dark .navbar-end .navbar-link:hover, + .navbar.is-dark .navbar-end .navbar-link.is-active { + background-color: #292929; + color: whitesmoke; } + .navbar.is-dark .navbar-start .navbar-link::after, + .navbar.is-dark .navbar-end .navbar-link::after { + border-color: whitesmoke; } + .navbar.is-dark .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-dark .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #292929; + color: whitesmoke; } + .navbar.is-dark .navbar-dropdown a.navbar-item.is-active { + background-color: #363636; + color: whitesmoke; } } + .navbar.is-primary { + background-color: #00d1b2; + color: #fff; } + .navbar.is-primary .navbar-brand > .navbar-item, + .navbar.is-primary .navbar-brand .navbar-link { + color: #fff; } + .navbar.is-primary .navbar-brand > a.navbar-item:hover, .navbar.is-primary .navbar-brand > a.navbar-item.is-active, + .navbar.is-primary .navbar-brand .navbar-link:hover, + .navbar.is-primary .navbar-brand .navbar-link.is-active { + background-color: #00b89c; + color: #fff; } + .navbar.is-primary .navbar-brand .navbar-link::after { + border-color: #fff; } + @media screen and (min-width: 1088px) { + .navbar.is-primary .navbar-start > .navbar-item, + .navbar.is-primary .navbar-start .navbar-link, + .navbar.is-primary .navbar-end > .navbar-item, + .navbar.is-primary .navbar-end .navbar-link { + color: #fff; } + .navbar.is-primary .navbar-start > a.navbar-item:hover, .navbar.is-primary .navbar-start > a.navbar-item.is-active, + .navbar.is-primary .navbar-start .navbar-link:hover, + .navbar.is-primary .navbar-start .navbar-link.is-active, + .navbar.is-primary .navbar-end > a.navbar-item:hover, + .navbar.is-primary .navbar-end > a.navbar-item.is-active, + .navbar.is-primary .navbar-end .navbar-link:hover, + .navbar.is-primary .navbar-end .navbar-link.is-active { + background-color: #00b89c; + color: #fff; } + .navbar.is-primary .navbar-start .navbar-link::after, + .navbar.is-primary .navbar-end .navbar-link::after { + border-color: #fff; } + .navbar.is-primary .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-primary .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #00b89c; + color: #fff; } + .navbar.is-primary .navbar-dropdown a.navbar-item.is-active { + background-color: #00d1b2; + color: #fff; } } + .navbar.is-link { + background-color: #33B2E8; + color: #fff; } + .navbar.is-link .navbar-brand > .navbar-item, + .navbar.is-link .navbar-brand .navbar-link { + color: #fff; } + .navbar.is-link .navbar-brand > a.navbar-item:hover, .navbar.is-link .navbar-brand > a.navbar-item.is-active, + .navbar.is-link .navbar-brand .navbar-link:hover, + .navbar.is-link .navbar-brand .navbar-link.is-active { + background-color: #1ca9e5; + color: #fff; } + .navbar.is-link .navbar-brand .navbar-link::after { + border-color: #fff; } + @media screen and (min-width: 1088px) { + .navbar.is-link .navbar-start > .navbar-item, + .navbar.is-link .navbar-start .navbar-link, + .navbar.is-link .navbar-end > .navbar-item, + .navbar.is-link .navbar-end .navbar-link { + color: #fff; } + .navbar.is-link .navbar-start > a.navbar-item:hover, .navbar.is-link .navbar-start > a.navbar-item.is-active, + .navbar.is-link .navbar-start .navbar-link:hover, + .navbar.is-link .navbar-start .navbar-link.is-active, + .navbar.is-link .navbar-end > a.navbar-item:hover, + .navbar.is-link .navbar-end > a.navbar-item.is-active, + .navbar.is-link .navbar-end .navbar-link:hover, + .navbar.is-link .navbar-end .navbar-link.is-active { + background-color: #1ca9e5; + color: #fff; } + .navbar.is-link .navbar-start .navbar-link::after, + .navbar.is-link .navbar-end .navbar-link::after { + border-color: #fff; } + .navbar.is-link .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-link .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #1ca9e5; + color: #fff; } + .navbar.is-link .navbar-dropdown a.navbar-item.is-active { + background-color: #33B2E8; + color: #fff; } } + .navbar.is-info { + background-color: #209cee; + color: #fff; } + .navbar.is-info .navbar-brand > .navbar-item, + .navbar.is-info .navbar-brand .navbar-link { + color: #fff; } + .navbar.is-info .navbar-brand > a.navbar-item:hover, .navbar.is-info .navbar-brand > a.navbar-item.is-active, + .navbar.is-info .navbar-brand .navbar-link:hover, + .navbar.is-info .navbar-brand .navbar-link.is-active { + background-color: #118fe4; + color: #fff; } + .navbar.is-info .navbar-brand .navbar-link::after { + border-color: #fff; } + @media screen and (min-width: 1088px) { + .navbar.is-info .navbar-start > .navbar-item, + .navbar.is-info .navbar-start .navbar-link, + .navbar.is-info .navbar-end > .navbar-item, + .navbar.is-info .navbar-end .navbar-link { + color: #fff; } + .navbar.is-info .navbar-start > a.navbar-item:hover, .navbar.is-info .navbar-start > a.navbar-item.is-active, + .navbar.is-info .navbar-start .navbar-link:hover, + .navbar.is-info .navbar-start .navbar-link.is-active, + .navbar.is-info .navbar-end > a.navbar-item:hover, + .navbar.is-info .navbar-end > a.navbar-item.is-active, + .navbar.is-info .navbar-end .navbar-link:hover, + .navbar.is-info .navbar-end .navbar-link.is-active { + background-color: #118fe4; + color: #fff; } + .navbar.is-info .navbar-start .navbar-link::after, + .navbar.is-info .navbar-end .navbar-link::after { + border-color: #fff; } + .navbar.is-info .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-info .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #118fe4; + color: #fff; } + .navbar.is-info .navbar-dropdown a.navbar-item.is-active { + background-color: #209cee; + color: #fff; } } + .navbar.is-success { + background-color: #23d160; + color: #fff; } + .navbar.is-success .navbar-brand > .navbar-item, + .navbar.is-success .navbar-brand .navbar-link { + color: #fff; } + .navbar.is-success .navbar-brand > a.navbar-item:hover, .navbar.is-success .navbar-brand > a.navbar-item.is-active, + .navbar.is-success .navbar-brand .navbar-link:hover, + .navbar.is-success .navbar-brand .navbar-link.is-active { + background-color: #20bc56; + color: #fff; } + .navbar.is-success .navbar-brand .navbar-link::after { + border-color: #fff; } + @media screen and (min-width: 1088px) { + .navbar.is-success .navbar-start > .navbar-item, + .navbar.is-success .navbar-start .navbar-link, + .navbar.is-success .navbar-end > .navbar-item, + .navbar.is-success .navbar-end .navbar-link { + color: #fff; } + .navbar.is-success .navbar-start > a.navbar-item:hover, .navbar.is-success .navbar-start > a.navbar-item.is-active, + .navbar.is-success .navbar-start .navbar-link:hover, + .navbar.is-success .navbar-start .navbar-link.is-active, + .navbar.is-success .navbar-end > a.navbar-item:hover, + .navbar.is-success .navbar-end > a.navbar-item.is-active, + .navbar.is-success .navbar-end .navbar-link:hover, + .navbar.is-success .navbar-end .navbar-link.is-active { + background-color: #20bc56; + color: #fff; } + .navbar.is-success .navbar-start .navbar-link::after, + .navbar.is-success .navbar-end .navbar-link::after { + border-color: #fff; } + .navbar.is-success .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-success .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #20bc56; + color: #fff; } + .navbar.is-success .navbar-dropdown a.navbar-item.is-active { + background-color: #23d160; + color: #fff; } } + .navbar.is-warning { + background-color: #ffdd57; + color: rgba(0, 0, 0, 0.7); } + .navbar.is-warning .navbar-brand > .navbar-item, + .navbar.is-warning .navbar-brand .navbar-link { + color: rgba(0, 0, 0, 0.7); } + .navbar.is-warning .navbar-brand > a.navbar-item:hover, .navbar.is-warning .navbar-brand > a.navbar-item.is-active, + .navbar.is-warning .navbar-brand .navbar-link:hover, + .navbar.is-warning .navbar-brand .navbar-link.is-active { + background-color: #ffd83d; + color: rgba(0, 0, 0, 0.7); } + .navbar.is-warning .navbar-brand .navbar-link::after { + border-color: rgba(0, 0, 0, 0.7); } + @media screen and (min-width: 1088px) { + .navbar.is-warning .navbar-start > .navbar-item, + .navbar.is-warning .navbar-start .navbar-link, + .navbar.is-warning .navbar-end > .navbar-item, + .navbar.is-warning .navbar-end .navbar-link { + color: rgba(0, 0, 0, 0.7); } + .navbar.is-warning .navbar-start > a.navbar-item:hover, .navbar.is-warning .navbar-start > a.navbar-item.is-active, + .navbar.is-warning .navbar-start .navbar-link:hover, + .navbar.is-warning .navbar-start .navbar-link.is-active, + .navbar.is-warning .navbar-end > a.navbar-item:hover, + .navbar.is-warning .navbar-end > a.navbar-item.is-active, + .navbar.is-warning .navbar-end .navbar-link:hover, + .navbar.is-warning .navbar-end .navbar-link.is-active { + background-color: #ffd83d; + color: rgba(0, 0, 0, 0.7); } + .navbar.is-warning .navbar-start .navbar-link::after, + .navbar.is-warning .navbar-end .navbar-link::after { + border-color: rgba(0, 0, 0, 0.7); } + .navbar.is-warning .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-warning .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #ffd83d; + color: rgba(0, 0, 0, 0.7); } + .navbar.is-warning .navbar-dropdown a.navbar-item.is-active { + background-color: #ffdd57; + color: rgba(0, 0, 0, 0.7); } } + .navbar.is-danger { + background-color: #ff3860; + color: #fff; } + .navbar.is-danger .navbar-brand > .navbar-item, + .navbar.is-danger .navbar-brand .navbar-link { + color: #fff; } + .navbar.is-danger .navbar-brand > a.navbar-item:hover, .navbar.is-danger .navbar-brand > a.navbar-item.is-active, + .navbar.is-danger .navbar-brand .navbar-link:hover, + .navbar.is-danger .navbar-brand .navbar-link.is-active { + background-color: #ff1f4b; + color: #fff; } + .navbar.is-danger .navbar-brand .navbar-link::after { + border-color: #fff; } + @media screen and (min-width: 1088px) { + .navbar.is-danger .navbar-start > .navbar-item, + .navbar.is-danger .navbar-start .navbar-link, + .navbar.is-danger .navbar-end > .navbar-item, + .navbar.is-danger .navbar-end .navbar-link { + color: #fff; } + .navbar.is-danger .navbar-start > a.navbar-item:hover, .navbar.is-danger .navbar-start > a.navbar-item.is-active, + .navbar.is-danger .navbar-start .navbar-link:hover, + .navbar.is-danger .navbar-start .navbar-link.is-active, + .navbar.is-danger .navbar-end > a.navbar-item:hover, + .navbar.is-danger .navbar-end > a.navbar-item.is-active, + .navbar.is-danger .navbar-end .navbar-link:hover, + .navbar.is-danger .navbar-end .navbar-link.is-active { + background-color: #ff1f4b; + color: #fff; } + .navbar.is-danger .navbar-start .navbar-link::after, + .navbar.is-danger .navbar-end .navbar-link::after { + border-color: #fff; } + .navbar.is-danger .navbar-item.has-dropdown:hover .navbar-link, + .navbar.is-danger .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #ff1f4b; + color: #fff; } + .navbar.is-danger .navbar-dropdown a.navbar-item.is-active { + background-color: #ff3860; + color: #fff; } } + .navbar > .container { + align-items: stretch; + display: flex; + min-height: 3.25rem; + width: 100%; } + .navbar.has-shadow { + box-shadow: 0 2px 0 0 whitesmoke; } + .navbar.is-fixed-bottom, .navbar.is-fixed-top { + left: 0; + position: fixed; + right: 0; + z-index: 30; } + .navbar.is-fixed-bottom { + bottom: 0; } + .navbar.is-fixed-bottom.has-shadow { + box-shadow: 0 -2px 0 0 whitesmoke; } + .navbar.is-fixed-top { + top: 0; } + +html.has-navbar-fixed-top, +body.has-navbar-fixed-top { + padding-top: 3.25rem; } + +html.has-navbar-fixed-bottom, +body.has-navbar-fixed-bottom { + padding-bottom: 3.25rem; } + +.navbar-brand, +.navbar-tabs { + align-items: stretch; + display: flex; + flex-shrink: 0; + min-height: 3.25rem; } + +.navbar-brand a.navbar-item:hover { + background-color: transparent; } + +.navbar-tabs { + -webkit-overflow-scrolling: touch; + max-width: 100vw; + overflow-x: auto; + overflow-y: hidden; } + +.navbar-burger { + cursor: pointer; + display: block; + height: 3.25rem; + position: relative; + width: 3.25rem; + margin-left: auto; } + .navbar-burger span { + background-color: currentColor; + display: block; + height: 1px; + left: calc(50% - 8px); + position: absolute; + transform-origin: center; + transition-duration: 86ms; + transition-property: background-color, opacity, transform; + transition-timing-function: ease-out; + width: 16px; } + .navbar-burger span:nth-child(1) { + top: calc(50% - 6px); } + .navbar-burger span:nth-child(2) { + top: calc(50% - 1px); } + .navbar-burger span:nth-child(3) { + top: calc(50% + 4px); } + .navbar-burger:hover { + background-color: rgba(0, 0, 0, 0.05); } + .navbar-burger.is-active span:nth-child(1) { + transform: translateY(5px) rotate(45deg); } + .navbar-burger.is-active span:nth-child(2) { + opacity: 0; } + .navbar-burger.is-active span:nth-child(3) { + transform: translateY(-5px) rotate(-45deg); } + +.navbar-menu { + display: none; } + +.navbar-item, +.navbar-link { + color: #4a4a4a; + display: block; + line-height: 1.5; + padding: 0.5rem 0.75rem; + position: relative; } + .navbar-item .icon:only-child, + .navbar-link .icon:only-child { + margin-left: -0.25rem; + margin-right: -0.25rem; } + +a.navbar-item, +.navbar-link { + cursor: pointer; } + a.navbar-item:hover, a.navbar-item.is-active, + .navbar-link:hover, + .navbar-link.is-active { + background-color: #fafafa; + color: #33B2E8; } + +.navbar-item { + display: block; + flex-grow: 0; + flex-shrink: 0; } + .navbar-item img { + max-height: 1.75rem; } + .navbar-item.has-dropdown { + padding: 0; } + .navbar-item.is-expanded { + flex-grow: 1; + flex-shrink: 1; } + .navbar-item.is-tab { + border-bottom: 1px solid transparent; + min-height: 3.25rem; + padding-bottom: calc(0.5rem - 1px); } + .navbar-item.is-tab:hover { + background-color: transparent; + border-bottom-color: #33B2E8; } + .navbar-item.is-tab.is-active { + background-color: transparent; + border-bottom-color: #33B2E8; + border-bottom-style: solid; + border-bottom-width: 3px; + color: #33B2E8; + padding-bottom: calc(0.5rem - 3px); } + +.navbar-content { + flex-grow: 1; + flex-shrink: 1; } + +.navbar-link { + padding-right: 2.5em; } + .navbar-link::after { + border-color: #33B2E8; + margin-top: -0.375em; + right: 1.125em; } + +.navbar-dropdown { + font-size: 0.875rem; + padding-bottom: 0.5rem; + padding-top: 0.5rem; } + .navbar-dropdown .navbar-item { + padding-left: 1.5rem; + padding-right: 1.5rem; } + +.navbar-divider { + background-color: whitesmoke; + border: none; + display: none; + height: 2px; + margin: 0.5rem 0; } + +@media screen and (max-width: 1087px) { + .navbar > .container { + display: block; } + .navbar-brand .navbar-item, + .navbar-tabs .navbar-item { + align-items: center; + display: flex; } + .navbar-link::after { + display: none; } + .navbar-menu { + background-color: white; + box-shadow: 0 8px 16px rgba(10, 10, 10, 0.1); + padding: 0.5rem 0; } + .navbar-menu.is-active { + display: block; } + .navbar.is-fixed-bottom-touch, .navbar.is-fixed-top-touch { + left: 0; + position: fixed; + right: 0; + z-index: 30; } + .navbar.is-fixed-bottom-touch { + bottom: 0; } + .navbar.is-fixed-bottom-touch.has-shadow { + box-shadow: 0 -2px 3px rgba(10, 10, 10, 0.1); } + .navbar.is-fixed-top-touch { + top: 0; } + .navbar.is-fixed-top .navbar-menu, .navbar.is-fixed-top-touch .navbar-menu { + -webkit-overflow-scrolling: touch; + max-height: calc(100vh - 3.25rem); + overflow: auto; } + html.has-navbar-fixed-top-touch, + body.has-navbar-fixed-top-touch { + padding-top: 3.25rem; } + html.has-navbar-fixed-bottom-touch, + body.has-navbar-fixed-bottom-touch { + padding-bottom: 3.25rem; } } + +@media screen and (min-width: 1088px) { + .navbar, + .navbar-menu, + .navbar-start, + .navbar-end { + align-items: stretch; + display: flex; } + .navbar { + min-height: 3.25rem; } + .navbar.is-spaced { + padding: 1rem 2rem; } + .navbar.is-spaced .navbar-start, + .navbar.is-spaced .navbar-end { + align-items: center; } + .navbar.is-spaced a.navbar-item, + .navbar.is-spaced .navbar-link { + border-radius: 4px; } + .navbar.is-transparent a.navbar-item:hover, .navbar.is-transparent a.navbar-item.is-active, + .navbar.is-transparent .navbar-link:hover, + .navbar.is-transparent .navbar-link.is-active { + background-color: transparent !important; } + .navbar.is-transparent .navbar-item.has-dropdown.is-active .navbar-link, .navbar.is-transparent .navbar-item.has-dropdown.is-hoverable:hover .navbar-link { + background-color: transparent !important; } + .navbar.is-transparent .navbar-dropdown a.navbar-item:hover { + background-color: whitesmoke; + color: #0a0a0a; } + .navbar.is-transparent .navbar-dropdown a.navbar-item.is-active { + background-color: whitesmoke; + color: #33B2E8; } + .navbar-burger { + display: none; } + .navbar-item, + .navbar-link { + align-items: center; + display: flex; } + .navbar-item { + display: flex; } + .navbar-item.has-dropdown { + align-items: stretch; } + .navbar-item.has-dropdown-up .navbar-link::after { + transform: rotate(135deg) translate(0.25em, -0.25em); } + .navbar-item.has-dropdown-up .navbar-dropdown { + border-bottom: 2px solid #dbdbdb; + border-radius: 6px 6px 0 0; + border-top: none; + bottom: 100%; + box-shadow: 0 -8px 8px rgba(10, 10, 10, 0.1); + top: auto; } + .navbar-item.is-active .navbar-dropdown, .navbar-item.is-hoverable:hover .navbar-dropdown { + display: block; } + .navbar.is-spaced .navbar-item.is-active .navbar-dropdown, .navbar-item.is-active .navbar-dropdown.is-boxed, .navbar.is-spaced .navbar-item.is-hoverable:hover .navbar-dropdown, .navbar-item.is-hoverable:hover .navbar-dropdown.is-boxed { + opacity: 1; + pointer-events: auto; + transform: translateY(0); } + .navbar-menu { + flex-grow: 1; + flex-shrink: 0; } + .navbar-start { + justify-content: flex-start; + margin-right: auto; } + .navbar-end { + justify-content: flex-end; + margin-left: auto; } + .navbar-dropdown { + background-color: white; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + border-top: 2px solid #dbdbdb; + box-shadow: 0 8px 8px rgba(10, 10, 10, 0.1); + display: none; + font-size: 0.875rem; + left: 0; + min-width: 100%; + position: absolute; + top: 100%; + z-index: 20; } + .navbar-dropdown .navbar-item { + padding: 0.375rem 1rem; + white-space: nowrap; } + .navbar-dropdown a.navbar-item { + padding-right: 3rem; } + .navbar-dropdown a.navbar-item:hover { + background-color: whitesmoke; + color: #0a0a0a; } + .navbar-dropdown a.navbar-item.is-active { + background-color: whitesmoke; + color: #33B2E8; } + .navbar.is-spaced .navbar-dropdown, .navbar-dropdown.is-boxed { + border-radius: 6px; + border-top: none; + box-shadow: 0 8px 8px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1); + display: block; + opacity: 0; + pointer-events: none; + top: calc(100% + (-4px)); + transform: translateY(-5px); + transition-duration: 86ms; + transition-property: opacity, transform; } + .navbar-dropdown.is-right { + left: auto; + right: 0; } + .navbar-divider { + display: block; } + .navbar > .container .navbar-brand, + .container > .navbar .navbar-brand { + margin-left: -1rem; } + .navbar > .container .navbar-menu, + .container > .navbar .navbar-menu { + margin-right: -1rem; } + .navbar.is-fixed-bottom-desktop, .navbar.is-fixed-top-desktop { + left: 0; + position: fixed; + right: 0; + z-index: 30; } + .navbar.is-fixed-bottom-desktop { + bottom: 0; } + .navbar.is-fixed-bottom-desktop.has-shadow { + box-shadow: 0 -2px 3px rgba(10, 10, 10, 0.1); } + .navbar.is-fixed-top-desktop { + top: 0; } + html.has-navbar-fixed-top-desktop, + body.has-navbar-fixed-top-desktop { + padding-top: 3.25rem; } + html.has-navbar-fixed-bottom-desktop, + body.has-navbar-fixed-bottom-desktop { + padding-bottom: 3.25rem; } + html.has-spaced-navbar-fixed-top, + body.has-spaced-navbar-fixed-top { + padding-top: 5.25rem; } + html.has-spaced-navbar-fixed-bottom, + body.has-spaced-navbar-fixed-bottom { + padding-bottom: 5.25rem; } + a.navbar-item.is-active, + .navbar-link.is-active { + color: #0a0a0a; } + a.navbar-item.is-active:not(:hover), + .navbar-link.is-active:not(:hover) { + background-color: transparent; } + .navbar-item.has-dropdown:hover .navbar-link, .navbar-item.has-dropdown.is-active .navbar-link { + background-color: #fafafa; } } + +.pagination { + font-size: 1rem; + margin: -0.25rem; } + .pagination.is-small { + font-size: 0.75rem; } + .pagination.is-medium { + font-size: 1.25rem; } + .pagination.is-large { + font-size: 1.5rem; } + .pagination.is-rounded .pagination-previous, + .pagination.is-rounded .pagination-next { + padding-left: 1em; + padding-right: 1em; + border-radius: 290486px; } + .pagination.is-rounded .pagination-link { + border-radius: 290486px; } + +.pagination, +.pagination-list { + align-items: center; + display: flex; + justify-content: center; + text-align: center; } + +.pagination-previous, +.pagination-next, +.pagination-link, +.pagination-ellipsis { + font-size: 1em; + padding-left: 0.5em; + padding-right: 0.5em; + justify-content: center; + margin: 0.25rem; + text-align: center; } + +.pagination-previous, +.pagination-next, +.pagination-link { + border-color: #dbdbdb; + color: #363636; + min-width: 2.25em; } + .pagination-previous:hover, + .pagination-next:hover, + .pagination-link:hover { + border-color: #b5b5b5; + color: #363636; } + .pagination-previous:focus, + .pagination-next:focus, + .pagination-link:focus { + border-color: #33B2E8; } + .pagination-previous:active, + .pagination-next:active, + .pagination-link:active { + box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2); } + .pagination-previous[disabled], + .pagination-next[disabled], + .pagination-link[disabled] { + background-color: #dbdbdb; + border-color: #dbdbdb; + box-shadow: none; + color: #7a7a7a; + opacity: 0.5; } + +.pagination-previous, +.pagination-next { + padding-left: 0.75em; + padding-right: 0.75em; + white-space: nowrap; } + +.pagination-link.is-current { + background-color: #33B2E8; + border-color: #33B2E8; + color: #fff; } + +.pagination-ellipsis { + color: #b5b5b5; + pointer-events: none; } + +.pagination-list { + flex-wrap: wrap; } + +@media screen and (max-width: 768px) { + .pagination { + flex-wrap: wrap; } + .pagination-previous, + .pagination-next { + flex-grow: 1; + flex-shrink: 1; } + .pagination-list li { + flex-grow: 1; + flex-shrink: 1; } } + +@media screen and (min-width: 769px), print { + .pagination-list { + flex-grow: 1; + flex-shrink: 1; + justify-content: flex-start; + order: 1; } + .pagination-previous { + order: 2; } + .pagination-next { + order: 3; } + .pagination { + justify-content: space-between; } + .pagination.is-centered .pagination-previous { + order: 1; } + .pagination.is-centered .pagination-list { + justify-content: center; + order: 2; } + .pagination.is-centered .pagination-next { + order: 3; } + .pagination.is-right .pagination-previous { + order: 1; } + .pagination.is-right .pagination-next { + order: 2; } + .pagination.is-right .pagination-list { + justify-content: flex-end; + order: 3; } } + +.panel { + font-size: 1rem; } + .panel:not(:last-child) { + margin-bottom: 1.5rem; } + +.panel-heading, +.panel-tabs, +.panel-block { + border-bottom: 1px solid #dbdbdb; + border-left: 1px solid #dbdbdb; + border-right: 1px solid #dbdbdb; } + .panel-heading:first-child, + .panel-tabs:first-child, + .panel-block:first-child { + border-top: 1px solid #dbdbdb; } + +.panel-heading { + background-color: whitesmoke; + border-radius: 4px 4px 0 0; + color: #363636; + font-size: 1.25em; + font-weight: 300; + line-height: 1.25; + padding: 0.5em 0.75em; } + +.panel-tabs { + align-items: flex-end; + display: flex; + font-size: 0.875em; + justify-content: center; } + .panel-tabs a { + border-bottom: 1px solid #dbdbdb; + margin-bottom: -1px; + padding: 0.5em; } + .panel-tabs a.is-active { + border-bottom-color: #4a4a4a; + color: #363636; } + +.panel-list a { + color: #4a4a4a; } + .panel-list a:hover { + color: #33B2E8; } + +.panel-block { + align-items: center; + color: #363636; + display: flex; + justify-content: flex-start; + padding: 0.5em 0.75em; } + .panel-block input[type="checkbox"] { + margin-right: 0.75em; } + .panel-block > .control { + flex-grow: 1; + flex-shrink: 1; + width: 100%; } + .panel-block.is-wrapped { + flex-wrap: wrap; } + .panel-block.is-active { + border-left-color: #33B2E8; + color: #363636; } + .panel-block.is-active .panel-icon { + color: #33B2E8; } + +a.panel-block, +label.panel-block { + cursor: pointer; } + a.panel-block:hover, + label.panel-block:hover { + background-color: whitesmoke; } + +.panel-icon { + display: inline-block; + font-size: 14px; + height: 1em; + line-height: 1em; + text-align: center; + vertical-align: top; + width: 1em; + color: #7a7a7a; + margin-right: 0.75em; } + .panel-icon .fa { + font-size: inherit; + line-height: inherit; } + +.tabs { + -webkit-overflow-scrolling: touch; + align-items: stretch; + display: flex; + font-size: 1rem; + justify-content: space-between; + overflow: hidden; + overflow-x: auto; + white-space: nowrap; } + .tabs a { + align-items: center; + border-bottom-color: #dbdbdb; + border-bottom-style: solid; + border-bottom-width: 1px; + color: #4a4a4a; + display: flex; + justify-content: center; + margin-bottom: -1px; + padding: 0.5em 1em; + vertical-align: top; } + .tabs a:hover { + border-bottom-color: #363636; + color: #363636; } + .tabs li { + display: block; } + .tabs li.is-active a { + border-bottom-color: #33B2E8; + color: #33B2E8; } + .tabs ul { + align-items: center; + border-bottom-color: #dbdbdb; + border-bottom-style: solid; + border-bottom-width: 1px; + display: flex; + flex-grow: 1; + flex-shrink: 0; + justify-content: flex-start; } + .tabs ul.is-left { + padding-right: 0.75em; } + .tabs ul.is-center { + flex: none; + justify-content: center; + padding-left: 0.75em; + padding-right: 0.75em; } + .tabs ul.is-right { + justify-content: flex-end; + padding-left: 0.75em; } + .tabs .icon:first-child { + margin-right: 0.5em; } + .tabs .icon:last-child { + margin-left: 0.5em; } + .tabs.is-centered ul { + justify-content: center; } + .tabs.is-right ul { + justify-content: flex-end; } + .tabs.is-boxed a { + border: 1px solid transparent; + border-radius: 4px 4px 0 0; } + .tabs.is-boxed a:hover { + background-color: whitesmoke; + border-bottom-color: #dbdbdb; } + .tabs.is-boxed li.is-active a { + background-color: white; + border-color: #dbdbdb; + border-bottom-color: transparent !important; } + .tabs.is-fullwidth li { + flex-grow: 1; + flex-shrink: 0; } + .tabs.is-toggle a { + border-color: #dbdbdb; + border-style: solid; + border-width: 1px; + margin-bottom: 0; + position: relative; } + .tabs.is-toggle a:hover { + background-color: whitesmoke; + border-color: #b5b5b5; + z-index: 2; } + .tabs.is-toggle li + li { + margin-left: -1px; } + .tabs.is-toggle li:first-child a { + border-radius: 4px 0 0 4px; } + .tabs.is-toggle li:last-child a { + border-radius: 0 4px 4px 0; } + .tabs.is-toggle li.is-active a { + background-color: #33B2E8; + border-color: #33B2E8; + color: #fff; + z-index: 1; } + .tabs.is-toggle ul { + border-bottom: none; } + .tabs.is-toggle.is-toggle-rounded li:first-child a { + border-bottom-left-radius: 290486px; + border-top-left-radius: 290486px; + padding-left: 1.25em; } + .tabs.is-toggle.is-toggle-rounded li:last-child a { + border-bottom-right-radius: 290486px; + border-top-right-radius: 290486px; + padding-right: 1.25em; } + .tabs.is-small { + font-size: 0.75rem; } + .tabs.is-medium { + font-size: 1.25rem; } + .tabs.is-large { + font-size: 1.5rem; } + +.column { + display: block; + flex-basis: 0; + flex-grow: 1; + flex-shrink: 1; + padding: 0.75rem; } + .columns.is-mobile > .column.is-narrow { + flex: none; } + .columns.is-mobile > .column.is-full { + flex: none; + width: 100%; } + .columns.is-mobile > .column.is-three-quarters { + flex: none; + width: 75%; } + .columns.is-mobile > .column.is-two-thirds { + flex: none; + width: 66.6666%; } + .columns.is-mobile > .column.is-half { + flex: none; + width: 50%; } + .columns.is-mobile > .column.is-one-third { + flex: none; + width: 33.3333%; } + .columns.is-mobile > .column.is-one-quarter { + flex: none; + width: 25%; } + .columns.is-mobile > .column.is-one-fifth { + flex: none; + width: 20%; } + .columns.is-mobile > .column.is-two-fifths { + flex: none; + width: 40%; } + .columns.is-mobile > .column.is-three-fifths { + flex: none; + width: 60%; } + .columns.is-mobile > .column.is-four-fifths { + flex: none; + width: 80%; } + .columns.is-mobile > .column.is-offset-three-quarters { + margin-left: 75%; } + .columns.is-mobile > .column.is-offset-two-thirds { + margin-left: 66.6666%; } + .columns.is-mobile > .column.is-offset-half { + margin-left: 50%; } + .columns.is-mobile > .column.is-offset-one-third { + margin-left: 33.3333%; } + .columns.is-mobile > .column.is-offset-one-quarter { + margin-left: 25%; } + .columns.is-mobile > .column.is-offset-one-fifth { + margin-left: 20%; } + .columns.is-mobile > .column.is-offset-two-fifths { + margin-left: 40%; } + .columns.is-mobile > .column.is-offset-three-fifths { + margin-left: 60%; } + .columns.is-mobile > .column.is-offset-four-fifths { + margin-left: 80%; } + .columns.is-mobile > .column.is-1 { + flex: none; + width: 8.33333%; } + .columns.is-mobile > .column.is-offset-1 { + margin-left: 8.33333%; } + .columns.is-mobile > .column.is-2 { + flex: none; + width: 16.66667%; } + .columns.is-mobile > .column.is-offset-2 { + margin-left: 16.66667%; } + .columns.is-mobile > .column.is-3 { + flex: none; + width: 25%; } + .columns.is-mobile > .column.is-offset-3 { + margin-left: 25%; } + .columns.is-mobile > .column.is-4 { + flex: none; + width: 33.33333%; } + .columns.is-mobile > .column.is-offset-4 { + margin-left: 33.33333%; } + .columns.is-mobile > .column.is-5 { + flex: none; + width: 41.66667%; } + .columns.is-mobile > .column.is-offset-5 { + margin-left: 41.66667%; } + .columns.is-mobile > .column.is-6 { + flex: none; + width: 50%; } + .columns.is-mobile > .column.is-offset-6 { + margin-left: 50%; } + .columns.is-mobile > .column.is-7 { + flex: none; + width: 58.33333%; } + .columns.is-mobile > .column.is-offset-7 { + margin-left: 58.33333%; } + .columns.is-mobile > .column.is-8 { + flex: none; + width: 66.66667%; } + .columns.is-mobile > .column.is-offset-8 { + margin-left: 66.66667%; } + .columns.is-mobile > .column.is-9 { + flex: none; + width: 75%; } + .columns.is-mobile > .column.is-offset-9 { + margin-left: 75%; } + .columns.is-mobile > .column.is-10 { + flex: none; + width: 83.33333%; } + .columns.is-mobile > .column.is-offset-10 { + margin-left: 83.33333%; } + .columns.is-mobile > .column.is-11 { + flex: none; + width: 91.66667%; } + .columns.is-mobile > .column.is-offset-11 { + margin-left: 91.66667%; } + .columns.is-mobile > .column.is-12 { + flex: none; + width: 100%; } + .columns.is-mobile > .column.is-offset-12 { + margin-left: 100%; } + @media screen and (max-width: 768px) { + .column.is-narrow-mobile { + flex: none; } + .column.is-full-mobile { + flex: none; + width: 100%; } + .column.is-three-quarters-mobile { + flex: none; + width: 75%; } + .column.is-two-thirds-mobile { + flex: none; + width: 66.6666%; } + .column.is-half-mobile { + flex: none; + width: 50%; } + .column.is-one-third-mobile { + flex: none; + width: 33.3333%; } + .column.is-one-quarter-mobile { + flex: none; + width: 25%; } + .column.is-one-fifth-mobile { + flex: none; + width: 20%; } + .column.is-two-fifths-mobile { + flex: none; + width: 40%; } + .column.is-three-fifths-mobile { + flex: none; + width: 60%; } + .column.is-four-fifths-mobile { + flex: none; + width: 80%; } + .column.is-offset-three-quarters-mobile { + margin-left: 75%; } + .column.is-offset-two-thirds-mobile { + margin-left: 66.6666%; } + .column.is-offset-half-mobile { + margin-left: 50%; } + .column.is-offset-one-third-mobile { + margin-left: 33.3333%; } + .column.is-offset-one-quarter-mobile { + margin-left: 25%; } + .column.is-offset-one-fifth-mobile { + margin-left: 20%; } + .column.is-offset-two-fifths-mobile { + margin-left: 40%; } + .column.is-offset-three-fifths-mobile { + margin-left: 60%; } + .column.is-offset-four-fifths-mobile { + margin-left: 80%; } + .column.is-1-mobile { + flex: none; + width: 8.33333%; } + .column.is-offset-1-mobile { + margin-left: 8.33333%; } + .column.is-2-mobile { + flex: none; + width: 16.66667%; } + .column.is-offset-2-mobile { + margin-left: 16.66667%; } + .column.is-3-mobile { + flex: none; + width: 25%; } + .column.is-offset-3-mobile { + margin-left: 25%; } + .column.is-4-mobile { + flex: none; + width: 33.33333%; } + .column.is-offset-4-mobile { + margin-left: 33.33333%; } + .column.is-5-mobile { + flex: none; + width: 41.66667%; } + .column.is-offset-5-mobile { + margin-left: 41.66667%; } + .column.is-6-mobile { + flex: none; + width: 50%; } + .column.is-offset-6-mobile { + margin-left: 50%; } + .column.is-7-mobile { + flex: none; + width: 58.33333%; } + .column.is-offset-7-mobile { + margin-left: 58.33333%; } + .column.is-8-mobile { + flex: none; + width: 66.66667%; } + .column.is-offset-8-mobile { + margin-left: 66.66667%; } + .column.is-9-mobile { + flex: none; + width: 75%; } + .column.is-offset-9-mobile { + margin-left: 75%; } + .column.is-10-mobile { + flex: none; + width: 83.33333%; } + .column.is-offset-10-mobile { + margin-left: 83.33333%; } + .column.is-11-mobile { + flex: none; + width: 91.66667%; } + .column.is-offset-11-mobile { + margin-left: 91.66667%; } + .column.is-12-mobile { + flex: none; + width: 100%; } + .column.is-offset-12-mobile { + margin-left: 100%; } } + @media screen and (min-width: 769px), print { + .column.is-narrow, .column.is-narrow-tablet { + flex: none; } + .column.is-full, .column.is-full-tablet { + flex: none; + width: 100%; } + .column.is-three-quarters, .column.is-three-quarters-tablet { + flex: none; + width: 75%; } + .column.is-two-thirds, .column.is-two-thirds-tablet { + flex: none; + width: 66.6666%; } + .column.is-half, .column.is-half-tablet { + flex: none; + width: 50%; } + .column.is-one-third, .column.is-one-third-tablet { + flex: none; + width: 33.3333%; } + .column.is-one-quarter, .column.is-one-quarter-tablet { + flex: none; + width: 25%; } + .column.is-one-fifth, .column.is-one-fifth-tablet { + flex: none; + width: 20%; } + .column.is-two-fifths, .column.is-two-fifths-tablet { + flex: none; + width: 40%; } + .column.is-three-fifths, .column.is-three-fifths-tablet { + flex: none; + width: 60%; } + .column.is-four-fifths, .column.is-four-fifths-tablet { + flex: none; + width: 80%; } + .column.is-offset-three-quarters, .column.is-offset-three-quarters-tablet { + margin-left: 75%; } + .column.is-offset-two-thirds, .column.is-offset-two-thirds-tablet { + margin-left: 66.6666%; } + .column.is-offset-half, .column.is-offset-half-tablet { + margin-left: 50%; } + .column.is-offset-one-third, .column.is-offset-one-third-tablet { + margin-left: 33.3333%; } + .column.is-offset-one-quarter, .column.is-offset-one-quarter-tablet { + margin-left: 25%; } + .column.is-offset-one-fifth, .column.is-offset-one-fifth-tablet { + margin-left: 20%; } + .column.is-offset-two-fifths, .column.is-offset-two-fifths-tablet { + margin-left: 40%; } + .column.is-offset-three-fifths, .column.is-offset-three-fifths-tablet { + margin-left: 60%; } + .column.is-offset-four-fifths, .column.is-offset-four-fifths-tablet { + margin-left: 80%; } + .column.is-1, .column.is-1-tablet { + flex: none; + width: 8.33333%; } + .column.is-offset-1, .column.is-offset-1-tablet { + margin-left: 8.33333%; } + .column.is-2, .column.is-2-tablet { + flex: none; + width: 16.66667%; } + .column.is-offset-2, .column.is-offset-2-tablet { + margin-left: 16.66667%; } + .column.is-3, .column.is-3-tablet { + flex: none; + width: 25%; } + .column.is-offset-3, .column.is-offset-3-tablet { + margin-left: 25%; } + .column.is-4, .column.is-4-tablet { + flex: none; + width: 33.33333%; } + .column.is-offset-4, .column.is-offset-4-tablet { + margin-left: 33.33333%; } + .column.is-5, .column.is-5-tablet { + flex: none; + width: 41.66667%; } + .column.is-offset-5, .column.is-offset-5-tablet { + margin-left: 41.66667%; } + .column.is-6, .column.is-6-tablet { + flex: none; + width: 50%; } + .column.is-offset-6, .column.is-offset-6-tablet { + margin-left: 50%; } + .column.is-7, .column.is-7-tablet { + flex: none; + width: 58.33333%; } + .column.is-offset-7, .column.is-offset-7-tablet { + margin-left: 58.33333%; } + .column.is-8, .column.is-8-tablet { + flex: none; + width: 66.66667%; } + .column.is-offset-8, .column.is-offset-8-tablet { + margin-left: 66.66667%; } + .column.is-9, .column.is-9-tablet { + flex: none; + width: 75%; } + .column.is-offset-9, .column.is-offset-9-tablet { + margin-left: 75%; } + .column.is-10, .column.is-10-tablet { + flex: none; + width: 83.33333%; } + .column.is-offset-10, .column.is-offset-10-tablet { + margin-left: 83.33333%; } + .column.is-11, .column.is-11-tablet { + flex: none; + width: 91.66667%; } + .column.is-offset-11, .column.is-offset-11-tablet { + margin-left: 91.66667%; } + .column.is-12, .column.is-12-tablet { + flex: none; + width: 100%; } + .column.is-offset-12, .column.is-offset-12-tablet { + margin-left: 100%; } } + @media screen and (max-width: 1087px) { + .column.is-narrow-touch { + flex: none; } + .column.is-full-touch { + flex: none; + width: 100%; } + .column.is-three-quarters-touch { + flex: none; + width: 75%; } + .column.is-two-thirds-touch { + flex: none; + width: 66.6666%; } + .column.is-half-touch { + flex: none; + width: 50%; } + .column.is-one-third-touch { + flex: none; + width: 33.3333%; } + .column.is-one-quarter-touch { + flex: none; + width: 25%; } + .column.is-one-fifth-touch { + flex: none; + width: 20%; } + .column.is-two-fifths-touch { + flex: none; + width: 40%; } + .column.is-three-fifths-touch { + flex: none; + width: 60%; } + .column.is-four-fifths-touch { + flex: none; + width: 80%; } + .column.is-offset-three-quarters-touch { + margin-left: 75%; } + .column.is-offset-two-thirds-touch { + margin-left: 66.6666%; } + .column.is-offset-half-touch { + margin-left: 50%; } + .column.is-offset-one-third-touch { + margin-left: 33.3333%; } + .column.is-offset-one-quarter-touch { + margin-left: 25%; } + .column.is-offset-one-fifth-touch { + margin-left: 20%; } + .column.is-offset-two-fifths-touch { + margin-left: 40%; } + .column.is-offset-three-fifths-touch { + margin-left: 60%; } + .column.is-offset-four-fifths-touch { + margin-left: 80%; } + .column.is-1-touch { + flex: none; + width: 8.33333%; } + .column.is-offset-1-touch { + margin-left: 8.33333%; } + .column.is-2-touch { + flex: none; + width: 16.66667%; } + .column.is-offset-2-touch { + margin-left: 16.66667%; } + .column.is-3-touch { + flex: none; + width: 25%; } + .column.is-offset-3-touch { + margin-left: 25%; } + .column.is-4-touch { + flex: none; + width: 33.33333%; } + .column.is-offset-4-touch { + margin-left: 33.33333%; } + .column.is-5-touch { + flex: none; + width: 41.66667%; } + .column.is-offset-5-touch { + margin-left: 41.66667%; } + .column.is-6-touch { + flex: none; + width: 50%; } + .column.is-offset-6-touch { + margin-left: 50%; } + .column.is-7-touch { + flex: none; + width: 58.33333%; } + .column.is-offset-7-touch { + margin-left: 58.33333%; } + .column.is-8-touch { + flex: none; + width: 66.66667%; } + .column.is-offset-8-touch { + margin-left: 66.66667%; } + .column.is-9-touch { + flex: none; + width: 75%; } + .column.is-offset-9-touch { + margin-left: 75%; } + .column.is-10-touch { + flex: none; + width: 83.33333%; } + .column.is-offset-10-touch { + margin-left: 83.33333%; } + .column.is-11-touch { + flex: none; + width: 91.66667%; } + .column.is-offset-11-touch { + margin-left: 91.66667%; } + .column.is-12-touch { + flex: none; + width: 100%; } + .column.is-offset-12-touch { + margin-left: 100%; } } + @media screen and (min-width: 1088px) { + .column.is-narrow-desktop { + flex: none; } + .column.is-full-desktop { + flex: none; + width: 100%; } + .column.is-three-quarters-desktop { + flex: none; + width: 75%; } + .column.is-two-thirds-desktop { + flex: none; + width: 66.6666%; } + .column.is-half-desktop { + flex: none; + width: 50%; } + .column.is-one-third-desktop { + flex: none; + width: 33.3333%; } + .column.is-one-quarter-desktop { + flex: none; + width: 25%; } + .column.is-one-fifth-desktop { + flex: none; + width: 20%; } + .column.is-two-fifths-desktop { + flex: none; + width: 40%; } + .column.is-three-fifths-desktop { + flex: none; + width: 60%; } + .column.is-four-fifths-desktop { + flex: none; + width: 80%; } + .column.is-offset-three-quarters-desktop { + margin-left: 75%; } + .column.is-offset-two-thirds-desktop { + margin-left: 66.6666%; } + .column.is-offset-half-desktop { + margin-left: 50%; } + .column.is-offset-one-third-desktop { + margin-left: 33.3333%; } + .column.is-offset-one-quarter-desktop { + margin-left: 25%; } + .column.is-offset-one-fifth-desktop { + margin-left: 20%; } + .column.is-offset-two-fifths-desktop { + margin-left: 40%; } + .column.is-offset-three-fifths-desktop { + margin-left: 60%; } + .column.is-offset-four-fifths-desktop { + margin-left: 80%; } + .column.is-1-desktop { + flex: none; + width: 8.33333%; } + .column.is-offset-1-desktop { + margin-left: 8.33333%; } + .column.is-2-desktop { + flex: none; + width: 16.66667%; } + .column.is-offset-2-desktop { + margin-left: 16.66667%; } + .column.is-3-desktop { + flex: none; + width: 25%; } + .column.is-offset-3-desktop { + margin-left: 25%; } + .column.is-4-desktop { + flex: none; + width: 33.33333%; } + .column.is-offset-4-desktop { + margin-left: 33.33333%; } + .column.is-5-desktop { + flex: none; + width: 41.66667%; } + .column.is-offset-5-desktop { + margin-left: 41.66667%; } + .column.is-6-desktop { + flex: none; + width: 50%; } + .column.is-offset-6-desktop { + margin-left: 50%; } + .column.is-7-desktop { + flex: none; + width: 58.33333%; } + .column.is-offset-7-desktop { + margin-left: 58.33333%; } + .column.is-8-desktop { + flex: none; + width: 66.66667%; } + .column.is-offset-8-desktop { + margin-left: 66.66667%; } + .column.is-9-desktop { + flex: none; + width: 75%; } + .column.is-offset-9-desktop { + margin-left: 75%; } + .column.is-10-desktop { + flex: none; + width: 83.33333%; } + .column.is-offset-10-desktop { + margin-left: 83.33333%; } + .column.is-11-desktop { + flex: none; + width: 91.66667%; } + .column.is-offset-11-desktop { + margin-left: 91.66667%; } + .column.is-12-desktop { + flex: none; + width: 100%; } + .column.is-offset-12-desktop { + margin-left: 100%; } } + @media screen and (min-width: 1280px) { + .column.is-narrow-widescreen { + flex: none; } + .column.is-full-widescreen { + flex: none; + width: 100%; } + .column.is-three-quarters-widescreen { + flex: none; + width: 75%; } + .column.is-two-thirds-widescreen { + flex: none; + width: 66.6666%; } + .column.is-half-widescreen { + flex: none; + width: 50%; } + .column.is-one-third-widescreen { + flex: none; + width: 33.3333%; } + .column.is-one-quarter-widescreen { + flex: none; + width: 25%; } + .column.is-one-fifth-widescreen { + flex: none; + width: 20%; } + .column.is-two-fifths-widescreen { + flex: none; + width: 40%; } + .column.is-three-fifths-widescreen { + flex: none; + width: 60%; } + .column.is-four-fifths-widescreen { + flex: none; + width: 80%; } + .column.is-offset-three-quarters-widescreen { + margin-left: 75%; } + .column.is-offset-two-thirds-widescreen { + margin-left: 66.6666%; } + .column.is-offset-half-widescreen { + margin-left: 50%; } + .column.is-offset-one-third-widescreen { + margin-left: 33.3333%; } + .column.is-offset-one-quarter-widescreen { + margin-left: 25%; } + .column.is-offset-one-fifth-widescreen { + margin-left: 20%; } + .column.is-offset-two-fifths-widescreen { + margin-left: 40%; } + .column.is-offset-three-fifths-widescreen { + margin-left: 60%; } + .column.is-offset-four-fifths-widescreen { + margin-left: 80%; } + .column.is-1-widescreen { + flex: none; + width: 8.33333%; } + .column.is-offset-1-widescreen { + margin-left: 8.33333%; } + .column.is-2-widescreen { + flex: none; + width: 16.66667%; } + .column.is-offset-2-widescreen { + margin-left: 16.66667%; } + .column.is-3-widescreen { + flex: none; + width: 25%; } + .column.is-offset-3-widescreen { + margin-left: 25%; } + .column.is-4-widescreen { + flex: none; + width: 33.33333%; } + .column.is-offset-4-widescreen { + margin-left: 33.33333%; } + .column.is-5-widescreen { + flex: none; + width: 41.66667%; } + .column.is-offset-5-widescreen { + margin-left: 41.66667%; } + .column.is-6-widescreen { + flex: none; + width: 50%; } + .column.is-offset-6-widescreen { + margin-left: 50%; } + .column.is-7-widescreen { + flex: none; + width: 58.33333%; } + .column.is-offset-7-widescreen { + margin-left: 58.33333%; } + .column.is-8-widescreen { + flex: none; + width: 66.66667%; } + .column.is-offset-8-widescreen { + margin-left: 66.66667%; } + .column.is-9-widescreen { + flex: none; + width: 75%; } + .column.is-offset-9-widescreen { + margin-left: 75%; } + .column.is-10-widescreen { + flex: none; + width: 83.33333%; } + .column.is-offset-10-widescreen { + margin-left: 83.33333%; } + .column.is-11-widescreen { + flex: none; + width: 91.66667%; } + .column.is-offset-11-widescreen { + margin-left: 91.66667%; } + .column.is-12-widescreen { + flex: none; + width: 100%; } + .column.is-offset-12-widescreen { + margin-left: 100%; } } + @media screen and (min-width: 1472px) { + .column.is-narrow-fullhd { + flex: none; } + .column.is-full-fullhd { + flex: none; + width: 100%; } + .column.is-three-quarters-fullhd { + flex: none; + width: 75%; } + .column.is-two-thirds-fullhd { + flex: none; + width: 66.6666%; } + .column.is-half-fullhd { + flex: none; + width: 50%; } + .column.is-one-third-fullhd { + flex: none; + width: 33.3333%; } + .column.is-one-quarter-fullhd { + flex: none; + width: 25%; } + .column.is-one-fifth-fullhd { + flex: none; + width: 20%; } + .column.is-two-fifths-fullhd { + flex: none; + width: 40%; } + .column.is-three-fifths-fullhd { + flex: none; + width: 60%; } + .column.is-four-fifths-fullhd { + flex: none; + width: 80%; } + .column.is-offset-three-quarters-fullhd { + margin-left: 75%; } + .column.is-offset-two-thirds-fullhd { + margin-left: 66.6666%; } + .column.is-offset-half-fullhd { + margin-left: 50%; } + .column.is-offset-one-third-fullhd { + margin-left: 33.3333%; } + .column.is-offset-one-quarter-fullhd { + margin-left: 25%; } + .column.is-offset-one-fifth-fullhd { + margin-left: 20%; } + .column.is-offset-two-fifths-fullhd { + margin-left: 40%; } + .column.is-offset-three-fifths-fullhd { + margin-left: 60%; } + .column.is-offset-four-fifths-fullhd { + margin-left: 80%; } + .column.is-1-fullhd { + flex: none; + width: 8.33333%; } + .column.is-offset-1-fullhd { + margin-left: 8.33333%; } + .column.is-2-fullhd { + flex: none; + width: 16.66667%; } + .column.is-offset-2-fullhd { + margin-left: 16.66667%; } + .column.is-3-fullhd { + flex: none; + width: 25%; } + .column.is-offset-3-fullhd { + margin-left: 25%; } + .column.is-4-fullhd { + flex: none; + width: 33.33333%; } + .column.is-offset-4-fullhd { + margin-left: 33.33333%; } + .column.is-5-fullhd { + flex: none; + width: 41.66667%; } + .column.is-offset-5-fullhd { + margin-left: 41.66667%; } + .column.is-6-fullhd { + flex: none; + width: 50%; } + .column.is-offset-6-fullhd { + margin-left: 50%; } + .column.is-7-fullhd { + flex: none; + width: 58.33333%; } + .column.is-offset-7-fullhd { + margin-left: 58.33333%; } + .column.is-8-fullhd { + flex: none; + width: 66.66667%; } + .column.is-offset-8-fullhd { + margin-left: 66.66667%; } + .column.is-9-fullhd { + flex: none; + width: 75%; } + .column.is-offset-9-fullhd { + margin-left: 75%; } + .column.is-10-fullhd { + flex: none; + width: 83.33333%; } + .column.is-offset-10-fullhd { + margin-left: 83.33333%; } + .column.is-11-fullhd { + flex: none; + width: 91.66667%; } + .column.is-offset-11-fullhd { + margin-left: 91.66667%; } + .column.is-12-fullhd { + flex: none; + width: 100%; } + .column.is-offset-12-fullhd { + margin-left: 100%; } } + +.columns { + margin-left: -0.75rem; + margin-right: -0.75rem; + margin-top: -0.75rem; } + .columns:last-child { + margin-bottom: -0.75rem; } + .columns:not(:last-child) { + margin-bottom: calc(1.5rem - 0.75rem); } + .columns.is-centered { + justify-content: center; } + .columns.is-gapless { + margin-left: 0; + margin-right: 0; + margin-top: 0; } + .columns.is-gapless > .column { + margin: 0; + padding: 0 !important; } + .columns.is-gapless:not(:last-child) { + margin-bottom: 1.5rem; } + .columns.is-gapless:last-child { + margin-bottom: 0; } + .columns.is-mobile { + display: flex; } + .columns.is-multiline { + flex-wrap: wrap; } + .columns.is-vcentered { + align-items: center; } + @media screen and (min-width: 769px), print { + .columns:not(.is-desktop) { + display: flex; } } + @media screen and (min-width: 1088px) { + .columns.is-desktop { + display: flex; } } + +.columns.is-variable { + --columnGap: 0.75rem; + margin-left: calc(-1 * var(--columnGap)); + margin-right: calc(-1 * var(--columnGap)); } + .columns.is-variable .column { + padding-left: var(--columnGap); + padding-right: var(--columnGap); } + .columns.is-variable.is-0 { + --columnGap: 0rem; } + .columns.is-variable.is-1 { + --columnGap: 0.25rem; } + .columns.is-variable.is-2 { + --columnGap: 0.5rem; } + .columns.is-variable.is-3 { + --columnGap: 0.75rem; } + .columns.is-variable.is-4 { + --columnGap: 1rem; } + .columns.is-variable.is-5 { + --columnGap: 1.25rem; } + .columns.is-variable.is-6 { + --columnGap: 1.5rem; } + .columns.is-variable.is-7 { + --columnGap: 1.75rem; } + .columns.is-variable.is-8 { + --columnGap: 2rem; } + +.tile { + align-items: stretch; + display: block; + flex-basis: 0; + flex-grow: 1; + flex-shrink: 1; + min-height: min-content; } + .tile.is-ancestor { + margin-left: -0.75rem; + margin-right: -0.75rem; + margin-top: -0.75rem; } + .tile.is-ancestor:last-child { + margin-bottom: -0.75rem; } + .tile.is-ancestor:not(:last-child) { + margin-bottom: 0.75rem; } + .tile.is-child { + margin: 0 !important; } + .tile.is-parent { + padding: 0.75rem; } + .tile.is-vertical { + flex-direction: column; } + .tile.is-vertical > .tile.is-child:not(:last-child) { + margin-bottom: 1.5rem !important; } + @media screen and (min-width: 769px), print { + .tile:not(.is-child) { + display: flex; } + .tile.is-1 { + flex: none; + width: 8.33333%; } + .tile.is-2 { + flex: none; + width: 16.66667%; } + .tile.is-3 { + flex: none; + width: 25%; } + .tile.is-4 { + flex: none; + width: 33.33333%; } + .tile.is-5 { + flex: none; + width: 41.66667%; } + .tile.is-6 { + flex: none; + width: 50%; } + .tile.is-7 { + flex: none; + width: 58.33333%; } + .tile.is-8 { + flex: none; + width: 66.66667%; } + .tile.is-9 { + flex: none; + width: 75%; } + .tile.is-10 { + flex: none; + width: 83.33333%; } + .tile.is-11 { + flex: none; + width: 91.66667%; } + .tile.is-12 { + flex: none; + width: 100%; } } + +.hero { + align-items: stretch; + display: flex; + flex-direction: column; + justify-content: space-between; } + .hero .navbar { + background: none; } + .hero .tabs ul { + border-bottom: none; } + .hero.is-white { + background-color: white; + color: #0a0a0a; } + .hero.is-white a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-white strong { + color: inherit; } + .hero.is-white .title { + color: #0a0a0a; } + .hero.is-white .subtitle { + color: rgba(10, 10, 10, 0.9); } + .hero.is-white .subtitle a:not(.button), + .hero.is-white .subtitle strong { + color: #0a0a0a; } + @media screen and (max-width: 1087px) { + .hero.is-white .navbar-menu { + background-color: white; } } + .hero.is-white .navbar-item, + .hero.is-white .navbar-link { + color: rgba(10, 10, 10, 0.7); } + .hero.is-white a.navbar-item:hover, .hero.is-white a.navbar-item.is-active, + .hero.is-white .navbar-link:hover, + .hero.is-white .navbar-link.is-active { + background-color: #f2f2f2; + color: #0a0a0a; } + .hero.is-white .tabs a { + color: #0a0a0a; + opacity: 0.9; } + .hero.is-white .tabs a:hover { + opacity: 1; } + .hero.is-white .tabs li.is-active a { + opacity: 1; } + .hero.is-white .tabs.is-boxed a, .hero.is-white .tabs.is-toggle a { + color: #0a0a0a; } + .hero.is-white .tabs.is-boxed a:hover, .hero.is-white .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-white .tabs.is-boxed li.is-active a, .hero.is-white .tabs.is-boxed li.is-active a:hover, .hero.is-white .tabs.is-toggle li.is-active a, .hero.is-white .tabs.is-toggle li.is-active a:hover { + background-color: #0a0a0a; + border-color: #0a0a0a; + color: white; } + .hero.is-white.is-bold { + background-image: linear-gradient(141deg, #e6e6e6 0%, white 71%, white 100%); } + @media screen and (max-width: 768px) { + .hero.is-white.is-bold .navbar-menu { + background-image: linear-gradient(141deg, #e6e6e6 0%, white 71%, white 100%); } } + .hero.is-black { + background-color: #0a0a0a; + color: white; } + .hero.is-black a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-black strong { + color: inherit; } + .hero.is-black .title { + color: white; } + .hero.is-black .subtitle { + color: rgba(255, 255, 255, 0.9); } + .hero.is-black .subtitle a:not(.button), + .hero.is-black .subtitle strong { + color: white; } + @media screen and (max-width: 1087px) { + .hero.is-black .navbar-menu { + background-color: #0a0a0a; } } + .hero.is-black .navbar-item, + .hero.is-black .navbar-link { + color: rgba(255, 255, 255, 0.7); } + .hero.is-black a.navbar-item:hover, .hero.is-black a.navbar-item.is-active, + .hero.is-black .navbar-link:hover, + .hero.is-black .navbar-link.is-active { + background-color: black; + color: white; } + .hero.is-black .tabs a { + color: white; + opacity: 0.9; } + .hero.is-black .tabs a:hover { + opacity: 1; } + .hero.is-black .tabs li.is-active a { + opacity: 1; } + .hero.is-black .tabs.is-boxed a, .hero.is-black .tabs.is-toggle a { + color: white; } + .hero.is-black .tabs.is-boxed a:hover, .hero.is-black .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-black .tabs.is-boxed li.is-active a, .hero.is-black .tabs.is-boxed li.is-active a:hover, .hero.is-black .tabs.is-toggle li.is-active a, .hero.is-black .tabs.is-toggle li.is-active a:hover { + background-color: white; + border-color: white; + color: #0a0a0a; } + .hero.is-black.is-bold { + background-image: linear-gradient(141deg, black 0%, #0a0a0a 71%, #181616 100%); } + @media screen and (max-width: 768px) { + .hero.is-black.is-bold .navbar-menu { + background-image: linear-gradient(141deg, black 0%, #0a0a0a 71%, #181616 100%); } } + .hero.is-light { + background-color: whitesmoke; + color: #363636; } + .hero.is-light a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-light strong { + color: inherit; } + .hero.is-light .title { + color: #363636; } + .hero.is-light .subtitle { + color: rgba(54, 54, 54, 0.9); } + .hero.is-light .subtitle a:not(.button), + .hero.is-light .subtitle strong { + color: #363636; } + @media screen and (max-width: 1087px) { + .hero.is-light .navbar-menu { + background-color: whitesmoke; } } + .hero.is-light .navbar-item, + .hero.is-light .navbar-link { + color: rgba(54, 54, 54, 0.7); } + .hero.is-light a.navbar-item:hover, .hero.is-light a.navbar-item.is-active, + .hero.is-light .navbar-link:hover, + .hero.is-light .navbar-link.is-active { + background-color: #e8e8e8; + color: #363636; } + .hero.is-light .tabs a { + color: #363636; + opacity: 0.9; } + .hero.is-light .tabs a:hover { + opacity: 1; } + .hero.is-light .tabs li.is-active a { + opacity: 1; } + .hero.is-light .tabs.is-boxed a, .hero.is-light .tabs.is-toggle a { + color: #363636; } + .hero.is-light .tabs.is-boxed a:hover, .hero.is-light .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-light .tabs.is-boxed li.is-active a, .hero.is-light .tabs.is-boxed li.is-active a:hover, .hero.is-light .tabs.is-toggle li.is-active a, .hero.is-light .tabs.is-toggle li.is-active a:hover { + background-color: #363636; + border-color: #363636; + color: whitesmoke; } + .hero.is-light.is-bold { + background-image: linear-gradient(141deg, #dfd8d9 0%, whitesmoke 71%, white 100%); } + @media screen and (max-width: 768px) { + .hero.is-light.is-bold .navbar-menu { + background-image: linear-gradient(141deg, #dfd8d9 0%, whitesmoke 71%, white 100%); } } + .hero.is-dark { + background-color: #363636; + color: whitesmoke; } + .hero.is-dark a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-dark strong { + color: inherit; } + .hero.is-dark .title { + color: whitesmoke; } + .hero.is-dark .subtitle { + color: rgba(245, 245, 245, 0.9); } + .hero.is-dark .subtitle a:not(.button), + .hero.is-dark .subtitle strong { + color: whitesmoke; } + @media screen and (max-width: 1087px) { + .hero.is-dark .navbar-menu { + background-color: #363636; } } + .hero.is-dark .navbar-item, + .hero.is-dark .navbar-link { + color: rgba(245, 245, 245, 0.7); } + .hero.is-dark a.navbar-item:hover, .hero.is-dark a.navbar-item.is-active, + .hero.is-dark .navbar-link:hover, + .hero.is-dark .navbar-link.is-active { + background-color: #292929; + color: whitesmoke; } + .hero.is-dark .tabs a { + color: whitesmoke; + opacity: 0.9; } + .hero.is-dark .tabs a:hover { + opacity: 1; } + .hero.is-dark .tabs li.is-active a { + opacity: 1; } + .hero.is-dark .tabs.is-boxed a, .hero.is-dark .tabs.is-toggle a { + color: whitesmoke; } + .hero.is-dark .tabs.is-boxed a:hover, .hero.is-dark .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-dark .tabs.is-boxed li.is-active a, .hero.is-dark .tabs.is-boxed li.is-active a:hover, .hero.is-dark .tabs.is-toggle li.is-active a, .hero.is-dark .tabs.is-toggle li.is-active a:hover { + background-color: whitesmoke; + border-color: whitesmoke; + color: #363636; } + .hero.is-dark.is-bold { + background-image: linear-gradient(141deg, #1f191a 0%, #363636 71%, #46403f 100%); } + @media screen and (max-width: 768px) { + .hero.is-dark.is-bold .navbar-menu { + background-image: linear-gradient(141deg, #1f191a 0%, #363636 71%, #46403f 100%); } } + .hero.is-primary { + background-color: #00d1b2; + color: #fff; } + .hero.is-primary a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-primary strong { + color: inherit; } + .hero.is-primary .title { + color: #fff; } + .hero.is-primary .subtitle { + color: rgba(255, 255, 255, 0.9); } + .hero.is-primary .subtitle a:not(.button), + .hero.is-primary .subtitle strong { + color: #fff; } + @media screen and (max-width: 1087px) { + .hero.is-primary .navbar-menu { + background-color: #00d1b2; } } + .hero.is-primary .navbar-item, + .hero.is-primary .navbar-link { + color: rgba(255, 255, 255, 0.7); } + .hero.is-primary a.navbar-item:hover, .hero.is-primary a.navbar-item.is-active, + .hero.is-primary .navbar-link:hover, + .hero.is-primary .navbar-link.is-active { + background-color: #00b89c; + color: #fff; } + .hero.is-primary .tabs a { + color: #fff; + opacity: 0.9; } + .hero.is-primary .tabs a:hover { + opacity: 1; } + .hero.is-primary .tabs li.is-active a { + opacity: 1; } + .hero.is-primary .tabs.is-boxed a, .hero.is-primary .tabs.is-toggle a { + color: #fff; } + .hero.is-primary .tabs.is-boxed a:hover, .hero.is-primary .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-primary .tabs.is-boxed li.is-active a, .hero.is-primary .tabs.is-boxed li.is-active a:hover, .hero.is-primary .tabs.is-toggle li.is-active a, .hero.is-primary .tabs.is-toggle li.is-active a:hover { + background-color: #fff; + border-color: #fff; + color: #00d1b2; } + .hero.is-primary.is-bold { + background-image: linear-gradient(141deg, #009e6c 0%, #00d1b2 71%, #00e7eb 100%); } + @media screen and (max-width: 768px) { + .hero.is-primary.is-bold .navbar-menu { + background-image: linear-gradient(141deg, #009e6c 0%, #00d1b2 71%, #00e7eb 100%); } } + .hero.is-link { + background-color: #33B2E8; + color: #fff; } + .hero.is-link a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-link strong { + color: inherit; } + .hero.is-link .title { + color: #fff; } + .hero.is-link .subtitle { + color: rgba(255, 255, 255, 0.9); } + .hero.is-link .subtitle a:not(.button), + .hero.is-link .subtitle strong { + color: #fff; } + @media screen and (max-width: 1087px) { + .hero.is-link .navbar-menu { + background-color: #33B2E8; } } + .hero.is-link .navbar-item, + .hero.is-link .navbar-link { + color: rgba(255, 255, 255, 0.7); } + .hero.is-link a.navbar-item:hover, .hero.is-link a.navbar-item.is-active, + .hero.is-link .navbar-link:hover, + .hero.is-link .navbar-link.is-active { + background-color: #1ca9e5; + color: #fff; } + .hero.is-link .tabs a { + color: #fff; + opacity: 0.9; } + .hero.is-link .tabs a:hover { + opacity: 1; } + .hero.is-link .tabs li.is-active a { + opacity: 1; } + .hero.is-link .tabs.is-boxed a, .hero.is-link .tabs.is-toggle a { + color: #fff; } + .hero.is-link .tabs.is-boxed a:hover, .hero.is-link .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-link .tabs.is-boxed li.is-active a, .hero.is-link .tabs.is-boxed li.is-active a:hover, .hero.is-link .tabs.is-toggle li.is-active a, .hero.is-link .tabs.is-toggle li.is-active a:hover { + background-color: #fff; + border-color: #fff; + color: #33B2E8; } + .hero.is-link.is-bold { + background-image: linear-gradient(141deg, #0cc1dc 0%, #33B2E8 71%, #45a0f0 100%); } + @media screen and (max-width: 768px) { + .hero.is-link.is-bold .navbar-menu { + background-image: linear-gradient(141deg, #0cc1dc 0%, #33B2E8 71%, #45a0f0 100%); } } + .hero.is-info { + background-color: #209cee; + color: #fff; } + .hero.is-info a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-info strong { + color: inherit; } + .hero.is-info .title { + color: #fff; } + .hero.is-info .subtitle { + color: rgba(255, 255, 255, 0.9); } + .hero.is-info .subtitle a:not(.button), + .hero.is-info .subtitle strong { + color: #fff; } + @media screen and (max-width: 1087px) { + .hero.is-info .navbar-menu { + background-color: #209cee; } } + .hero.is-info .navbar-item, + .hero.is-info .navbar-link { + color: rgba(255, 255, 255, 0.7); } + .hero.is-info a.navbar-item:hover, .hero.is-info a.navbar-item.is-active, + .hero.is-info .navbar-link:hover, + .hero.is-info .navbar-link.is-active { + background-color: #118fe4; + color: #fff; } + .hero.is-info .tabs a { + color: #fff; + opacity: 0.9; } + .hero.is-info .tabs a:hover { + opacity: 1; } + .hero.is-info .tabs li.is-active a { + opacity: 1; } + .hero.is-info .tabs.is-boxed a, .hero.is-info .tabs.is-toggle a { + color: #fff; } + .hero.is-info .tabs.is-boxed a:hover, .hero.is-info .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-info .tabs.is-boxed li.is-active a, .hero.is-info .tabs.is-boxed li.is-active a:hover, .hero.is-info .tabs.is-toggle li.is-active a, .hero.is-info .tabs.is-toggle li.is-active a:hover { + background-color: #fff; + border-color: #fff; + color: #209cee; } + .hero.is-info.is-bold { + background-image: linear-gradient(141deg, #04a6d7 0%, #209cee 71%, #3287f5 100%); } + @media screen and (max-width: 768px) { + .hero.is-info.is-bold .navbar-menu { + background-image: linear-gradient(141deg, #04a6d7 0%, #209cee 71%, #3287f5 100%); } } + .hero.is-success { + background-color: #23d160; + color: #fff; } + .hero.is-success a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-success strong { + color: inherit; } + .hero.is-success .title { + color: #fff; } + .hero.is-success .subtitle { + color: rgba(255, 255, 255, 0.9); } + .hero.is-success .subtitle a:not(.button), + .hero.is-success .subtitle strong { + color: #fff; } + @media screen and (max-width: 1087px) { + .hero.is-success .navbar-menu { + background-color: #23d160; } } + .hero.is-success .navbar-item, + .hero.is-success .navbar-link { + color: rgba(255, 255, 255, 0.7); } + .hero.is-success a.navbar-item:hover, .hero.is-success a.navbar-item.is-active, + .hero.is-success .navbar-link:hover, + .hero.is-success .navbar-link.is-active { + background-color: #20bc56; + color: #fff; } + .hero.is-success .tabs a { + color: #fff; + opacity: 0.9; } + .hero.is-success .tabs a:hover { + opacity: 1; } + .hero.is-success .tabs li.is-active a { + opacity: 1; } + .hero.is-success .tabs.is-boxed a, .hero.is-success .tabs.is-toggle a { + color: #fff; } + .hero.is-success .tabs.is-boxed a:hover, .hero.is-success .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-success .tabs.is-boxed li.is-active a, .hero.is-success .tabs.is-boxed li.is-active a:hover, .hero.is-success .tabs.is-toggle li.is-active a, .hero.is-success .tabs.is-toggle li.is-active a:hover { + background-color: #fff; + border-color: #fff; + color: #23d160; } + .hero.is-success.is-bold { + background-image: linear-gradient(141deg, #12af2f 0%, #23d160 71%, #2ce28a 100%); } + @media screen and (max-width: 768px) { + .hero.is-success.is-bold .navbar-menu { + background-image: linear-gradient(141deg, #12af2f 0%, #23d160 71%, #2ce28a 100%); } } + .hero.is-warning { + background-color: #ffdd57; + color: rgba(0, 0, 0, 0.7); } + .hero.is-warning a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-warning strong { + color: inherit; } + .hero.is-warning .title { + color: rgba(0, 0, 0, 0.7); } + .hero.is-warning .subtitle { + color: rgba(0, 0, 0, 0.9); } + .hero.is-warning .subtitle a:not(.button), + .hero.is-warning .subtitle strong { + color: rgba(0, 0, 0, 0.7); } + @media screen and (max-width: 1087px) { + .hero.is-warning .navbar-menu { + background-color: #ffdd57; } } + .hero.is-warning .navbar-item, + .hero.is-warning .navbar-link { + color: rgba(0, 0, 0, 0.7); } + .hero.is-warning a.navbar-item:hover, .hero.is-warning a.navbar-item.is-active, + .hero.is-warning .navbar-link:hover, + .hero.is-warning .navbar-link.is-active { + background-color: #ffd83d; + color: rgba(0, 0, 0, 0.7); } + .hero.is-warning .tabs a { + color: rgba(0, 0, 0, 0.7); + opacity: 0.9; } + .hero.is-warning .tabs a:hover { + opacity: 1; } + .hero.is-warning .tabs li.is-active a { + opacity: 1; } + .hero.is-warning .tabs.is-boxed a, .hero.is-warning .tabs.is-toggle a { + color: rgba(0, 0, 0, 0.7); } + .hero.is-warning .tabs.is-boxed a:hover, .hero.is-warning .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-warning .tabs.is-boxed li.is-active a, .hero.is-warning .tabs.is-boxed li.is-active a:hover, .hero.is-warning .tabs.is-toggle li.is-active a, .hero.is-warning .tabs.is-toggle li.is-active a:hover { + background-color: rgba(0, 0, 0, 0.7); + border-color: rgba(0, 0, 0, 0.7); + color: #ffdd57; } + .hero.is-warning.is-bold { + background-image: linear-gradient(141deg, #ffaf24 0%, #ffdd57 71%, #fffa70 100%); } + @media screen and (max-width: 768px) { + .hero.is-warning.is-bold .navbar-menu { + background-image: linear-gradient(141deg, #ffaf24 0%, #ffdd57 71%, #fffa70 100%); } } + .hero.is-danger { + background-color: #ff3860; + color: #fff; } + .hero.is-danger a:not(.button):not(.dropdown-item):not(.tag), + .hero.is-danger strong { + color: inherit; } + .hero.is-danger .title { + color: #fff; } + .hero.is-danger .subtitle { + color: rgba(255, 255, 255, 0.9); } + .hero.is-danger .subtitle a:not(.button), + .hero.is-danger .subtitle strong { + color: #fff; } + @media screen and (max-width: 1087px) { + .hero.is-danger .navbar-menu { + background-color: #ff3860; } } + .hero.is-danger .navbar-item, + .hero.is-danger .navbar-link { + color: rgba(255, 255, 255, 0.7); } + .hero.is-danger a.navbar-item:hover, .hero.is-danger a.navbar-item.is-active, + .hero.is-danger .navbar-link:hover, + .hero.is-danger .navbar-link.is-active { + background-color: #ff1f4b; + color: #fff; } + .hero.is-danger .tabs a { + color: #fff; + opacity: 0.9; } + .hero.is-danger .tabs a:hover { + opacity: 1; } + .hero.is-danger .tabs li.is-active a { + opacity: 1; } + .hero.is-danger .tabs.is-boxed a, .hero.is-danger .tabs.is-toggle a { + color: #fff; } + .hero.is-danger .tabs.is-boxed a:hover, .hero.is-danger .tabs.is-toggle a:hover { + background-color: rgba(10, 10, 10, 0.1); } + .hero.is-danger .tabs.is-boxed li.is-active a, .hero.is-danger .tabs.is-boxed li.is-active a:hover, .hero.is-danger .tabs.is-toggle li.is-active a, .hero.is-danger .tabs.is-toggle li.is-active a:hover { + background-color: #fff; + border-color: #fff; + color: #ff3860; } + .hero.is-danger.is-bold { + background-image: linear-gradient(141deg, #ff0561 0%, #ff3860 71%, #ff5257 100%); } + @media screen and (max-width: 768px) { + .hero.is-danger.is-bold .navbar-menu { + background-image: linear-gradient(141deg, #ff0561 0%, #ff3860 71%, #ff5257 100%); } } + .hero.is-small .hero-body { + padding-bottom: 1.5rem; + padding-top: 1.5rem; } + @media screen and (min-width: 769px), print { + .hero.is-medium .hero-body { + padding-bottom: 9rem; + padding-top: 9rem; } } + @media screen and (min-width: 769px), print { + .hero.is-large .hero-body { + padding-bottom: 18rem; + padding-top: 18rem; } } + .hero.is-halfheight .hero-body, .hero.is-fullheight .hero-body { + align-items: center; + display: flex; } + .hero.is-halfheight .hero-body > .container, .hero.is-fullheight .hero-body > .container { + flex-grow: 1; + flex-shrink: 1; } + .hero.is-halfheight { + min-height: 50vh; } + .hero.is-fullheight { + min-height: 100vh; } + +.hero-video { + overflow: hidden; } + .hero-video video { + left: 50%; + min-height: 100%; + min-width: 100%; + position: absolute; + top: 50%; + transform: translate3d(-50%, -50%, 0); } + .hero-video.is-transparent { + opacity: 0.3; } + @media screen and (max-width: 768px) { + .hero-video { + display: none; } } + +.hero-buttons { + margin-top: 1.5rem; } + @media screen and (max-width: 768px) { + .hero-buttons .button { + display: flex; } + .hero-buttons .button:not(:last-child) { + margin-bottom: 0.75rem; } } + @media screen and (min-width: 769px), print { + .hero-buttons { + display: flex; + justify-content: center; } + .hero-buttons .button:not(:last-child) { + margin-right: 1.5rem; } } + +.hero-head, +.hero-foot { + flex-grow: 0; + flex-shrink: 0; } + +.hero-body { + flex-grow: 1; + flex-shrink: 0; + padding: 3rem 1.5rem; } + +.section { + padding: 3rem 1.5rem; } + @media screen and (min-width: 1088px) { + .section.is-medium { + padding: 9rem 1.5rem; } + .section.is-large { + padding: 18rem 1.5rem; } } + +.footer { + background-color: #fafafa; + padding: 3rem 1.5rem 6rem; } diff --git a/scm-ui/src/containers/App.js b/scm-ui/src/containers/App.js new file mode 100644 index 0000000000..47b5d7e811 --- /dev/null +++ b/scm-ui/src/containers/App.js @@ -0,0 +1,92 @@ +import React, { Component } from "react"; +import Main from "./Main"; +import { connect } from "react-redux"; +import { translate } from "react-i18next"; +import { withRouter } from "react-router-dom"; +import { + fetchMe, + isAuthenticated, + getMe, + isFetchMePending, + getFetchMeFailure +} from "../modules/auth"; + +import "./App.css"; +import "../components/modals/ConfirmAlert.css"; +import { PrimaryNavigation } from "../components/navigation"; +import Loading from "../components/Loading"; +import ErrorPage from "../components/ErrorPage"; +import { Footer, Header } from "../components/layout"; + +type Props = { + me: Me, + authenticated: boolean, + error: Error, + loading: boolean, + + // dispatcher functions + fetchMe: () => void, + + // context props + t: string => string +}; + +class App extends Component { + componentDidMount() { + this.props.fetchMe(); + } + + render() { + const { me, loading, error, authenticated, t } = this.props; + + let content; + const navigation = authenticated ? : ""; + + if (loading) { + content = ; + } else if (error) { + content = ( + + ); + } else { + content =
    ; + } + return ( +
    +
    {navigation}
    + {content} +
    +
    + ); + } +} + +const mapDispatchToProps = (dispatch: any) => { + return { + fetchMe: () => dispatch(fetchMe()) + }; +}; + +const mapStateToProps = state => { + const authenticated = isAuthenticated(state); + const me = getMe(state); + const loading = isFetchMePending(state); + const error = getFetchMeFailure(state); + return { + authenticated, + me, + loading, + error + }; +}; + +export default withRouter( + connect( + mapStateToProps, + mapDispatchToProps + )(translate("commons")(App)) +); diff --git a/scm-ui/src/containers/App.scss b/scm-ui/src/containers/App.scss new file mode 100644 index 0000000000..0b26d6e0f0 --- /dev/null +++ b/scm-ui/src/containers/App.scss @@ -0,0 +1,35 @@ +@import "bulma/sass/utilities/initial-variables"; +@import "bulma/sass/utilities/functions"; + +$blue: #33B2E8; + +// $footer-background-color + +.is-ellipsis-overflow { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.has-rounded-border { + border-radius: 0.25rem; +} + +.is-full-width { + width: 100%; +} + +.fitParent { + // TODO get rid of important + margin: 0 !important; + // 3.8em for line-numbers + padding: 0 0 0 3.8em !important; +} + +html, body { + background-color: whitesmoke; + height: 100%; +} + +// 6. Import the rest of Bulma +@import "bulma/bulma"; diff --git a/scm-ui/src/containers/Login.js b/scm-ui/src/containers/Login.js new file mode 100644 index 0000000000..d58a892af6 --- /dev/null +++ b/scm-ui/src/containers/Login.js @@ -0,0 +1,167 @@ +//@flow +import React from "react"; +import { Redirect, withRouter } from "react-router-dom"; +import injectSheet from "react-jss"; +import { translate } from "react-i18next"; +import { + login, + isAuthenticated, + isLoginPending, + getLoginFailure +} from "../modules/auth"; +import { connect } from "react-redux"; + +import { InputField } from "../components/forms"; +import { SubmitButton } from "../components/buttons"; + +import classNames from "classnames"; +import Avatar from "../images/blib.jpg"; +import ErrorNotification from "../components/ErrorNotification"; + +const styles = { + avatar: { + marginTop: "-70px", + paddingBottom: "20px" + }, + avatarImage: { + border: "1px solid lightgray", + padding: "5px", + background: "#fff", + borderRadius: "50%", + width: "128px", + height: "128px" + }, + avatarSpacing: { + marginTop: "5rem" + } +}; + +type Props = { + authenticated: boolean, + loading: boolean, + error: Error, + + // dispatcher props + login: (username: string, password: string) => void, + + // context props + t: string => string, + classes: any, + from: any, + location: any +}; + +type State = { + username: string, + password: string +}; + +class Login extends React.Component { + constructor(props: Props) { + super(props); + this.state = { username: "", password: "" }; + } + + handleUsernameChange = (value: string) => { + this.setState({ username: value }); + }; + + handlePasswordChange = (value: string) => { + this.setState({ password: value }); + }; + + handleSubmit = (event: Event) => { + event.preventDefault(); + if (this.isValid()) { + this.props.login(this.state.username, this.state.password); + } + }; + + isValid() { + return this.state.username && this.state.password; + } + + isInValid() { + return !this.isValid(); + } + + renderRedirect = () => { + const { from } = this.props.location.state || { from: { pathname: "/" } }; + return ; + }; + + render() { + const { authenticated, loading, error, t, classes } = this.props; + + if (authenticated) { + return this.renderRedirect(); + } + + return ( +
    +
    +
    +
    +

    {t("login.title")}

    +

    {t("login.subtitle")}

    +
    +
    + {t("login.logo-alt")} +
    + +
    + + + + +
    +
    +
    +
    +
    + ); + } +} + +const mapStateToProps = state => { + const authenticated = isAuthenticated(state); + const loading = isLoginPending(state); + const error = getLoginFailure(state); + return { + authenticated, + loading, + error + }; +}; + +const mapDispatchToProps = dispatch => { + return { + login: (username: string, password: string) => + dispatch(login(username, password)) + }; +}; + +const StyledLogin = injectSheet(styles)( + connect( + mapStateToProps, + mapDispatchToProps + )(translate("commons")(Login)) +); +export default withRouter(StyledLogin); diff --git a/scm-ui/src/containers/Logout.js b/scm-ui/src/containers/Logout.js new file mode 100644 index 0000000000..787d6d4301 --- /dev/null +++ b/scm-ui/src/containers/Logout.js @@ -0,0 +1,71 @@ +//@flow +import React from "react"; +import { connect } from "react-redux"; +import { translate } from "react-i18next"; +import { Redirect } from "react-router-dom"; + +import { + logout, + isAuthenticated, + isLogoutPending, + getLogoutFailure +} from "../modules/auth"; +import ErrorPage from "../components/ErrorPage"; +import Loading from "../components/Loading"; + +type Props = { + authenticated: boolean, + loading: boolean, + error: Error, + + // dispatcher functions + logout: () => void, + + // context props + t: string => string +}; + +class Logout extends React.Component { + componentDidMount() { + this.props.logout(); + } + + render() { + const { authenticated, loading, error, t } = this.props; + if (error) { + return ( + + ); + } else if (loading || authenticated) { + return ; + } else { + return ; + } + } +} + +const mapStateToProps = state => { + const authenticated = isAuthenticated(state); + const loading = isLogoutPending(state); + const error = getLogoutFailure(state); + return { + authenticated, + loading, + error + }; +}; + +const mapDispatchToProps = dispatch => { + return { + logout: () => dispatch(logout()) + }; +}; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(translate("commons")(Logout)); diff --git a/scm-ui/src/containers/Main.js b/scm-ui/src/containers/Main.js new file mode 100644 index 0000000000..536227aec6 --- /dev/null +++ b/scm-ui/src/containers/Main.js @@ -0,0 +1,62 @@ +//@flow +import React from "react"; + +import { Route, withRouter } from "react-router"; + +import Repositories from "../repositories/containers/Repositories"; +import Users from "../users/containers/Users"; +import Login from "../containers/Login"; +import Logout from "../containers/Logout"; + +import { Switch } from "react-router-dom"; +import ProtectedRoute from "../components/ProtectedRoute"; +import AddUser from "../users/containers/AddUser"; +import SingleUser from "../users/containers/SingleUser"; + +type Props = { + authenticated?: boolean +}; + +class Main extends React.Component { + render() { + const { authenticated } = this.props; + return ( +
    + + + + + + + + + +
    + ); + } +} + +export default withRouter(Main); diff --git a/scm-ui/src/createReduxStore.js b/scm-ui/src/createReduxStore.js new file mode 100644 index 0000000000..dd16f9cbfc --- /dev/null +++ b/scm-ui/src/createReduxStore.js @@ -0,0 +1,32 @@ +// @flow +import thunk from "redux-thunk"; +import logger from "redux-logger"; +import { createStore, compose, applyMiddleware, combineReducers } from "redux"; +import { routerReducer, routerMiddleware } from "react-router-redux"; + +import users from "./users/modules/users"; +import auth from "./modules/auth"; +import pending from "./modules/pending"; +import failure from "./modules/failure"; + +import type { BrowserHistory } from "history/createBrowserHistory"; + +function createReduxStore(history: BrowserHistory) { + const composeEnhancers = + window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; + + const reducer = combineReducers({ + router: routerReducer, + pending, + failure, + users, + auth + }); + + return createStore( + reducer, + composeEnhancers(applyMiddleware(routerMiddleware(history), thunk, logger)) + ); +} + +export default createReduxStore; diff --git a/scm-ui/src/i18n.js b/scm-ui/src/i18n.js new file mode 100644 index 0000000000..954d47c605 --- /dev/null +++ b/scm-ui/src/i18n.js @@ -0,0 +1,37 @@ +import i18n from "i18next"; +import Backend from "i18next-fetch-backend"; +import LanguageDetector from "i18next-browser-languagedetector"; +import { reactI18nextModule } from "react-i18next"; + +const loadPath = process.env.PUBLIC_URL + "/locales/{{lng}}/{{ns}}.json"; + +i18n + .use(Backend) + .use(LanguageDetector) + .use(reactI18nextModule) + .init({ + fallbackLng: "en", + + // have a common namespace used around the full app + ns: ["commons"], + defaultNS: "commons", + + debug: true, + + interpolation: { + escapeValue: false // not needed for react!! + }, + + react: { + wait: true + }, + + backend: { + loadPath: loadPath, + init: { + credentials: "same-origin" + } + } + }); + +export default i18n; diff --git a/scm-ui/src/images/blib.jpg b/scm-ui/src/images/blib.jpg new file mode 100644 index 0000000000..5fa47ab2bc Binary files /dev/null and b/scm-ui/src/images/blib.jpg differ diff --git a/scm-ui/src/images/loading.svg b/scm-ui/src/images/loading.svg new file mode 100644 index 0000000000..1ad4970de2 --- /dev/null +++ b/scm-ui/src/images/loading.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/scm-ui/src/images/logo.png b/scm-ui/src/images/logo.png new file mode 100644 index 0000000000..1557367c9e Binary files /dev/null and b/scm-ui/src/images/logo.png differ diff --git a/scm-ui/src/index.js b/scm-ui/src/index.js new file mode 100644 index 0000000000..ea133dd55b --- /dev/null +++ b/scm-ui/src/index.js @@ -0,0 +1,46 @@ +// @flow +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./containers/App"; +import registerServiceWorker from "./registerServiceWorker"; + +import { I18nextProvider } from "react-i18next"; +import i18n from "./i18n"; + +import { Provider } from "react-redux"; +import createHistory from "history/createBrowserHistory"; + +import type { BrowserHistory } from "history/createBrowserHistory"; + +import createReduxStore from "./createReduxStore"; +import { ConnectedRouter } from "react-router-redux"; + +const publicUrl: string = process.env.PUBLIC_URL || ""; + +// Create a history of your choosing (we're using a browser history in this case) +const history: BrowserHistory = createHistory({ + basename: publicUrl +}); + +// Add the reducer to your store on the `router` key +// Also apply our middleware for navigating +const store = createReduxStore(history); + +const root = document.getElementById("root"); +if (!root) { + throw new Error("could not find root element"); +} + +ReactDOM.render( + + + {/* ConnectedRouter will use the store from Provider automatically */} + + + + + , + root +); + +registerServiceWorker(); diff --git a/scm-ui/src/modules/auth.js b/scm-ui/src/modules/auth.js new file mode 100644 index 0000000000..74afd8259b --- /dev/null +++ b/scm-ui/src/modules/auth.js @@ -0,0 +1,235 @@ +// @flow +import type { Me } from "../types/Me"; +import * as types from "./types"; + +import { apiClient, UNAUTHORIZED_ERROR } from "../apiclient"; +import { isPending } from "./pending"; +import { getFailure } from "./failure"; + +// Action + +export const LOGIN = "scm/auth/LOGIN"; +export const LOGIN_PENDING = `${LOGIN}_${types.PENDING_SUFFIX}`; +export const LOGIN_SUCCESS = `${LOGIN}_${types.SUCCESS_SUFFIX}`; +export const LOGIN_FAILURE = `${LOGIN}_${types.FAILURE_SUFFIX}`; + +export const FETCH_ME = "scm/auth/FETCH_ME"; +export const FETCH_ME_PENDING = `${FETCH_ME}_${types.PENDING_SUFFIX}`; +export const FETCH_ME_SUCCESS = `${FETCH_ME}_${types.SUCCESS_SUFFIX}`; +export const FETCH_ME_FAILURE = `${FETCH_ME}_${types.FAILURE_SUFFIX}`; +export const FETCH_ME_UNAUTHORIZED = `${FETCH_ME}_UNAUTHORIZED`; + +export const LOGOUT = "scm/auth/LOGOUT"; +export const LOGOUT_PENDING = `${LOGOUT}_${types.PENDING_SUFFIX}`; +export const LOGOUT_SUCCESS = `${LOGOUT}_${types.SUCCESS_SUFFIX}`; +export const LOGOUT_FAILURE = `${LOGOUT}_${types.FAILURE_SUFFIX}`; + +// Reducer + +const initialState = {}; + +export default function reducer( + state: Object = initialState, + action: Object = { type: "UNKNOWN" } +) { + switch (action.type) { + case LOGIN_SUCCESS: + case FETCH_ME_SUCCESS: + return { + ...state, + me: action.payload, + authenticated: true + }; + case FETCH_ME_UNAUTHORIZED: + return { + me: {}, + authenticated: false + }; + case LOGOUT_SUCCESS: + return initialState; + + default: + return state; + } +} + +// Action Creators + +export const loginPending = () => { + return { + type: LOGIN_PENDING + }; +}; + +export const loginSuccess = (me: Me) => { + return { + type: LOGIN_SUCCESS, + payload: me + }; +}; + +export const loginFailure = (error: Error) => { + return { + type: LOGIN_FAILURE, + payload: error + }; +}; + +export const logoutPending = () => { + return { + type: LOGOUT_PENDING + }; +}; + +export const logoutSuccess = () => { + return { + type: LOGOUT_SUCCESS + }; +}; + +export const logoutFailure = (error: Error) => { + return { + type: LOGOUT_FAILURE, + payload: error + }; +}; + +export const fetchMePending = () => { + return { + type: FETCH_ME_PENDING + }; +}; + +export const fetchMeSuccess = (me: Me) => { + return { + type: FETCH_ME_SUCCESS, + payload: me + }; +}; + +export const fetchMeUnauthenticated = () => { + return { + type: FETCH_ME_UNAUTHORIZED, + resetPending: true + }; +}; + +export const fetchMeFailure = (error: Error) => { + return { + type: FETCH_ME_FAILURE, + payload: error + }; +}; + +// urls + +const ME_URL = "/me"; +const LOGIN_URL = "/auth/access_token"; + +// side effects + +const callFetchMe = (): Promise => { + return apiClient + .get(ME_URL) + .then(response => { + return response.json(); + }) + .then(json => { + return { name: json.name, displayName: json.displayName }; + }); +}; + +export const login = (username: string, password: string) => { + const login_data = { + cookie: true, + grant_type: "password", + username, + password + }; + return function(dispatch: any) { + dispatch(loginPending()); + return apiClient + .post(LOGIN_URL, login_data) + .then(response => { + return callFetchMe(); + }) + .then(me => { + dispatch(loginSuccess(me)); + }) + .catch(err => { + dispatch(loginFailure(err)); + }); + }; +}; + +export const fetchMe = () => { + return function(dispatch: any) { + dispatch(fetchMePending()); + return callFetchMe() + .then(me => { + dispatch(fetchMeSuccess(me)); + }) + .catch((error: Error) => { + if (error === UNAUTHORIZED_ERROR) { + dispatch(fetchMeUnauthenticated()); + } else { + dispatch(fetchMeFailure(error)); + } + }); + }; +}; + +export const logout = () => { + return function(dispatch: any) { + dispatch(logoutPending()); + return apiClient + .delete(LOGIN_URL) + .then(() => { + dispatch(logoutSuccess()); + }) + .catch(error => { + dispatch(logoutFailure(error)); + }); + }; +}; + +// selectors + +const stateAuth = (state: Object): Object => { + return state.auth || {}; +}; + +export const isAuthenticated = (state: Object) => { + if (stateAuth(state).authenticated) { + return true; + } + return false; +}; + +export const getMe = (state: Object): Me => { + return stateAuth(state).me; +}; + +export const isFetchMePending = (state: Object) => { + return isPending(state, FETCH_ME); +}; + +export const getFetchMeFailure = (state: Object) => { + return getFailure(state, FETCH_ME); +}; + +export const isLoginPending = (state: Object) => { + return isPending(state, LOGIN); +}; + +export const getLoginFailure = (state: Object) => { + return getFailure(state, LOGIN); +}; + +export const isLogoutPending = (state: Object) => { + return isPending(state, LOGOUT); +}; + +export const getLogoutFailure = (state: Object) => { + return getFailure(state, LOGOUT); +}; diff --git a/scm-ui/src/modules/auth.test.js b/scm-ui/src/modules/auth.test.js new file mode 100644 index 0000000000..f994e8f657 --- /dev/null +++ b/scm-ui/src/modules/auth.test.js @@ -0,0 +1,279 @@ +import reducer, { + fetchMeSuccess, + logout, + logoutSuccess, + loginSuccess, + fetchMeUnauthenticated, + LOGIN_SUCCESS, + login, + LOGIN_FAILURE, + LOGOUT_FAILURE, + LOGOUT_SUCCESS, + FETCH_ME_SUCCESS, + fetchMe, + FETCH_ME_FAILURE, + FETCH_ME_UNAUTHORIZED, + isAuthenticated, + LOGIN_PENDING, + FETCH_ME_PENDING, + LOGOUT_PENDING, + getMe, + isFetchMePending, + isLoginPending, + isLogoutPending, + getFetchMeFailure, + LOGIN, + FETCH_ME, + LOGOUT, + getLoginFailure, + getLogoutFailure +} from "./auth"; + +import configureMockStore from "redux-mock-store"; +import thunk from "redux-thunk"; +import fetchMock from "fetch-mock"; + +const me = { name: "tricia", displayName: "Tricia McMillian" }; + +describe("auth reducer", () => { + it("should set me and login on successful fetch of me", () => { + const state = reducer(undefined, fetchMeSuccess(me)); + expect(state.me).toBe(me); + expect(state.authenticated).toBe(true); + }); + + it("should set authenticated to false", () => { + const initialState = { + authenticated: true, + me + }; + const state = reducer(initialState, fetchMeUnauthenticated()); + expect(state.me.name).toBeUndefined(); + expect(state.authenticated).toBe(false); + }); + + it("should reset the state after logout", () => { + const initialState = { + authenticated: true, + me + }; + const state = reducer(initialState, logoutSuccess()); + expect(state.me).toBeUndefined(); + expect(state.authenticated).toBeUndefined(); + }); + + it("should set state authenticated and me after login", () => { + const state = reducer(undefined, loginSuccess(me)); + expect(state.me).toBe(me); + expect(state.authenticated).toBe(true); + }); +}); + +describe("auth actions", () => { + const mockStore = configureMockStore([thunk]); + + afterEach(() => { + fetchMock.reset(); + fetchMock.restore(); + }); + + it("should dispatch login success and dispatch fetch me", () => { + fetchMock.postOnce("/scm/api/rest/v2/auth/access_token", { + body: { + cookie: true, + grant_type: "password", + username: "tricia", + password: "secret123" + }, + headers: { "content-type": "application/json" } + }); + + fetchMock.getOnce("/scm/api/rest/v2/me", { + body: me, + headers: { "content-type": "application/json" } + }); + + const expectedActions = [ + { type: LOGIN_PENDING }, + { type: LOGIN_SUCCESS, payload: me } + ]; + + const store = mockStore({}); + + return store.dispatch(login("tricia", "secret123")).then(() => { + expect(store.getActions()).toEqual(expectedActions); + }); + }); + + it("should dispatch login failure", () => { + fetchMock.postOnce("/scm/api/rest/v2/auth/access_token", { + status: 400 + }); + + const store = mockStore({}); + return store.dispatch(login("tricia", "secret123")).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(LOGIN_PENDING); + expect(actions[1].type).toEqual(LOGIN_FAILURE); + expect(actions[1].payload).toBeDefined(); + }); + }); + + it("should dispatch fetch me success", () => { + fetchMock.getOnce("/scm/api/rest/v2/me", { + body: me, + headers: { "content-type": "application/json" } + }); + + const expectedActions = [ + { type: FETCH_ME_PENDING }, + { + type: FETCH_ME_SUCCESS, + payload: me + } + ]; + + const store = mockStore({}); + + return store.dispatch(fetchMe()).then(() => { + expect(store.getActions()).toEqual(expectedActions); + }); + }); + + it("should dispatch fetch me failure", () => { + fetchMock.getOnce("/scm/api/rest/v2/me", { + status: 500 + }); + + const store = mockStore({}); + return store.dispatch(fetchMe()).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(FETCH_ME_PENDING); + expect(actions[1].type).toEqual(FETCH_ME_FAILURE); + expect(actions[1].payload).toBeDefined(); + }); + }); + + it("should dispatch fetch me unauthorized", () => { + fetchMock.getOnce("/scm/api/rest/v2/me", { + status: 401 + }); + + const expectedActions = [ + { type: FETCH_ME_PENDING }, + { type: FETCH_ME_UNAUTHORIZED, resetPending: true } + ]; + + const store = mockStore({}); + + return store.dispatch(fetchMe()).then(() => { + // return of async actions + expect(store.getActions()).toEqual(expectedActions); + }); + }); + + it("should dispatch logout success", () => { + fetchMock.deleteOnce("/scm/api/rest/v2/auth/access_token", { + status: 204 + }); + + fetchMock.getOnce("/scm/api/rest/v2/me", { + status: 401 + }); + + const expectedActions = [ + { type: LOGOUT_PENDING }, + { type: LOGOUT_SUCCESS } + ]; + + const store = mockStore({}); + + return store.dispatch(logout()).then(() => { + expect(store.getActions()).toEqual(expectedActions); + }); + }); + + it("should dispatch logout failure", () => { + fetchMock.deleteOnce("/scm/api/rest/v2/auth/access_token", { + status: 500 + }); + + const store = mockStore({}); + return store.dispatch(logout()).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(LOGOUT_PENDING); + expect(actions[1].type).toEqual(LOGOUT_FAILURE); + expect(actions[1].payload).toBeDefined(); + }); + }); +}); + +describe("auth selectors", () => { + const error = new Error("yo it failed"); + + it("should be false, if authenticated is undefined or false", () => { + expect(isAuthenticated({})).toBe(false); + expect(isAuthenticated({ auth: {} })).toBe(false); + expect(isAuthenticated({ auth: { authenticated: false } })).toBe(false); + }); + + it("should be true, if authenticated is true", () => { + expect(isAuthenticated({ auth: { authenticated: true } })).toBe(true); + }); + + it("should return me", () => { + expect(getMe({ auth: { me } })).toBe(me); + }); + + it("should return undefined, if me is not set", () => { + expect(getMe({})).toBeUndefined(); + }); + + it("should return true, if FETCH_ME is pending", () => { + expect(isFetchMePending({ pending: { [FETCH_ME]: true } })).toBe(true); + }); + + it("should return false, if FETCH_ME is not in pending state", () => { + expect(isFetchMePending({ pending: {} })).toBe(false); + }); + + it("should return true, if LOGIN is pending", () => { + expect(isLoginPending({ pending: { [LOGIN]: true } })).toBe(true); + }); + + it("should return false, if LOGIN is not in pending state", () => { + expect(isLoginPending({ pending: {} })).toBe(false); + }); + + it("should return true, if LOGOUT is pending", () => { + expect(isLogoutPending({ pending: { [LOGOUT]: true } })).toBe(true); + }); + + it("should return false, if LOGOUT is not in pending state", () => { + expect(isLogoutPending({ pending: {} })).toBe(false); + }); + + it("should return the error, if failure state is set for FETCH_ME", () => { + expect(getFetchMeFailure({ failure: { [FETCH_ME]: error } })).toBe(error); + }); + + it("should return unknown, if failure state is not set for FETCH_ME", () => { + expect(getFetchMeFailure({})).toBeUndefined(); + }); + + it("should return the error, if failure state is set for LOGIN", () => { + expect(getLoginFailure({ failure: { [LOGIN]: error } })).toBe(error); + }); + + it("should return unknown, if failure state is not set for LOGIN", () => { + expect(getLoginFailure({})).toBeUndefined(); + }); + + it("should return the error, if failure state is set for LOGOUT", () => { + expect(getLogoutFailure({ failure: { [LOGOUT]: error } })).toBe(error); + }); + + it("should return unknown, if failure state is not set for LOGOUT", () => { + expect(getLogoutFailure({})).toBeUndefined(); + }); +}); diff --git a/scm-ui/src/modules/failure.js b/scm-ui/src/modules/failure.js new file mode 100644 index 0000000000..9328b59e78 --- /dev/null +++ b/scm-ui/src/modules/failure.js @@ -0,0 +1,68 @@ +// @flow +import type { Action } from "../types/Action"; + +const FAILURE_SUFFIX = "_FAILURE"; +const RESET_PATTERN = /^(.*)_(SUCCESS|RESET)$/; + +function extractIdentifierFromFailure(action: Action) { + const type = action.type; + let identifier = type.substring(0, type.length - FAILURE_SUFFIX.length); + if (action.itemId) { + identifier += "/" + action.itemId; + } + return identifier; +} + +function removeFromState(state: Object, identifier: string) { + const newState = {}; + for (let failureType in state) { + if (failureType !== identifier) { + newState[failureType] = state[failureType]; + } + } + return newState; +} + +export default function reducer( + state: Object = {}, + action: Action = { type: "UNKNOWN" } +): Object { + const type = action.type; + if (type.endsWith(FAILURE_SUFFIX)) { + const identifier = extractIdentifierFromFailure(action); + let payload; + if (action.payload instanceof Error) { + payload = action.payload; + } else if (action.payload) { + payload = action.payload.error; + } + return { + ...state, + [identifier]: payload + }; + } else { + const match = RESET_PATTERN.exec(type); + if (match) { + let identifier = match[1]; + if (action.itemId) { + identifier += "/" + action.itemId; + } + return removeFromState(state, identifier); + } + } + return state; +} + +export function getFailure( + state: Object, + actionType: string, + itemId?: string | number +) { + if (state.failure) { + let identifier = actionType; + if (itemId) { + identifier += "/" + itemId; + } + return state.failure[identifier]; + } +} diff --git a/scm-ui/src/modules/failure.test.js b/scm-ui/src/modules/failure.test.js new file mode 100644 index 0000000000..233537fa28 --- /dev/null +++ b/scm-ui/src/modules/failure.test.js @@ -0,0 +1,130 @@ +// @flow +import reducer, { getFailure } from "./failure"; + +const err = new Error("something failed"); +const otherErr = new Error("something else failed"); + +describe("failure reducer", () => { + it("should set the error for FETCH_ITEMS", () => { + const newState = reducer({}, { type: "FETCH_ITEMS_FAILURE", payload: err }); + expect(newState["FETCH_ITEMS"]).toBe(err); + }); + + it("should do nothing for unknown action types", () => { + const state = {}; + const newState = reducer(state, { type: "UNKNOWN" }); + expect(newState).toBe(state); + }); + + it("should set the error for FETCH_ITEMS, if payload has multiple values", () => { + const newState = reducer( + {}, + { + type: "FETCH_ITEMS_FAILURE", + payload: { something: "something", error: err } + } + ); + expect(newState["FETCH_ITEMS"]).toBe(err); + }); + + it("should set the error for FETCH_ITEMS, but should not affect others", () => { + const newState = reducer( + { + FETCH_USERS: otherErr + }, + { type: "FETCH_ITEMS_FAILURE", payload: err } + ); + expect(newState["FETCH_ITEMS"]).toBe(err); + expect(newState["FETCH_USERS"]).toBe(otherErr); + }); + + it("should reset FETCH_ITEMS after FETCH_ITEMS_SUCCESS", () => { + const newState = reducer( + { + FETCH_ITEMS: err + }, + { type: "FETCH_ITEMS_SUCCESS" } + ); + expect(newState["FETCH_ITEMS"]).toBeFalsy(); + }); + + it("should reset FETCH_ITEMS after FETCH_ITEMS_RESET", () => { + const newState = reducer( + { + FETCH_ITEMS: err + }, + { type: "FETCH_ITEMS_RESET" } + ); + expect(newState["FETCH_ITEMS"]).toBeFalsy(); + }); + + it("should reset FETCH_ITEMS after FETCH_ITEMS_RESET, but should not affect others", () => { + const newState = reducer( + { + FETCH_ITEMS: err, + FETCH_USERS: err + }, + { type: "FETCH_ITEMS_RESET" } + ); + expect(newState["FETCH_ITEMS"]).toBeFalsy(); + expect(newState["FETCH_USERS"]).toBe(err); + }); + + it("should set the error for a single item of FETCH_ITEM", () => { + const newState = reducer( + {}, + { type: "FETCH_ITEM_FAILURE", payload: err, itemId: 42 } + ); + expect(newState["FETCH_ITEM/42"]).toBe(err); + }); + + it("should reset error for a single item of FETCH_ITEM", () => { + const newState = reducer( + { "FETCH_ITEM/42": err }, + { type: "FETCH_ITEM_SUCCESS", payload: err, itemId: 42 } + ); + expect(newState["FETCH_ITEM/42"]).toBeUndefined(); + }); +}); + +describe("failure selector", () => { + it("should return failure, if FETCH_ITEMS failure exists", () => { + const failure = getFailure( + { + failure: { + FETCH_ITEMS: err + } + }, + "FETCH_ITEMS" + ); + expect(failure).toBe(err); + }); + + it("should return undefined, if state has no failure", () => { + const failure = getFailure({}, "FETCH_ITEMS"); + expect(failure).toBeUndefined(); + }); + + it("should return undefined, if FETCH_ITEMS is not defined", () => { + const failure = getFailure( + { + failure: {} + }, + "FETCH_ITEMS" + ); + expect(failure).toBeFalsy(); + }); + + it("should return failure, if FETCH_ITEM 42 failure exists", () => { + const failure = getFailure( + { + failure: { + "FETCH_ITEM/42": err + } + }, + "FETCH_ITEM", + 42 + ); + expect(failure).toBe(err); + }); +}); diff --git a/scm-ui/src/modules/pending.js b/scm-ui/src/modules/pending.js new file mode 100644 index 0000000000..3d34257f56 --- /dev/null +++ b/scm-ui/src/modules/pending.js @@ -0,0 +1,71 @@ +// @flow +import type { Action } from "../types/Action"; +import * as types from "./types"; + +const PENDING_SUFFIX = "_" + types.PENDING_SUFFIX; +const RESET_ACTIONTYPES = [ + types.SUCCESS_SUFFIX, + types.FAILURE_SUFFIX, + types.RESET_SUFFIX +]; + +function removeFromState(state: Object, identifier: string) { + let newState = {}; + for (let childType in state) { + if (childType !== identifier) { + newState[childType] = state[childType]; + } + } + return newState; +} + +function extractIdentifierFromPending(action: Action) { + const type = action.type; + let identifier = type.substring(0, type.length - PENDING_SUFFIX.length); + if (action.itemId) { + identifier += "/" + action.itemId; + } + return identifier; +} + +export default function reducer( + state: Object = {}, + action: Action = { type: "UNKNOWN" } +): Object { + const type = action.type; + if (type.endsWith(PENDING_SUFFIX)) { + const identifier = extractIdentifierFromPending(action); + return { + ...state, + [identifier]: true + }; + } else { + const index = type.lastIndexOf("_"); + if (index > 0) { + const actionType = type.substring(index + 1); + if (RESET_ACTIONTYPES.indexOf(actionType) >= 0 || action.resetPending) { + let identifier = type.substring(0, index); + if (action.itemId) { + identifier += "/" + action.itemId; + } + return removeFromState(state, identifier); + } + } + } + return state; +} + +export function isPending( + state: Object, + actionType: string, + itemId?: string | number +) { + let type = actionType; + if (itemId) { + type += "/" + itemId; + } + if (state.pending && state.pending[type]) { + return true; + } + return false; +} diff --git a/scm-ui/src/modules/pending.test.js b/scm-ui/src/modules/pending.test.js new file mode 100644 index 0000000000..082695257e --- /dev/null +++ b/scm-ui/src/modules/pending.test.js @@ -0,0 +1,143 @@ +import reducer, { isPending } from "./pending"; + +describe("pending reducer", () => { + it("should set pending for FETCH_ITEMS to true", () => { + const newState = reducer({}, { type: "FETCH_ITEMS_PENDING" }); + expect(newState["FETCH_ITEMS"]).toBe(true); + }); + + it("should do nothing for unknown action types", () => { + const state = {}; + const newState = reducer(state, { type: "UNKNOWN" }); + expect(newState).toBe(state); + }); + + it("should set pending for FETCH_ITEMS to true, but should not affect others", () => { + const newState = reducer( + { + FETCH_USERS: true + }, + { type: "FETCH_ITEMS_PENDING" } + ); + expect(newState["FETCH_ITEMS"]).toBe(true); + expect(newState["FETCH_USERS"]).toBe(true); + }); + + it("should reset pending state for FETCH_ITEMS after FETCH_ITEMS_SUCCESS", () => { + const newState = reducer( + { + FETCH_ITEMS: true + }, + { type: "FETCH_ITEMS_SUCCESS" } + ); + expect(newState["FETCH_ITEMS"]).toBeFalsy(); + }); + + it("should reset pending state for FETCH_ITEMS after FETCH_ITEMS_FAILURE", () => { + const newState = reducer( + { + FETCH_ITEMS: true + }, + { type: "FETCH_ITEMS_FAILURE" } + ); + expect(newState["FETCH_ITEMS"]).toBeFalsy(); + }); + + it("should reset pending state for FETCH_ITEMS after FETCH_ITEMS_RESET", () => { + const newState = reducer( + { + FETCH_ITEMS: true + }, + { type: "FETCH_ITEMS_RESET" } + ); + expect(newState["FETCH_ITEMS"]).toBeFalsy(); + }); + + it("should reset pending state for FETCH_ITEMS, if resetPending prop is available", () => { + const newState = reducer( + { + FETCH_ITEMS: true + }, + { type: "FETCH_ITEMS_SOMETHING", resetPending: true } + ); + expect(newState["FETCH_ITEMS"]).toBeFalsy(); + }); + + it("should reset pending state for FETCH_ITEMS after FETCH_ITEMS_SUCCESS, but should not affect others", () => { + const newState = reducer( + { + FETCH_USERS: true, + FETCH_ITEMS: true + }, + { type: "FETCH_ITEMS_SUCCESS" } + ); + expect(newState["FETCH_ITEMS"]).toBeFalsy(); + expect(newState["FETCH_USERS"]).toBe(true); + }); + + it("should set pending for a single item", () => { + const newState = reducer( + { + "FETCH_USER/42": false + }, + { type: "FETCH_USER_PENDING", itemId: 21 } + ); + expect(newState["FETCH_USER/21"]).toBe(true); + expect(newState["FETCH_USER/42"]).toBe(false); + }); + + it("should reset pending for a single item", () => { + const newState = reducer( + { + "FETCH_USER/42": true + }, + { type: "FETCH_USER_SUCCESS", itemId: 42 } + ); + expect(newState["FETCH_USER/42"]).toBeFalsy(); + }); +}); + +describe("pending selectors", () => { + it("should return true, while FETCH_ITEMS is pending", () => { + const result = isPending( + { + pending: { + FETCH_ITEMS: true + } + }, + "FETCH_ITEMS" + ); + expect(result).toBe(true); + }); + + it("should return false, if pending is not defined", () => { + const result = isPending({}, "FETCH_ITEMS"); + expect(result).toBe(false); + }); + + it("should return true, while FETCH_ITEM 42 is pending", () => { + const result = isPending( + { + pending: { + "FETCH_ITEM/42": true + } + }, + "FETCH_ITEM", + 42 + ); + expect(result).toBe(true); + }); + + it("should return true, while FETCH_ITEM 42 is undefined", () => { + const result = isPending( + { + pending: { + "FETCH_ITEM/21": true + } + }, + "FETCH_ITEM", + 42 + ); + expect(result).toBe(false); + }); +}); diff --git a/scm-ui/src/modules/types.js b/scm-ui/src/modules/types.js new file mode 100644 index 0000000000..8bf67ab44d --- /dev/null +++ b/scm-ui/src/modules/types.js @@ -0,0 +1,4 @@ +export const PENDING_SUFFIX = "PENDING"; +export const SUCCESS_SUFFIX = "SUCCESS"; +export const FAILURE_SUFFIX = "FAILURE"; +export const RESET_SUFFIX = "RESET"; diff --git a/scm-ui/src/registerServiceWorker.js b/scm-ui/src/registerServiceWorker.js new file mode 100644 index 0000000000..a3e6c0cfc1 --- /dev/null +++ b/scm-ui/src/registerServiceWorker.js @@ -0,0 +1,117 @@ +// In production, we register a service worker to serve assets from local cache. + +// This lets the app load faster on subsequent visits in production, and gives +// it offline capabilities. However, it also means that developers (and users) +// will only see deployed updates on the "N+1" visit to a page, since previously +// cached resources are updated in the background. + +// To learn more about the benefits of this model, read https://goo.gl/KwvDNy. +// This link also includes instructions on opting out of this behavior. + +const isLocalhost = Boolean( + window.location.hostname === 'localhost' || + // [::1] is the IPv6 localhost address. + window.location.hostname === '[::1]' || + // 127.0.0.1/8 is considered localhost for IPv4. + window.location.hostname.match( + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ + ) +); + +export default function register() { + if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { + // The URL constructor is available in all browsers that support SW. + const publicUrl = new URL(process.env.PUBLIC_URL, window.location); + if (publicUrl.origin !== window.location.origin) { + // Our service worker won't work if PUBLIC_URL is on a different origin + // from what our page is served on. This might happen if a CDN is used to + // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374 + return; + } + + window.addEventListener('load', () => { + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; + + if (isLocalhost) { + // This is running on localhost. Lets check if a service worker still exists or not. + checkValidServiceWorker(swUrl); + + // Add some additional logging to localhost, pointing developers to the + // service worker/PWA documentation. + navigator.serviceWorker.ready.then(() => { + console.log( + 'This web app is being served cache-first by a service ' + + 'worker. To learn more, visit https://goo.gl/SC7cgQ' + ); + }); + } else { + // Is not local host. Just register service worker + registerValidSW(swUrl); + } + }); + } +} + +function registerValidSW(swUrl) { + navigator.serviceWorker + .register(swUrl) + .then(registration => { + registration.onupdatefound = () => { + const installingWorker = registration.installing; + installingWorker.onstatechange = () => { + if (installingWorker.state === 'installed') { + if (navigator.serviceWorker.controller) { + // At this point, the old content will have been purged and + // the fresh content will have been added to the cache. + // It's the perfect time to display a "New content is + // available; please refresh." message in your web app. + console.log('New content is available; please refresh.'); + } else { + // At this point, everything has been precached. + // It's the perfect time to display a + // "Content is cached for offline use." message. + console.log('Content is cached for offline use.'); + } + } + }; + }; + }) + .catch(error => { + console.error('Error during service worker registration:', error); + }); +} + +function checkValidServiceWorker(swUrl) { + // Check if the service worker can be found. If it can't reload the page. + fetch(swUrl) + .then(response => { + // Ensure service worker exists, and that we really are getting a JS file. + if ( + response.status === 404 || + response.headers.get('content-type').indexOf('javascript') === -1 + ) { + // No service worker found. Probably a different app. Reload the page. + navigator.serviceWorker.ready.then(registration => { + registration.unregister().then(() => { + window.location.reload(); + }); + }); + } else { + // Service worker found. Proceed as normal. + registerValidSW(swUrl); + } + }) + .catch(() => { + console.log( + 'No internet connection found. App is running in offline mode.' + ); + }); +} + +export function unregister() { + if ('serviceWorker' in navigator) { + navigator.serviceWorker.ready.then(registration => { + registration.unregister(); + }); + } +} diff --git a/scm-ui/src/repositories/containers/Repositories.js b/scm-ui/src/repositories/containers/Repositories.js new file mode 100644 index 0000000000..162c6cfc4d --- /dev/null +++ b/scm-ui/src/repositories/containers/Repositories.js @@ -0,0 +1,24 @@ +// @flow +import React from "react"; +import { Page } from "../../components/layout"; +import { translate } from "react-i18next"; + +type Props = { + t: string => string +}; + +class Repositories extends React.Component { + render() { + const { t } = this.props; + return ( + + {t("repositories.body")} + + ); + } +} + +export default translate("repositories")(Repositories); diff --git a/scm-ui/src/tests/enzyme.js b/scm-ui/src/tests/enzyme.js new file mode 100644 index 0000000000..dd538876a4 --- /dev/null +++ b/scm-ui/src/tests/enzyme.js @@ -0,0 +1,12 @@ +import "raf/polyfill"; +import { configure } from "enzyme"; +import Adapter from "enzyme-adapter-react-16"; + +// Temporary hack to suppress error +// https://github.com/facebook/create-react-app/issues/3199#issuecomment-345024029 +window.requestAnimationFrame = function(callback) { + setTimeout(callback, 0); + return 0; +}; + +configure({ adapter: new Adapter() }); diff --git a/scm-ui/src/tests/i18n.js b/scm-ui/src/tests/i18n.js new file mode 100644 index 0000000000..4f0dcc8f77 --- /dev/null +++ b/scm-ui/src/tests/i18n.js @@ -0,0 +1,7 @@ +jest.mock("react-i18next", () => ({ + // this mock makes sure any components using the translate HoC receive the t function as a prop + translate: () => Component => { + Component.defaultProps = { ...Component.defaultProps, t: key => key }; + return Component; + } +})); diff --git a/scm-ui/src/types/Action.js b/scm-ui/src/types/Action.js new file mode 100644 index 0000000000..20023f60b0 --- /dev/null +++ b/scm-ui/src/types/Action.js @@ -0,0 +1,7 @@ +// @flow +export type Action = { + type: string, + payload?: any, + itemId?: string | number, + resetPending?: boolean +}; diff --git a/scm-ui/src/types/Collection.js b/scm-ui/src/types/Collection.js new file mode 100644 index 0000000000..ffcbf78166 --- /dev/null +++ b/scm-ui/src/types/Collection.js @@ -0,0 +1,12 @@ +// @flow +import type { Links } from "./hal"; + +export type Collection = { + _embedded: Object, + _links: Links +}; + +export type PagedCollection = Collection & { + page: number, + pageTotal: number +}; diff --git a/scm-ui/src/types/Me.js b/scm-ui/src/types/Me.js new file mode 100644 index 0000000000..65e4fc8336 --- /dev/null +++ b/scm-ui/src/types/Me.js @@ -0,0 +1,6 @@ +// @flow + +export type Me = { + name: string, + displayName: string +}; diff --git a/scm-ui/src/types/hal.js b/scm-ui/src/types/hal.js new file mode 100644 index 0000000000..4c68bbab93 --- /dev/null +++ b/scm-ui/src/types/hal.js @@ -0,0 +1,6 @@ +// @flow +export type Link = { + href: string +}; + +export type Links = { [string]: Link }; diff --git a/scm-ui/src/users/components/UserForm.js b/scm-ui/src/users/components/UserForm.js new file mode 100644 index 0000000000..39189ca127 --- /dev/null +++ b/scm-ui/src/users/components/UserForm.js @@ -0,0 +1,208 @@ +// @flow +import React from "react"; +import { translate } from "react-i18next"; +import type { User } from "../types/User"; +import { Checkbox, InputField } from "../../components/forms"; +import { SubmitButton } from "../../components/buttons"; +import * as validator from "./userValidation"; + +type Props = { + submitForm: User => void, + user?: User, + loading?: boolean, + t: string => string +}; + +type State = { + user: User, + mailValidationError: boolean, + nameValidationError: boolean, + displayNameValidationError: boolean, + passwordValidationError: boolean, + validatePasswordError: boolean, + validatePassword: string +}; + +class UserForm extends React.Component { + constructor(props: Props) { + super(props); + + this.state = { + user: { + name: "", + displayName: "", + mail: "", + password: "", + admin: false, + active: false, + _links: {} + }, + mailValidationError: false, + displayNameValidationError: false, + nameValidationError: false, + passwordValidationError: false, + validatePasswordError: false, + validatePassword: "" + }; + } + + componentDidMount() { + const { user } = this.props; + if (user) { + this.setState({ user: { ...user } }); + } + } + + isFalsy(value) { + if (!value) { + return true; + } + return false; + } + + isValid = () => { + const user = this.state.user; + return !( + this.state.validatePasswordError || + this.state.nameValidationError || + this.state.mailValidationError || + this.state.passwordValidationError || + this.state.displayNameValidationError || + this.isFalsy(user.name) || + this.isFalsy(user.displayName) + ); + }; + + submit = (event: Event) => { + event.preventDefault(); + if (this.isValid()) { + this.props.submitForm(this.state.user); + } + }; + + render() { + const { loading, t } = this.props; + const user = this.state.user; + + let nameField = null; + if (!this.props.user) { + nameField = ( + + ); + } + return ( +
    + {nameField} + + + + + + + + + ); + } + + handleUsernameChange = (name: string) => { + this.setState({ + nameValidationError: !validator.isNameValid(name), + user: { ...this.state.user, name } + }); + }; + + handleDisplayNameChange = (displayName: string) => { + this.setState({ + displayNameValidationError: !validator.isDisplayNameValid(displayName), + user: { ...this.state.user, displayName } + }); + }; + + handleEmailChange = (mail: string) => { + this.setState({ + mailValidationError: !validator.isMailValid(mail), + user: { ...this.state.user, mail } + }); + }; + + handlePasswordChange = (password: string) => { + const validatePasswordError = !this.checkPasswords( + password, + this.state.validatePassword + ); + this.setState({ + validatePasswordError: !validator.isPasswordValid(password), + passwordValidationError: validatePasswordError, + user: { ...this.state.user, password } + }); + }; + + handlePasswordValidationChange = (validatePassword: string) => { + const validatePasswordError = this.checkPasswords( + this.state.user.password, + validatePassword + ); + this.setState({ + validatePassword, + passwordValidationError: !validatePasswordError + }); + }; + + checkPasswords = (password1: string, password2: string) => { + return password1 === password2; + }; + + handleAdminChange = (admin: boolean) => { + this.setState({ user: { ...this.state.user, admin } }); + }; + + handleActiveChange = (active: boolean) => { + this.setState({ user: { ...this.state.user, active } }); + }; +} + +export default translate("users")(UserForm); diff --git a/scm-ui/src/users/components/buttons/CreateUserButton.js b/scm-ui/src/users/components/buttons/CreateUserButton.js new file mode 100644 index 0000000000..91d4292509 --- /dev/null +++ b/scm-ui/src/users/components/buttons/CreateUserButton.js @@ -0,0 +1,30 @@ +//@flow +import React from "react"; +import injectSheet from "react-jss"; +import { translate } from "react-i18next"; +import { AddButton } from "../../../components/buttons"; +import classNames from "classnames"; + +const styles = { + spacing: { + margin: "1em 0 0 1em" + } +}; + +type Props = { + t: string => string, + classes: any +}; + +class CreateUserButton extends React.Component { + render() { + const { classes, t } = this.props; + return ( +
    + +
    + ); + } +} + +export default translate("users")(injectSheet(styles)(CreateUserButton)); diff --git a/scm-ui/src/users/components/navLinks/DeleteUserNavLink.js b/scm-ui/src/users/components/navLinks/DeleteUserNavLink.js new file mode 100644 index 0000000000..96334e4560 --- /dev/null +++ b/scm-ui/src/users/components/navLinks/DeleteUserNavLink.js @@ -0,0 +1,57 @@ +// @flow +import React from "react"; +import { translate } from "react-i18next"; +import type { User } from "../../types/User"; +import { confirmAlert } from "../../../components/modals/ConfirmAlert"; +import { NavAction } from "../../../components/navigation"; + +type Props = { + user: User, + confirmDialog?: boolean, + t: string => string, + deleteUser: (user: User) => void +}; + +class DeleteUserNavLink extends React.Component { + static defaultProps = { + confirmDialog: true + }; + + deleteUser = () => { + this.props.deleteUser(this.props.user); + }; + + confirmDelete = () => { + const { t } = this.props; + confirmAlert({ + title: t("delete-user-button.confirm-alert.title"), + message: t("delete-user-button.confirm-alert.message"), + buttons: [ + { + label: t("delete-user-button.confirm-alert.submit"), + onClick: () => this.deleteUser() + }, + { + label: t("delete-user-button.confirm-alert.cancel"), + onClick: () => null + } + ] + }); + }; + + isDeletable = () => { + return this.props.user._links.delete; + }; + + render() { + const { confirmDialog, t } = this.props; + const action = confirmDialog ? this.confirmDelete : this.deleteUser; + + if (!this.isDeletable()) { + return null; + } + return ; + } +} + +export default translate("users")(DeleteUserNavLink); diff --git a/scm-ui/src/users/components/navLinks/DeleteUserNavLink.test.js b/scm-ui/src/users/components/navLinks/DeleteUserNavLink.test.js new file mode 100644 index 0000000000..dddfd0f595 --- /dev/null +++ b/scm-ui/src/users/components/navLinks/DeleteUserNavLink.test.js @@ -0,0 +1,79 @@ +import React from "react"; +import { mount, shallow } from "enzyme"; +import "../../../tests/enzyme"; +import "../../../tests/i18n"; +import DeleteUserNavLink from "./DeleteUserNavLink"; + +import { confirmAlert } from "../../../components/modals/ConfirmAlert"; +jest.mock("../../../components/modals/ConfirmAlert"); + +describe("DeleteUserNavLink", () => { + it("should render nothing, if the delete link is missing", () => { + const user = { + _links: {} + }; + + const navLink = shallow( + {}} /> + ); + expect(navLink.text()).toBe(""); + }); + + it("should render the navLink", () => { + const user = { + _links: { + delete: { + href: "/users" + } + } + }; + + const navLink = mount( + {}} /> + ); + expect(navLink.text()).not.toBe(""); + }); + + it("should open the confirm dialog on navLink click", () => { + const user = { + _links: { + delete: { + href: "/users" + } + } + }; + + const navLink = mount( + {}} /> + ); + navLink.find("a").simulate("click"); + + expect(confirmAlert.mock.calls.length).toBe(1); + }); + + it("should call the delete user function with delete url", () => { + const user = { + _links: { + delete: { + href: "/users" + } + } + }; + + let calledUrl = null; + function capture(user) { + calledUrl = user._links.delete.href; + } + + const navLink = mount( + + ); + navLink.find("a").simulate("click"); + + expect(calledUrl).toBe("/users"); + }); +}); diff --git a/scm-ui/src/users/components/navLinks/EditUserNavLink.js b/scm-ui/src/users/components/navLinks/EditUserNavLink.js new file mode 100644 index 0000000000..82cada5226 --- /dev/null +++ b/scm-ui/src/users/components/navLinks/EditUserNavLink.js @@ -0,0 +1,28 @@ +//@flow +import React from "react"; +import { translate } from "react-i18next"; +import type { User } from "../../types/User"; +import { NavLink } from "../../../components/navigation"; + +type Props = { + t: string => string, + user: User, + editUrl: String +}; + +class EditUserNavLink extends React.Component { + render() { + const { t, editUrl } = this.props; + + if (!this.isEditable()) { + return null; + } + return ; + } + + isEditable = () => { + return this.props.user._links.update; + }; +} + +export default translate("users")(EditUserNavLink); diff --git a/scm-ui/src/users/components/navLinks/EditUserNavLink.test.js b/scm-ui/src/users/components/navLinks/EditUserNavLink.test.js new file mode 100644 index 0000000000..ec46c531a1 --- /dev/null +++ b/scm-ui/src/users/components/navLinks/EditUserNavLink.test.js @@ -0,0 +1,27 @@ +import React from "react"; +import { shallow } from "enzyme"; +import "../../../tests/enzyme"; +import "../../../tests/i18n"; +import EditUserNavLink from "./EditUserNavLink"; + +it("should render nothing, if the edit link is missing", () => { + const user = { + _links: {} + }; + + const navLink = shallow(); + expect(navLink.text()).toBe(""); +}); + +it("should render the navLink", () => { + const user = { + _links: { + update: { + href: "/users" + } + } + }; + + const navLink = shallow(); + expect(navLink.text()).not.toBe(""); +}); diff --git a/scm-ui/src/users/components/navLinks/index.js b/scm-ui/src/users/components/navLinks/index.js new file mode 100644 index 0000000000..a3ccd16a32 --- /dev/null +++ b/scm-ui/src/users/components/navLinks/index.js @@ -0,0 +1,2 @@ +export { default as DeleteUserNavLink } from "./DeleteUserNavLink"; +export { default as EditUserNavLink } from "./EditUserNavLink"; diff --git a/scm-ui/src/users/components/table/Details.js b/scm-ui/src/users/components/table/Details.js new file mode 100644 index 0000000000..269df9db10 --- /dev/null +++ b/scm-ui/src/users/components/table/Details.js @@ -0,0 +1,48 @@ +//@flow +import React from "react"; +import type { User } from "../../types/User"; +import { translate } from "react-i18next"; +import { Checkbox } from "../../../components/forms"; + +type Props = { + user: User, + t: string => string +}; + +class Details extends React.Component { + render() { + const { user, t } = this.props; + return ( + + + + + + + + + + + + + + + + + + + + + + + +
    {t("user.name")}{user.name}
    {t("user.displayName")}{user.displayName}
    {t("user.mail")}{user.mail}
    {t("user.admin")} + +
    {t("user.active")} + +
    + ); + } +} + +export default translate("users")(Details); diff --git a/scm-ui/src/users/components/table/UserRow.js b/scm-ui/src/users/components/table/UserRow.js new file mode 100644 index 0000000000..b801701a21 --- /dev/null +++ b/scm-ui/src/users/components/table/UserRow.js @@ -0,0 +1,31 @@ +// @flow +import React from "react"; +import { Link } from "react-router-dom"; +import type { User } from "../../types/User"; + +type Props = { + user: User +}; + +export default class UserRow extends React.Component { + renderLink(to: string, label: string) { + return {label}; + } + + render() { + const { user } = this.props; + const to = `/user/${user.name}`; + return ( + + {this.renderLink(to, user.name)} + {this.renderLink(to, user.displayName)} + + {user.mail} + + + + + + ); + } +} diff --git a/scm-ui/src/users/components/table/UserTable.js b/scm-ui/src/users/components/table/UserTable.js new file mode 100644 index 0000000000..d34add2636 --- /dev/null +++ b/scm-ui/src/users/components/table/UserTable.js @@ -0,0 +1,35 @@ +// @flow +import React from "react"; +import { translate } from "react-i18next"; +import UserRow from "./UserRow"; +import type { User } from "../../types/User"; + +type Props = { + t: string => string, + users: User[] +}; + +class UserTable extends React.Component { + render() { + const { users, t } = this.props; + return ( + + + + + + + + + + + {users.map((user, index) => { + return ; + })} + +
    {t("user.name")}{t("user.displayName")}{t("user.mail")}{t("user.admin")}
    + ); + } +} + +export default translate("users")(UserTable); diff --git a/scm-ui/src/users/components/table/index.js b/scm-ui/src/users/components/table/index.js new file mode 100644 index 0000000000..e1ef7cec49 --- /dev/null +++ b/scm-ui/src/users/components/table/index.js @@ -0,0 +1,3 @@ +export { default as Details } from "./Details"; +export { default as UserRow } from "./UserRow"; +export { default as UserTable } from "./UserTable"; diff --git a/scm-ui/src/users/components/userValidation.js b/scm-ui/src/users/components/userValidation.js new file mode 100644 index 0000000000..a5d592e4fb --- /dev/null +++ b/scm-ui/src/users/components/userValidation.js @@ -0,0 +1,24 @@ +// @flow + +const nameRegex = /^([A-z0-9.\-_@]|[^ ]([A-z0-9.\-_@ ]*[A-z0-9.\-_@]|[^\s])?)$/; + +export const isNameValid = (name: string) => { + return nameRegex.test(name); +}; + +export const isDisplayNameValid = (displayName: string) => { + if (displayName) { + return true; + } + return false; +}; + +const mailRegex = /^[A-z0-9][\w.-]*@[A-z0-9][\w\-.]*\.[A-z0-9][A-z0-9-]+$/; + +export const isMailValid = (mail: string) => { + return mailRegex.test(mail); +}; + +export const isPasswordValid = (password: string) => { + return password.length > 6 && password.length < 32; +}; diff --git a/scm-ui/src/users/components/userValidation.test.js b/scm-ui/src/users/components/userValidation.test.js new file mode 100644 index 0000000000..370247fe90 --- /dev/null +++ b/scm-ui/src/users/components/userValidation.test.js @@ -0,0 +1,114 @@ +// @flow +import * as validator from "./userValidation"; + +describe("test name validation", () => { + it("should return false", () => { + // invalid names taken from ValidationUtilTest.java + const invalidNames = [ + " test 123", + " test 123 ", + "test 123 ", + "test/123", + "test%123", + "test:123", + "t ", + " t", + " t ", + "" + ]; + for (let name of invalidNames) { + expect(validator.isNameValid(name)).toBe(false); + } + }); + + it("should return true", () => { + // valid names taken from ValidationUtilTest.java + const validNames = [ + "test", + "test.git", + "Test123.git", + "Test123-git", + "Test_user-123.git", + "test@scm-manager.de", + "test 123", + "tt", + "t" + ]; + for (let name of validNames) { + expect(validator.isNameValid(name)).toBe(true); + } + }); +}); + +describe("test displayName validation", () => { + it("should return false", () => { + expect(validator.isDisplayNameValid("")).toBe(false); + }); + + it("should return true", () => { + // valid names taken from ValidationUtilTest.java + const validNames = [ + "Arthur Dent", + "Tricia.McMillan@hitchhiker.com", + "Ford Prefect (ford.prefect@hitchhiker.com)", + "Zaphod Beeblebrox ", + "Marvin, der depressive Roboter" + ]; + for (let name of validNames) { + expect(validator.isDisplayNameValid(name)).toBe(true); + } + }); +}); + +describe("test mail validation", () => { + it("should return false", () => { + // invalid taken from ValidationUtilTest.java + const invalid = [ + "ostfalia.de", + "@ostfalia.de", + "s.sdorra@", + "s.sdorra@ostfalia", + "s.sdorra@@ostfalia.de", + "s.sdorra@ ostfalia.de", + "s.sdorra @ostfalia.de" + ]; + for (let mail of invalid) { + expect(validator.isMailValid(mail)).toBe(false); + } + }); + + it("should return true", () => { + // valid taken from ValidationUtilTest.java + const valid = [ + "s.sdorra@ostfalia.de", + "sdorra@ostfalia.de", + "s.sdorra@hbk-bs.de", + "s.sdorra@gmail.com", + "s.sdorra@t.co", + "s.sdorra@ucla.college", + "s.sdorra@example.xn--p1ai", + "s.sdorra@scm.solutions" + ]; + for (let mail of valid) { + expect(validator.isMailValid(mail)).toBe(true); + } + }); +}); + +describe("test password validation", () => { + it("should return false", () => { + // invalid taken from ValidationUtilTest.java + const invalid = ["", "abc", "aaabbbcccdddeeefffggghhhiiijjjkkk"]; + for (let password of invalid) { + expect(validator.isPasswordValid(password)).toBe(false); + } + }); + + it("should return true", () => { + // valid taken from ValidationUtilTest.java + const valid = ["secret123", "mySuperSecretPassword"]; + for (let password of valid) { + expect(validator.isPasswordValid(password)).toBe(true); + } + }); +}); diff --git a/scm-ui/src/users/containers/AddUser.js b/scm-ui/src/users/containers/AddUser.js new file mode 100644 index 0000000000..a690c147e3 --- /dev/null +++ b/scm-ui/src/users/containers/AddUser.js @@ -0,0 +1,84 @@ +//@flow +import React from "react"; +import { connect } from "react-redux"; +import UserForm from "./../components/UserForm"; +import type { User } from "../types/User"; +import type { History } from "history"; +import { + createUser, + createUserReset, + isCreateUserPending, + getCreateUserFailure +} from "../modules/users"; +import { Page } from "../../components/layout"; +import { translate } from "react-i18next"; + +type Props = { + loading?: boolean, + error?: Error, + + // dispatcher functions + addUser: (user: User, callback?: () => void) => void, + resetForm: () => void, + + // context objects + t: string => string, + history: History +}; + +class AddUser extends React.Component { + componentDidMount() { + this.props.resetForm(); + } + + userCreated = () => { + const { history } = this.props; + history.push("/users"); + }; + + createUser = (user: User) => { + this.props.addUser(user, this.userCreated); + }; + + render() { + const { t, loading, error } = this.props; + + return ( + + this.createUser(user)} + loading={loading} + /> + + ); + } +} + +const mapDispatchToProps = dispatch => { + return { + addUser: (user: User, callback?: () => void) => { + dispatch(createUser(user, callback)); + }, + resetForm: () => { + dispatch(createUserReset()); + } + }; +}; + +const mapStateToProps = (state, ownProps) => { + const loading = isCreateUserPending(state); + const error = getCreateUserFailure(state); + return { + loading, + error + }; +}; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(translate("users")(AddUser)); diff --git a/scm-ui/src/users/containers/EditUser.js b/scm-ui/src/users/containers/EditUser.js new file mode 100644 index 0000000000..3f1a995f77 --- /dev/null +++ b/scm-ui/src/users/containers/EditUser.js @@ -0,0 +1,71 @@ +//@flow +import React from "react"; +import { connect } from "react-redux"; +import { withRouter } from "react-router-dom"; +import UserForm from "./../components/UserForm"; +import type { User } from "../types/User"; +import { + modifyUser, + isModifyUserPending, + getModifyUserFailure +} from "../modules/users"; +import type { History } from "history"; +import ErrorNotification from "../../components/ErrorNotification"; + +type Props = { + loading: boolean, + error: Error, + + // dispatch functions + modifyUser: (user: User, callback?: () => void) => void, + + // context objects + user: User, + history: History +}; + +class EditUser extends React.Component { + userModified = (user: User) => () => { + this.props.history.push(`/user/${user.name}`); + }; + + modifyUser = (user: User) => { + this.props.modifyUser(user, this.userModified(user)); + }; + + render() { + const { user, loading, error } = this.props; + return ( +
    + + this.modifyUser(user)} + user={user} + loading={loading} + /> +
    + ); + } +} + +const mapDispatchToProps = dispatch => { + return { + modifyUser: (user: User, callback?: () => void) => { + dispatch(modifyUser(user, callback)); + } + }; +}; + +const mapStateToProps = (state, ownProps) => { + const loading = isModifyUserPending(state, ownProps.user.name); + const error = getModifyUserFailure(state, ownProps.user.name); + return { + loading, + error + }; +}; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(withRouter(EditUser)); diff --git a/scm-ui/src/users/containers/SingleUser.js b/scm-ui/src/users/containers/SingleUser.js new file mode 100644 index 0000000000..ba3af2d29a --- /dev/null +++ b/scm-ui/src/users/containers/SingleUser.js @@ -0,0 +1,146 @@ +//@flow +import React from "react"; +import { connect } from "react-redux"; +import { Page } from "../../components/layout"; +import { Route } from "react-router"; +import { Details } from "./../components/table"; +import EditUser from "./EditUser"; +import type { User } from "../types/User"; +import type { History } from "history"; +import { + fetchUser, + deleteUser, + getUserByName, + isFetchUserPending, + getFetchUserFailure, + isDeleteUserPending, + getDeleteUserFailure +} from "../modules/users"; +import Loading from "../../components/Loading"; + +import { Navigation, Section, NavLink } from "../../components/navigation"; +import { DeleteUserNavLink, EditUserNavLink } from "./../components/navLinks"; +import ErrorPage from "../../components/ErrorPage"; +import { translate } from "react-i18next"; + +type Props = { + name: string, + user: User, + loading: boolean, + error: Error, + + // dispatcher functions + deleteUser: (user: User, callback?: () => void) => void, + fetchUser: string => void, + + // context objects + t: string => string, + match: any, + history: History +}; + +class SingleUser extends React.Component { + componentDidMount() { + this.props.fetchUser(this.props.name); + } + + userDeleted = () => { + this.props.history.push("/users"); + }; + + deleteUser = (user: User) => { + this.props.deleteUser(user, this.userDeleted); + }; + + stripEndingSlash = (url: string) => { + if (url.endsWith("/")) { + return url.substring(0, url.length - 2); + } + return url; + }; + + matchedUrl = () => { + return this.stripEndingSlash(this.props.match.url); + }; + + render() { + const { t, loading, error, user } = this.props; + + if (error) { + return ( + + ); + } + + if (!user || loading) { + return ; + } + + const url = this.matchedUrl(); + + return ( + +
    +
    +
    } /> + } + /> +
    +
    + +
    + + +
    +
    + + +
    +
    +
    +
    +
    + ); + } +} + +const mapStateToProps = (state, ownProps) => { + const name = ownProps.match.params.name; + const user = getUserByName(state, name); + const loading = + isFetchUserPending(state, name) || isDeleteUserPending(state, name); + const error = + getFetchUserFailure(state, name) || getDeleteUserFailure(state, name); + + return { + name, + user, + loading, + error + }; +}; + +const mapDispatchToProps = dispatch => { + return { + fetchUser: (name: string) => { + dispatch(fetchUser(name)); + }, + deleteUser: (user: User, callback?: () => void) => { + dispatch(deleteUser(user, callback)); + } + }; +}; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(translate("users")(SingleUser)); diff --git a/scm-ui/src/users/containers/Users.js b/scm-ui/src/users/containers/Users.js new file mode 100644 index 0000000000..c9120ba8ec --- /dev/null +++ b/scm-ui/src/users/containers/Users.js @@ -0,0 +1,140 @@ +// @flow +import React from "react"; +import type { History } from "history"; +import { connect } from "react-redux"; +import { translate } from "react-i18next"; + +import { + fetchUsersByPage, + fetchUsersByLink, + getUsersFromState, + selectListAsCollection, + isPermittedToCreateUsers, + isFetchUsersPending, + getFetchUsersFailure +} from "../modules/users"; + +import { Page } from "../../components/layout"; +import { UserTable } from "./../components/table"; +import type { User } from "../types/User"; +import type { PagedCollection } from "../../types/Collection"; +import Paginator from "../../components/Paginator"; +import CreateUserButton from "../components/buttons/CreateUserButton"; + +type Props = { + users: User[], + loading: boolean, + error: Error, + canAddUsers: boolean, + list: PagedCollection, + page: number, + + // context objects + t: string => string, + history: History, + + // dispatch functions + fetchUsersByPage: (page: number) => void, + fetchUsersByLink: (link: string) => void +}; + +class Users extends React.Component { + componentDidMount() { + this.props.fetchUsersByPage(this.props.page); + } + + onPageChange = (link: string) => { + this.props.fetchUsersByLink(link); + }; + + /** + * reflect page transitions in the uri + */ + componentDidUpdate = (prevProps: Props) => { + const { page, list } = this.props; + if (list.page) { + // backend starts paging by 0 + const statePage: number = list.page + 1; + if (page !== statePage) { + this.props.history.push(`/users/${statePage}`); + } + } + }; + + render() { + const { users, loading, error, t } = this.props; + return ( + + + {this.renderPaginator()} + {this.renderCreateButton()} + + ); + } + + renderPaginator() { + const { list } = this.props; + if (list) { + return ; + } + return null; + } + + renderCreateButton() { + if (this.props.canAddUsers) { + return ; + } else { + return; + } + } +} + +const getPageFromProps = props => { + let page = props.match.params.page; + if (page) { + page = parseInt(page, 10); + } else { + page = 1; + } + return page; +}; + +const mapStateToProps = (state, ownProps) => { + const users = getUsersFromState(state); + const loading = isFetchUsersPending(state); + const error = getFetchUsersFailure(state); + + const page = getPageFromProps(ownProps); + const canAddUsers = isPermittedToCreateUsers(state); + const list = selectListAsCollection(state); + + return { + users, + loading, + error, + canAddUsers, + list, + page + }; +}; + +const mapDispatchToProps = dispatch => { + return { + fetchUsersByPage: (page: number) => { + dispatch(fetchUsersByPage(page)); + }, + fetchUsersByLink: (link: string) => { + dispatch(fetchUsersByLink(link)); + } + }; +}; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(translate("users")(Users)); diff --git a/scm-ui/src/users/modules/users.js b/scm-ui/src/users/modules/users.js new file mode 100644 index 0000000000..afd77021af --- /dev/null +++ b/scm-ui/src/users/modules/users.js @@ -0,0 +1,479 @@ +// @flow +import { apiClient } from "../../apiclient"; +import { isPending } from "../../modules/pending"; +import { getFailure } from "../../modules/failure"; +import * as types from "../../modules/types"; +import type { User } from "../types/User"; +import { combineReducers, Dispatch } from "redux"; +import type { Action } from "../../types/Action"; +import type { PagedCollection } from "../../types/Collection"; + +export const FETCH_USERS = "scm/users/FETCH_USERS"; +export const FETCH_USERS_PENDING = `${FETCH_USERS}_${types.PENDING_SUFFIX}`; +export const FETCH_USERS_SUCCESS = `${FETCH_USERS}_${types.SUCCESS_SUFFIX}`; +export const FETCH_USERS_FAILURE = `${FETCH_USERS}_${types.FAILURE_SUFFIX}`; + +export const FETCH_USER = "scm/users/FETCH_USER"; +export const FETCH_USER_PENDING = `${FETCH_USER}_${types.PENDING_SUFFIX}`; +export const FETCH_USER_SUCCESS = `${FETCH_USER}_${types.SUCCESS_SUFFIX}`; +export const FETCH_USER_FAILURE = `${FETCH_USER}_${types.FAILURE_SUFFIX}`; + +export const CREATE_USER = "scm/users/CREATE_USER"; +export const CREATE_USER_PENDING = `${CREATE_USER}_${types.PENDING_SUFFIX}`; +export const CREATE_USER_SUCCESS = `${CREATE_USER}_${types.SUCCESS_SUFFIX}`; +export const CREATE_USER_FAILURE = `${CREATE_USER}_${types.FAILURE_SUFFIX}`; +export const CREATE_USER_RESET = `${CREATE_USER}_${types.RESET_SUFFIX}`; + +export const MODIFY_USER = "scm/users/MODIFY_USER"; +export const MODIFY_USER_PENDING = `${MODIFY_USER}_${types.PENDING_SUFFIX}`; +export const MODIFY_USER_SUCCESS = `${MODIFY_USER}_${types.SUCCESS_SUFFIX}`; +export const MODIFY_USER_FAILURE = `${MODIFY_USER}_${types.FAILURE_SUFFIX}`; + +export const DELETE_USER = "scm/users/DELETE"; +export const DELETE_USER_PENDING = `${DELETE_USER}_${types.PENDING_SUFFIX}`; +export const DELETE_USER_SUCCESS = `${DELETE_USER}_${types.SUCCESS_SUFFIX}`; +export const DELETE_USER_FAILURE = `${DELETE_USER}_${types.FAILURE_SUFFIX}`; + +const USERS_URL = "users"; + +const CONTENT_TYPE_USER = "application/vnd.scmm-user+json;v=2"; + +// TODO i18n for error messages + +// fetch users + +export function fetchUsers() { + return fetchUsersByLink(USERS_URL); +} + +export function fetchUsersByPage(page: number) { + // backend start counting by 0 + return fetchUsersByLink(USERS_URL + "?page=" + (page - 1)); +} + +export function fetchUsersByLink(link: string) { + return function(dispatch: any) { + dispatch(fetchUsersPending()); + return apiClient + .get(link) + .then(response => response.json()) + .then(data => { + dispatch(fetchUsersSuccess(data)); + }) + .catch(cause => { + const error = new Error(`could not fetch users: ${cause.message}`); + dispatch(fetchUsersFailure(USERS_URL, error)); + }); + }; +} + +export function fetchUsersPending(): Action { + return { + type: FETCH_USERS_PENDING + }; +} + +export function fetchUsersSuccess(users: any): Action { + return { + type: FETCH_USERS_SUCCESS, + payload: users + }; +} + +export function fetchUsersFailure(url: string, error: Error): Action { + return { + type: FETCH_USERS_FAILURE, + payload: { + error, + url + } + }; +} + +//fetch user +export function fetchUser(name: string) { + const userUrl = USERS_URL + "/" + name; + return function(dispatch: any) { + dispatch(fetchUserPending(name)); + return apiClient + .get(userUrl) + .then(response => { + return response.json(); + }) + .then(data => { + dispatch(fetchUserSuccess(data)); + }) + .catch(cause => { + const error = new Error(`could not fetch user: ${cause.message}`); + dispatch(fetchUserFailure(name, error)); + }); + }; +} + +export function fetchUserPending(name: string): Action { + return { + type: FETCH_USER_PENDING, + payload: name, + itemId: name + }; +} + +export function fetchUserSuccess(user: any): Action { + return { + type: FETCH_USER_SUCCESS, + payload: user, + itemId: user.name + }; +} + +export function fetchUserFailure(name: string, error: Error): Action { + return { + type: FETCH_USER_FAILURE, + payload: { + name, + error + }, + itemId: name + }; +} + +//create user + +export function createUser(user: User, callback?: () => void) { + return function(dispatch: Dispatch) { + dispatch(createUserPending(user)); + return apiClient + .postWithContentType(USERS_URL, user, CONTENT_TYPE_USER) + .then(() => { + dispatch(createUserSuccess()); + if (callback) { + callback(); + } + }) + .catch(err => + dispatch( + createUserFailure( + new Error(`failed to add user ${user.name}: ${err.message}`) + ) + ) + ); + }; +} + +export function createUserPending(user: User): Action { + return { + type: CREATE_USER_PENDING, + user + }; +} + +export function createUserSuccess(): Action { + return { + type: CREATE_USER_SUCCESS + }; +} + +export function createUserFailure(error: Error): Action { + return { + type: CREATE_USER_FAILURE, + payload: error + }; +} + +export function createUserReset() { + return { + type: CREATE_USER_RESET + }; +} + +//modify user + +export function modifyUser(user: User, callback?: () => void) { + return function(dispatch: Dispatch) { + dispatch(modifyUserPending(user)); + return apiClient + .putWithContentType(user._links.update.href, user, CONTENT_TYPE_USER) + .then(() => { + dispatch(modifyUserSuccess(user)); + if (callback) { + callback(); + } + }) + .catch(err => { + dispatch(modifyUserFailure(user, err)); + }); + }; +} + +export function modifyUserPending(user: User): Action { + return { + type: MODIFY_USER_PENDING, + payload: user, + itemId: user.name + }; +} + +export function modifyUserSuccess(user: User): Action { + return { + type: MODIFY_USER_SUCCESS, + payload: user, + itemId: user.name + }; +} + +export function modifyUserFailure(user: User, error: Error): Action { + return { + type: MODIFY_USER_FAILURE, + payload: { + error, + user + }, + itemId: user.name + }; +} + +//delete user + +export function deleteUser(user: User, callback?: () => void) { + return function(dispatch: any) { + dispatch(deleteUserPending(user)); + return apiClient + .delete(user._links.delete.href) + .then(() => { + dispatch(deleteUserSuccess(user)); + if (callback) { + callback(); + } + }) + .catch(cause => { + const error = new Error( + `could not delete user ${user.name}: ${cause.message}` + ); + dispatch(deleteUserFailure(user, error)); + }); + }; +} + +export function deleteUserPending(user: User): Action { + return { + type: DELETE_USER_PENDING, + payload: user, + itemId: user.name + }; +} + +export function deleteUserSuccess(user: User): Action { + return { + type: DELETE_USER_SUCCESS, + payload: user, + itemId: user.name + }; +} + +export function deleteUserFailure(user: User, error: Error): Action { + return { + type: DELETE_USER_FAILURE, + payload: { + error, + user + }, + itemId: user.name + }; +} + +function extractUsersByNames( + users: User[], + userNames: string[], + oldUsersByNames: Object +) { + const usersByNames = {}; + + for (let user of users) { + usersByNames[user.name] = user; + } + + for (let userName in oldUsersByNames) { + usersByNames[userName] = oldUsersByNames[userName]; + } + return usersByNames; +} + +function deleteUserInUsersByNames(users: {}, userName: string) { + let newUsers = {}; + for (let username in users) { + if (username !== userName) newUsers[username] = users[username]; + } + return newUsers; +} + +function deleteUserInEntries(users: [], userName: string) { + let newUsers = []; + for (let user of users) { + if (user !== userName) newUsers.push(user); + } + return newUsers; +} + +const reducerByName = (state: any, username: string, newUserState: any) => { + const newUsersByNames = { + ...state, + [username]: newUserState + }; + + return newUsersByNames; +}; + +function listReducer(state: any = {}, action: any = {}) { + switch (action.type) { + case FETCH_USERS_SUCCESS: + const users = action.payload._embedded.users; + const userNames = users.map(user => user.name); + return { + ...state, + entries: userNames, + entry: { + userCreatePermission: action.payload._links.create ? true : false, + page: action.payload.page, + pageTotal: action.payload.pageTotal, + _links: action.payload._links + } + }; + + // Delete single user actions + case DELETE_USER_SUCCESS: + const newUserEntries = deleteUserInEntries( + state.entries, + action.payload.name + ); + return { + ...state, + entries: newUserEntries + }; + default: + return state; + } +} + +function byNamesReducer(state: any = {}, action: any = {}) { + switch (action.type) { + // Fetch all users actions + case FETCH_USERS_SUCCESS: + const users = action.payload._embedded.users; + const userNames = users.map(user => user.name); + const byNames = extractUsersByNames(users, userNames, state.byNames); + return { + ...byNames + }; + + // Fetch single user actions + case FETCH_USER_SUCCESS: + return reducerByName(state, action.payload.name, action.payload); + + case MODIFY_USER_SUCCESS: + return reducerByName(state, action.payload.name, action.payload); + + case DELETE_USER_SUCCESS: + const newUserByNames = deleteUserInUsersByNames( + state, + action.payload.name + ); + return newUserByNames; + + default: + return state; + } +} + +export default combineReducers({ + list: listReducer, + byNames: byNamesReducer +}); + +// selectors + +const selectList = (state: Object) => { + if (state.users && state.users.list) { + return state.users.list; + } + return {}; +}; + +const selectListEntry = (state: Object): Object => { + const list = selectList(state); + if (list.entry) { + return list.entry; + } + return {}; +}; + +export const selectListAsCollection = (state: Object): PagedCollection => { + return selectListEntry(state); +}; + +export const isPermittedToCreateUsers = (state: Object): boolean => { + const permission = selectListEntry(state).userCreatePermission; + if (permission) { + return true; + } + return false; +}; + +export function getUsersFromState(state: Object) { + const userNames = selectList(state).entries; + if (!userNames) { + return null; + } + const userEntries: User[] = []; + + for (let userName of userNames) { + userEntries.push(state.users.byNames[userName]); + } + + return userEntries; +} + +export function isFetchUsersPending(state: Object) { + return isPending(state, FETCH_USERS); +} + +export function getFetchUsersFailure(state: Object) { + return getFailure(state, FETCH_USERS); +} + +export function isCreateUserPending(state: Object) { + return isPending(state, CREATE_USER); +} + +export function getCreateUserFailure(state: Object) { + return getFailure(state, CREATE_USER); +} + +export function getUserByName(state: Object, name: string) { + if (state.users && state.users.byNames) { + return state.users.byNames[name]; + } +} + +export function isFetchUserPending(state: Object, name: string) { + return isPending(state, FETCH_USER, name); +} + +export function getFetchUserFailure(state: Object, name: string) { + return getFailure(state, FETCH_USER, name); +} + +export function isModifyUserPending(state: Object, name: string) { + return isPending(state, MODIFY_USER, name); +} + +export function getModifyUserFailure(state: Object, name: string) { + return getFailure(state, MODIFY_USER, name); +} + +export function isDeleteUserPending(state: Object, name: string) { + return isPending(state, DELETE_USER, name); +} + +export function getDeleteUserFailure(state: Object, name: string) { + return getFailure(state, DELETE_USER, name); +} diff --git a/scm-ui/src/users/modules/users.test.js b/scm-ui/src/users/modules/users.test.js new file mode 100644 index 0000000000..d638e060a6 --- /dev/null +++ b/scm-ui/src/users/modules/users.test.js @@ -0,0 +1,640 @@ +//@flow +import configureMockStore from "redux-mock-store"; +import thunk from "redux-thunk"; +import fetchMock from "fetch-mock"; + +import reducer, { + CREATE_USER_FAILURE, + CREATE_USER_PENDING, + CREATE_USER_SUCCESS, + createUser, + DELETE_USER_FAILURE, + DELETE_USER_PENDING, + DELETE_USER_SUCCESS, + deleteUser, + deleteUserSuccess, + FETCH_USER_FAILURE, + FETCH_USER_PENDING, + isFetchUserPending, + FETCH_USER_SUCCESS, + FETCH_USERS_FAILURE, + FETCH_USERS_PENDING, + FETCH_USERS_SUCCESS, + fetchUser, + fetchUserSuccess, + getFetchUserFailure, + fetchUsers, + fetchUsersSuccess, + isFetchUsersPending, + selectListAsCollection, + isPermittedToCreateUsers, + MODIFY_USER, + MODIFY_USER_FAILURE, + MODIFY_USER_PENDING, + MODIFY_USER_SUCCESS, + modifyUser, + modifyUserSuccess, + getUsersFromState, + FETCH_USERS, + getFetchUsersFailure, + FETCH_USER, + CREATE_USER, + isCreateUserPending, + getCreateUserFailure, + getUserByName, + isModifyUserPending, + getModifyUserFailure, + DELETE_USER, + isDeleteUserPending, + getDeleteUserFailure +} from "./users"; + +const userZaphod = { + active: true, + admin: true, + creationDate: "2018-07-11T12:23:49.027Z", + displayName: "Z. Beeblebrox", + mail: "president@heartofgold.universe", + name: "zaphod", + password: "__dummypassword__", + type: "xml", + properties: {}, + _links: { + self: { + href: "http://localhost:8081/scm/api/rest/v2/users/zaphod" + }, + delete: { + href: "http://localhost:8081/scm/api/rest/v2/users/zaphod" + }, + update: { + href: "http://localhost:8081/scm/api/rest/v2/users/zaphod" + } + } +}; + +const userFord = { + active: true, + admin: false, + creationDate: "2018-07-06T13:21:18.459Z", + displayName: "F. Prefect", + mail: "ford@prefect.universe", + name: "ford", + password: "__dummypassword__", + type: "xml", + properties: {}, + _links: { + self: { + href: "http://localhost:8081/scm/api/rest/v2/users/ford" + }, + delete: { + href: "http://localhost:8081/scm/api/rest/v2/users/ford" + }, + update: { + href: "http://localhost:8081/scm/api/rest/v2/users/ford" + } + } +}; + +const responseBody = { + page: 0, + pageTotal: 1, + _links: { + self: { + href: "http://localhost:3000/scm/api/rest/v2/users/?page=0&pageSize=10" + }, + first: { + href: "http://localhost:3000/scm/api/rest/v2/users/?page=0&pageSize=10" + }, + last: { + href: "http://localhost:3000/scm/api/rest/v2/users/?page=0&pageSize=10" + }, + create: { + href: "http://localhost:3000/scm/api/rest/v2/users/" + } + }, + _embedded: { + users: [userZaphod, userFord] + } +}; + +const response = { + headers: { "content-type": "application/json" }, + responseBody +}; + +const USERS_URL = "/scm/api/rest/v2/users"; + +const error = new Error("KAPUTT"); + +describe("users fetch()", () => { + const mockStore = configureMockStore([thunk]); + afterEach(() => { + fetchMock.reset(); + fetchMock.restore(); + }); + + it("should successfully fetch users", () => { + fetchMock.getOnce(USERS_URL, response); + + const expectedActions = [ + { type: FETCH_USERS_PENDING }, + { + type: FETCH_USERS_SUCCESS, + payload: response + } + ]; + + const store = mockStore({}); + + return store.dispatch(fetchUsers()).then(() => { + expect(store.getActions()).toEqual(expectedActions); + }); + }); + + it("should fail getting users on HTTP 500", () => { + fetchMock.getOnce(USERS_URL, { + status: 500 + }); + + const store = mockStore({}); + return store.dispatch(fetchUsers()).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(FETCH_USERS_PENDING); + expect(actions[1].type).toEqual(FETCH_USERS_FAILURE); + expect(actions[1].payload).toBeDefined(); + }); + }); + + it("should sucessfully fetch single user", () => { + fetchMock.getOnce(USERS_URL + "/zaphod", userZaphod); + + const store = mockStore({}); + return store.dispatch(fetchUser("zaphod")).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(FETCH_USER_PENDING); + expect(actions[1].type).toEqual(FETCH_USER_SUCCESS); + expect(actions[1].payload).toBeDefined(); + }); + }); + + it("should fail fetching single user on HTTP 500", () => { + fetchMock.getOnce(USERS_URL + "/zaphod", { + status: 500 + }); + + const store = mockStore({}); + return store.dispatch(fetchUser("zaphod")).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(FETCH_USER_PENDING); + expect(actions[1].type).toEqual(FETCH_USER_FAILURE); + expect(actions[1].payload).toBeDefined(); + }); + }); + + it("should add a user successfully", () => { + // unmatched + fetchMock.postOnce(USERS_URL, { + status: 204 + }); + + // after create, the users are fetched again + fetchMock.getOnce(USERS_URL, response); + + const store = mockStore({}); + return store.dispatch(createUser(userZaphod)).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(CREATE_USER_PENDING); + expect(actions[1].type).toEqual(CREATE_USER_SUCCESS); + }); + }); + + it("should fail adding a user on HTTP 500", () => { + fetchMock.postOnce(USERS_URL, { + status: 500 + }); + + const store = mockStore({}); + return store.dispatch(createUser(userZaphod)).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(CREATE_USER_PENDING); + expect(actions[1].type).toEqual(CREATE_USER_FAILURE); + expect(actions[1].payload).toBeDefined(); + }); + }); + + it("should call the callback after user successfully created", () => { + // unmatched + fetchMock.postOnce(USERS_URL, { + status: 204 + }); + + let callMe = "not yet"; + + const callback = () => { + callMe = "yeah"; + }; + + const store = mockStore({}); + return store.dispatch(createUser(userZaphod, callback)).then(() => { + expect(callMe).toBe("yeah"); + }); + }); + + it("successfully update user", () => { + fetchMock.putOnce("http://localhost:8081/scm/api/rest/v2/users/zaphod", { + status: 204 + }); + + const store = mockStore({}); + return store.dispatch(modifyUser(userZaphod)).then(() => { + const actions = store.getActions(); + expect(actions.length).toBe(2); + expect(actions[0].type).toEqual(MODIFY_USER_PENDING); + expect(actions[1].type).toEqual(MODIFY_USER_SUCCESS); + }); + }); + + it("should call callback, after successful modified user", () => { + fetchMock.putOnce("http://localhost:8081/scm/api/rest/v2/users/zaphod", { + status: 204 + }); + + let called = false; + const callMe = () => { + called = true; + }; + + const store = mockStore({}); + return store.dispatch(modifyUser(userZaphod, callMe)).then(() => { + expect(called).toBeTruthy(); + }); + }); + + it("should fail updating user on HTTP 500", () => { + fetchMock.putOnce("http://localhost:8081/scm/api/rest/v2/users/zaphod", { + status: 500 + }); + + const store = mockStore({}); + return store.dispatch(modifyUser(userZaphod)).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(MODIFY_USER_PENDING); + expect(actions[1].type).toEqual(MODIFY_USER_FAILURE); + expect(actions[1].payload).toBeDefined(); + }); + }); + + it("should delete successfully user zaphod", () => { + fetchMock.deleteOnce("http://localhost:8081/scm/api/rest/v2/users/zaphod", { + status: 204 + }); + + const store = mockStore({}); + return store.dispatch(deleteUser(userZaphod)).then(() => { + const actions = store.getActions(); + expect(actions.length).toBe(2); + expect(actions[0].type).toEqual(DELETE_USER_PENDING); + expect(actions[0].payload).toBe(userZaphod); + expect(actions[1].type).toEqual(DELETE_USER_SUCCESS); + }); + }); + + it("should call the callback, after successful delete", () => { + fetchMock.deleteOnce("http://localhost:8081/scm/api/rest/v2/users/zaphod", { + status: 204 + }); + + let called = false; + const callMe = () => { + called = true; + }; + + const store = mockStore({}); + return store.dispatch(deleteUser(userZaphod, callMe)).then(() => { + expect(called).toBeTruthy(); + }); + }); + + it("should fail to delete user zaphod", () => { + fetchMock.deleteOnce("http://localhost:8081/scm/api/rest/v2/users/zaphod", { + status: 500 + }); + + const store = mockStore({}); + return store.dispatch(deleteUser(userZaphod)).then(() => { + const actions = store.getActions(); + expect(actions[0].type).toEqual(DELETE_USER_PENDING); + expect(actions[0].payload).toBe(userZaphod); + expect(actions[1].type).toEqual(DELETE_USER_FAILURE); + expect(actions[1].payload).toBeDefined(); + }); + }); +}); + +describe("users reducer", () => { + it("should update state correctly according to FETCH_USERS_SUCCESS action", () => { + const newState = reducer({}, fetchUsersSuccess(responseBody)); + + expect(newState.list).toEqual({ + entries: ["zaphod", "ford"], + entry: { + userCreatePermission: true, + page: 0, + pageTotal: 1, + _links: responseBody._links + } + }); + + expect(newState.byNames).toEqual({ + zaphod: userZaphod, + ford: userFord + }); + + expect(newState.list.entry.userCreatePermission).toBeTruthy(); + }); + + it("should set userCreatePermission to true if update link is present", () => { + const newState = reducer({}, fetchUsersSuccess(responseBody)); + + expect(newState.list.entry.userCreatePermission).toBeTruthy(); + }); + + it("should not replace whole byNames map when fetching users", () => { + const oldState = { + byNames: { + ford: userFord + } + }; + + const newState = reducer(oldState, fetchUsersSuccess(responseBody)); + expect(newState.byNames["zaphod"]).toBeDefined(); + expect(newState.byNames["ford"]).toBeDefined(); + }); + + it("should remove user from state when delete succeeds", () => { + const state = { + list: { + entries: ["ford", "zaphod"] + }, + byNames: { + zaphod: userZaphod, + ford: userFord + } + }; + + const newState = reducer(state, deleteUserSuccess(userFord)); + expect(newState.byNames["zaphod"]).toBeDefined(); + expect(newState.byNames["ford"]).toBeFalsy(); + expect(newState.list.entries).toEqual(["zaphod"]); + }); + + it("should set userCreatePermission to true if create link is present", () => { + const newState = reducer({}, fetchUsersSuccess(responseBody)); + + expect(newState.list.entry.userCreatePermission).toBeTruthy(); + expect(newState.list.entries).toEqual(["zaphod", "ford"]); + expect(newState.byNames["ford"]).toBeTruthy(); + expect(newState.byNames["zaphod"]).toBeTruthy(); + }); + + it("should update state according to FETCH_USER_SUCCESS action", () => { + const newState = reducer({}, fetchUserSuccess(userFord)); + expect(newState.byNames["ford"]).toBe(userFord); + }); + + it("should affect users state nor the state of other users", () => { + const newState = reducer( + { + list: { + entries: ["zaphod"] + } + }, + fetchUserSuccess(userFord) + ); + expect(newState.byNames["ford"]).toBe(userFord); + expect(newState.list.entries).toEqual(["zaphod"]); + }); + + it("should update state according to MODIFY_USER_SUCCESS action", () => { + const newState = reducer( + { + byNames: { + ford: { + name: "ford" + } + } + }, + modifyUserSuccess(userFord) + ); + expect(newState.byNames["ford"]).toBe(userFord); + }); +}); + +describe("selector tests", () => { + it("should return an empty object", () => { + expect(selectListAsCollection({})).toEqual({}); + expect(selectListAsCollection({ users: { a: "a" } })).toEqual({}); + }); + + it("should return a state slice collection", () => { + const collection = { + page: 3, + totalPages: 42 + }; + + const state = { + users: { + list: { + entry: collection + } + } + }; + expect(selectListAsCollection(state)).toBe(collection); + }); + + it("should return false", () => { + expect(isPermittedToCreateUsers({})).toBe(false); + expect(isPermittedToCreateUsers({ users: { list: { entry: {} } } })).toBe( + false + ); + expect( + isPermittedToCreateUsers({ + users: { list: { entry: { userCreatePermission: false } } } + }) + ).toBe(false); + }); + + it("should return true", () => { + const state = { + users: { + list: { + entry: { + userCreatePermission: true + } + } + } + }; + expect(isPermittedToCreateUsers(state)).toBe(true); + }); + + it("should get users from state", () => { + const state = { + users: { + list: { + entries: ["a", "b"] + }, + byNames: { + a: { name: "a" }, + b: { name: "b" } + } + } + }; + expect(getUsersFromState(state)).toEqual([{ name: "a" }, { name: "b" }]); + }); + + it("should return true, when fetch users is pending", () => { + const state = { + pending: { + [FETCH_USERS]: true + } + }; + expect(isFetchUsersPending(state)).toEqual(true); + }); + + it("should return false, when fetch users is not pending", () => { + expect(isFetchUsersPending({})).toEqual(false); + }); + + it("should return error when fetch users did fail", () => { + const state = { + failure: { + [FETCH_USERS]: error + } + }; + expect(getFetchUsersFailure(state)).toEqual(error); + }); + + it("should return undefined when fetch users did not fail", () => { + expect(getFetchUsersFailure({})).toBe(undefined); + }); + + it("should return true if create user is pending", () => { + const state = { + pending: { + [CREATE_USER]: true + } + }; + expect(isCreateUserPending(state)).toBe(true); + }); + + it("should return false if create user is not pending", () => { + const state = { + pending: { + [CREATE_USER]: false + } + }; + expect(isCreateUserPending(state)).toBe(false); + }); + + it("should return error when create user did fail", () => { + const state = { + failure: { + [CREATE_USER]: error + } + }; + expect(getCreateUserFailure(state)).toEqual(error); + }); + + it("should return undefined when create user did not fail", () => { + expect(getCreateUserFailure({})).toBe(undefined); + }); + + it("should return user ford", () => { + const state = { + users: { + byNames: { + ford: userFord + } + } + }; + expect(getUserByName(state, "ford")).toEqual(userFord); + }); + + it("should return true, when fetch user zaphod is pending", () => { + const state = { + pending: { + [FETCH_USER + "/zaphod"]: true + } + }; + expect(isFetchUserPending(state, "zaphod")).toEqual(true); + }); + + it("should return false, when fetch user zaphod is not pending", () => { + expect(isFetchUserPending({}, "zaphod")).toEqual(false); + }); + + it("should return error when fetch user zaphod did fail", () => { + const state = { + failure: { + [FETCH_USER + "/zaphod"]: error + } + }; + expect(getFetchUserFailure(state, "zaphod")).toEqual(error); + }); + + it("should return undefined when fetch user zaphod did not fail", () => { + expect(getFetchUserFailure({}, "zaphod")).toBe(undefined); + }); + + it("should return true, when modify user ford is pending", () => { + const state = { + pending: { + [MODIFY_USER + "/ford"]: true + } + }; + expect(isModifyUserPending(state, "ford")).toEqual(true); + }); + + it("should return false, when modify user ford is not pending", () => { + expect(isModifyUserPending({}, "ford")).toEqual(false); + }); + + it("should return error when modify user ford did fail", () => { + const state = { + failure: { + [MODIFY_USER + "/ford"]: error + } + }; + expect(getModifyUserFailure(state, "ford")).toEqual(error); + }); + + it("should return undefined when modify user ford did not fail", () => { + expect(getModifyUserFailure({}, "ford")).toBe(undefined); + }); + + it("should return true, when delete user zaphod is pending", () => { + const state = { + pending: { + [DELETE_USER + "/zaphod"]: true + } + }; + expect(isDeleteUserPending(state, "zaphod")).toEqual(true); + }); + + it("should return false, when delete user zaphod is not pending", () => { + expect(isDeleteUserPending({}, "zaphod")).toEqual(false); + }); + + it("should return error when delete user zaphod did fail", () => { + const state = { + failure: { + [DELETE_USER + "/zaphod"]: error + } + }; + expect(getDeleteUserFailure(state, "zaphod")).toEqual(error); + }); + + it("should return undefined when delete user zaphod did not fail", () => { + expect(getDeleteUserFailure({}, "zaphod")).toBe(undefined); + }); +}); diff --git a/scm-ui/src/users/types/User.js b/scm-ui/src/users/types/User.js new file mode 100644 index 0000000000..b113f7f795 --- /dev/null +++ b/scm-ui/src/users/types/User.js @@ -0,0 +1,12 @@ +//@flow +import type { Links } from "../../types/hal"; + +export type User = { + displayName: string, + name: string, + mail: string, + password: string, + admin: boolean, + active: boolean, + _links: Links +}; diff --git a/scm-ui/yarn.lock b/scm-ui/yarn.lock new file mode 100644 index 0000000000..5d252931e5 --- /dev/null +++ b/scm-ui/yarn.lock @@ -0,0 +1,8435 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@octokit/rest@^15.2.6": + version "15.9.4" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-15.9.4.tgz#c6cf0f483275d9c798b18419b7c9d417493bb70f" + dependencies: + before-after-hook "^1.1.0" + btoa-lite "^1.0.0" + debug "^3.1.0" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.0" + lodash "^4.17.4" + node-fetch "^2.1.1" + url-template "^2.0.8" + +"@types/node@*": + version "10.5.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.2.tgz#f19f05314d5421fe37e74153254201a7bf00a707" + +abab@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +accepts@~1.3.4, accepts@~1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" + dependencies: + mime-types "~2.1.18" + negotiator "0.6.1" + +acorn-dynamic-import@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" + dependencies: + acorn "^4.0.3" + +acorn-globals@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" + dependencies: + acorn "^4.0.4" + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^4.0.3, acorn@^4.0.4: + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + +acorn@^5.0.0, acorn@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" + +address@1.0.3, address@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/address/-/address-1.0.3.tgz#b5f50631f8d6cec8bd20c963963afb55e06cbce9" + +agent-base@4, agent-base@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + dependencies: + es6-promisify "^5.0.0" + +ajv-keywords@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" + +ajv-keywords@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" + +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ajv@^5.0.0, ajv@^5.1.0, ajv@^5.1.5, ajv@^5.2.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +ajv@^6.0.1: + version "6.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.2.tgz#678495f9b82f7cca6be248dd92f59bff5e1f4360" + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.1" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +alphanum-sort@^1.0.1, alphanum-sort@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-align@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" + dependencies: + string-width "^2.0.0" + +ansi-escapes@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-escapes@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + +ansi-html@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" + +ansi-regex@^2.0.0, ansi-regex@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.0.0, ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +append-transform@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" + dependencies: + default-require-extensions "^2.0.0" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + dependencies: + sprintf-js "~1.0.2" + +aria-query@^0.7.0: + version "0.7.1" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-0.7.1.tgz#26cbb5aff64144b0a825be1846e0b16cfa00b11e" + dependencies: + ast-types-flow "0.0.7" + commander "^2.11.0" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + +array-filter@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" + +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + +array-flatten@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.1.tgz#426bb9da84090c1838d812c8150af20a8331e296" + +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" + +array-map@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" + +array-reduce@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + +arrify@^1.0.0, arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asap@~2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + +asn1.js@^4.0.0: + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +assert@^1.1.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + dependencies: + util "0.10.3" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +ast-types-flow@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +async-foreach@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" + +async@^1.4.0, async@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@^2.1.2, async@^2.1.4, async@^2.4.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + dependencies: + lodash "^4.17.10" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +atob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a" + +autoprefixer@7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-7.1.6.tgz#fb933039f74af74a83e71225ce78d9fd58ba84d7" + dependencies: + browserslist "^2.5.1" + caniuse-lite "^1.0.30000748" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^6.0.13" + postcss-value-parser "^3.2.3" + +autoprefixer@^6.3.1: + version "6.7.7" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.7.7.tgz#1dbd1c835658e35ce3f9984099db00585c782014" + dependencies: + browserslist "^1.7.6" + caniuse-db "^1.0.30000634" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^5.2.16" + postcss-value-parser "^3.2.3" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.2.1, aws4@^1.6.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" + +axobject-query@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-0.1.0.tgz#62f59dbc59c9f9242759ca349960e7a2fe3c36c0" + dependencies: + ast-types-flow "0.0.7" + +babel-code-frame@6.26.0, babel-code-frame@^6.11.0, babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + +babel-core@^6.0.0, babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-eslint@7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827" + dependencies: + babel-code-frame "^6.22.0" + babel-traverse "^6.23.1" + babel-types "^6.23.0" + babylon "^6.17.0" + +babel-generator@^6.18.0, babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-builder-react-jsx@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz#39ff8313b75c8b65dceff1f31d383e0ff2a408a0" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + esutils "^2.0.2" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@20.0.3, babel-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.3.tgz#e4a03b13dc10389e140fc645d09ffc4ced301671" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.0.0" + babel-preset-jest "^20.0.3" + +babel-loader@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.2.tgz#f6cbe122710f1aa2af4d881c6d5b54358ca24126" + dependencies: + find-cache-dir "^1.0.0" + loader-utils "^1.0.2" + mkdirp "^0.5.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-dynamic-import-node@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-1.1.0.tgz#bd1d88ac7aaf98df4917c384373b04d971a2b37a" + dependencies: + babel-plugin-syntax-dynamic-import "^6.18.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-istanbul@^4.0.0: + version "4.1.6" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.13.0" + find-up "^2.1.0" + istanbul-lib-instrument "^1.10.1" + test-exclude "^4.2.1" + +babel-plugin-jest-hoist@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-dynamic-import@6.18.0, babel-plugin-syntax-dynamic-import@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-flow@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" + +babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" + +babel-plugin-syntax-object-rest-spread@^6.13.0, babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-class-properties@6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.23.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@6.23.0, babel-plugin-transform-es2015-destructuring@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.2" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-flow-strip-types@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" + dependencies: + babel-plugin-syntax-flow "^6.18.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-object-rest-spread@6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + +babel-plugin-transform-react-constant-elements@6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-constant-elements/-/babel-plugin-transform-react-constant-elements-6.23.0.tgz#2f119bf4d2cdd45eb9baaae574053c604f6147dd" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-react-display-name@^6.23.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz#67e2bf1f1e9c93ab08db96792e05392bf2cc28d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-self@6.22.0, babel-plugin-transform-react-jsx-self@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz#df6d80a9da2612a121e6ddd7558bcbecf06e636e" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-source@6.22.0, babel-plugin-transform-react-jsx-source@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz#66ac12153f5cd2d17b3c19268f4bf0197f44ecd6" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx@6.24.1, babel-plugin-transform-react-jsx@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3" + dependencies: + babel-helper-builder-react-jsx "^6.24.1" + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@6.26.0, babel-plugin-transform-regenerator@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-runtime@6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz#88490d446502ea9b8e7efb0fe09ec4d99479b1ee" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-polyfill@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + +babel-preset-env@1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" + browserslist "^2.1.2" + invariant "^2.2.2" + semver "^5.3.0" + +babel-preset-flow@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d" + dependencies: + babel-plugin-transform-flow-strip-types "^6.22.0" + +babel-preset-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" + dependencies: + babel-plugin-jest-hoist "^20.0.3" + +babel-preset-react-app@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-3.1.2.tgz#49ba3681b917c4e5c73a5249d3ef4c48fae064e2" + dependencies: + babel-plugin-dynamic-import-node "1.1.0" + babel-plugin-syntax-dynamic-import "6.18.0" + babel-plugin-transform-class-properties "6.24.1" + babel-plugin-transform-es2015-destructuring "6.23.0" + babel-plugin-transform-object-rest-spread "6.26.0" + babel-plugin-transform-react-constant-elements "6.23.0" + babel-plugin-transform-react-jsx "6.24.1" + babel-plugin-transform-react-jsx-self "6.22.0" + babel-plugin-transform-react-jsx-source "6.22.0" + babel-plugin-transform-regenerator "6.26.0" + babel-plugin-transform-runtime "6.23.0" + babel-preset-env "1.6.1" + babel-preset-react "6.24.1" + +babel-preset-react@6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" + dependencies: + babel-plugin-syntax-jsx "^6.3.13" + babel-plugin-transform-react-display-name "^6.23.0" + babel-plugin-transform-react-jsx "^6.24.1" + babel-plugin-transform-react-jsx-self "^6.22.0" + babel-plugin-transform-react-jsx-source "^6.22.0" + babel-preset-flow "^6.23.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@6.26.0, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.18.0, babel-traverse@^6.23.1, babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.17.0, babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base64-js@^1.0.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +batch@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + dependencies: + tweetnacl "^0.14.3" + +before-after-hook@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-1.1.0.tgz#83165e15a59460d13702cb8febd6a1807896db5a" + +big-integer@^1.6.17: + version "1.6.32" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.32.tgz#5867458b25ecd5bcb36b627c30bb501a13c07e89" + +big.js@^3.1.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" + +binary-extensions@^1.0.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + +binary@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79" + dependencies: + buffers "~0.1.1" + chainsaw "~0.1.0" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + +bluebird@^3.4.7: + version "3.5.1" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" + +bluebird@~3.4.1: + version "3.4.7" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + +body-parser@1.18.2: + version "1.18.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454" + dependencies: + bytes "3.0.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.1" + http-errors "~1.6.2" + iconv-lite "0.4.19" + on-finished "~2.3.0" + qs "6.5.1" + raw-body "2.3.2" + type-is "~1.6.15" + +bonjour@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5" + dependencies: + array-flatten "^2.1.0" + deep-equal "^1.0.1" + dns-equal "^1.0.0" + dns-txt "^2.0.2" + multicast-dns "^6.0.1" + multicast-dns-service-types "^1.1.0" + +boolbase@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +boxen@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" + dependencies: + ansi-align "^2.0.0" + camelcase "^4.0.0" + chalk "^2.0.1" + cli-boxes "^1.0.0" + string-width "^2.0.0" + term-size "^1.2.0" + widest-line "^2.0.0" + +brace-expansion@^1.0.0, brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.0, braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +brcast@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/brcast/-/brcast-3.0.1.tgz#6256a8349b20de9eed44257a9b24d71493cd48dd" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + +browser-resolve@^1.11.2: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + dependencies: + resolve "1.1.7" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + dependencies: + pako "~1.0.5" + +browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: + version "1.7.7" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9" + dependencies: + caniuse-db "^1.0.30000639" + electron-to-chromium "^1.2.7" + +browserslist@^2.1.2, browserslist@^2.5.1: + version "2.11.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.11.3.tgz#fe36167aed1bbcde4827ebfe71347a2cc70b99b2" + dependencies: + caniuse-lite "^1.0.30000792" + electron-to-chromium "^1.3.30" + +bser@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169" + dependencies: + node-int64 "^0.4.0" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + +btoa-lite@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337" + +buffer-from@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" + +buffer-indexof-polyfill@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.1.tgz#a9fb806ce8145d5428510ce72f278bb363a638bf" + +buffer-indexof@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c" + +buffer-shims@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + +buffer@^4.3.0: + version "4.9.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +buffers@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" + +builtin-modules@^1.0.0, builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + +bulma@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/bulma/-/bulma-0.7.1.tgz#73c2e3b2930c90cc272029cbd19918b493fca486" + +bytes@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + +camel-case@3.0.x: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" + dependencies: + no-case "^2.2.0" + upper-case "^1.1.1" + +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + +camelcase@^4.0.0, camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +caniuse-api@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-1.6.1.tgz#b534e7c734c4f81ec5fbe8aca2ad24354b962c6c" + dependencies: + browserslist "^1.3.6" + caniuse-db "^1.0.30000529" + lodash.memoize "^4.1.2" + lodash.uniq "^4.5.0" + +caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: + version "1.0.30000867" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000867.tgz#b55a6ecfac3107988940c9c7dfe1866315312c97" + +caniuse-lite@^1.0.30000748, caniuse-lite@^1.0.30000792: + version "1.0.30000865" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000865.tgz#70026616e8afe6e1442f8bb4e1092987d81a2f25" + +capture-stack-trace@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" + +case-sensitive-paths-webpack-plugin@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.1.1.tgz#3d29ced8c1f124bf6f53846fb3f5894731fdc909" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chainsaw@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98" + dependencies: + traverse ">=0.3.0 <0.4" + +chalk@1.1.3, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + +charenc@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + +cheerio@^1.0.0-rc.2: + version "1.0.0-rc.2" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.2.tgz#4b9f53a81b27e4d5dac31c0ffd0cfa03cc6830db" + dependencies: + css-select "~1.2.0" + dom-serializer "~0.1.0" + entities "~1.1.1" + htmlparser2 "^3.9.1" + lodash "^4.15.0" + parse5 "^3.0.1" + +chokidar@^1.6.0, chokidar@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +chokidar@^2.0.2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + dependencies: + anymatch "^2.0.0" + async-each "^1.0.0" + braces "^2.3.0" + glob-parent "^3.1.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + lodash.debounce "^4.0.8" + normalize-path "^2.1.1" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + upath "^1.0.5" + optionalDependencies: + fsevents "^1.2.2" + +chownr@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + +ci-info@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.3.tgz#710193264bb05c77b8c90d02f5aaf22216a667b2" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + +clap@^1.0.9: + version "1.2.3" + resolved "https://registry.yarnpkg.com/clap/-/clap-1.2.3.tgz#4f36745b32008492557f46412d66d50cb99bce51" + dependencies: + chalk "^1.1.3" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +classnames@^2.2.5: + version "2.2.6" + resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" + +clean-css@4.1.x: + version "4.1.11" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.1.11.tgz#2ecdf145aba38f54740f26cefd0ff3e03e125d6a" + dependencies: + source-map "0.5.x" + +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +coa@~1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/coa/-/coa-1.0.4.tgz#a9ef153660d6a86a8bdec0289a5c684d217432fd" + dependencies: + q "^1.1.2" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.3.0, color-convert@^1.9.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" + dependencies: + color-name "1.1.1" + +color-name@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" + +color-name@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +color-string@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991" + dependencies: + color-name "^1.0.0" + +color@^0.11.0: + version "0.11.4" + resolved "https://registry.yarnpkg.com/color/-/color-0.11.4.tgz#6d7b5c74fb65e841cd48792ad1ed5e07b904d764" + dependencies: + clone "^1.0.2" + color-convert "^1.3.0" + color-string "^0.3.0" + +colormin@^1.0.5: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colormin/-/colormin-1.1.2.tgz#ea2f7420a72b96881a38aae59ec124a6f7298133" + dependencies: + color "^0.11.0" + css-color-names "0.0.4" + has "^1.0.1" + +colors@0.5.x: + version "0.5.1" + resolved "https://registry.yarnpkg.com/colors/-/colors-0.5.1.tgz#7d0023eaeb154e8ee9fce75dcb923d0ed1667774" + +colors@^1.1.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.0.tgz#5f20c9fef6945cb1134260aab33bfbdc8295e04e" + +colors@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + +combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + dependencies: + delayed-stream "~1.0.0" + +commander@2.16.x, commander@^2.11.0, commander@~2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +compare-versions@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.3.0.tgz#af93ea705a96943f622ab309578b9b90586f39c3" + +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + +compressible@~2.0.14: + version "2.0.14" + resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.14.tgz#326c5f507fbb055f54116782b969a81b67a29da7" + dependencies: + mime-db ">= 1.34.0 < 2" + +compression@^1.5.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.3.tgz#27e0e176aaf260f7f2c2813c3e440adb9f1993db" + dependencies: + accepts "~1.3.5" + bytes "3.0.0" + compressible "~2.0.14" + debug "2.6.9" + on-headers "~1.0.1" + safe-buffer "5.1.2" + vary "~1.1.2" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.6.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +configstore@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" + dependencies: + dot-prop "^4.1.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + unique-string "^1.0.0" + write-file-atomic "^2.0.0" + xdg-basedir "^3.0.0" + +connect-history-api-fallback@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz#b06873934bc5e344fef611a196a6faae0aee015a" + +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + dependencies: + date-now "^0.1.4" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + +content-disposition@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" + +content-type-parser@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.2.tgz#caabe80623e63638b2502fd4c7f12ff4ce2352e7" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + +convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + +core-js@^2.4.0, core-js@^2.5.0: + version "2.5.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cosmiconfig@^2.1.0, cosmiconfig@^2.1.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-2.2.2.tgz#6173cebd56fac042c1f4390edf7af6c07c7cb892" + dependencies: + is-directory "^0.3.1" + js-yaml "^3.4.3" + minimist "^1.2.0" + object-assign "^4.1.0" + os-homedir "^1.0.1" + parse-json "^2.2.0" + require-from-string "^1.1.0" + +create-ecdh@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-error-class@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + dependencies: + capture-stack-trace "^1.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-spawn@5.1.0, cross-spawn@^5.0.1, cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@^6.0.4: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypt@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +crypto-browserify@^3.11.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + +css-color-names@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" + +css-loader@0.28.7: + version "0.28.7" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.7.tgz#5f2ee989dd32edd907717f953317656160999c1b" + dependencies: + babel-code-frame "^6.11.0" + css-selector-tokenizer "^0.7.0" + cssnano ">=2.6.1 <4" + icss-utils "^2.1.0" + loader-utils "^1.0.2" + lodash.camelcase "^4.3.0" + object-assign "^4.0.1" + postcss "^5.0.6" + postcss-modules-extract-imports "^1.0.0" + postcss-modules-local-by-default "^1.0.1" + postcss-modules-scope "^1.0.0" + postcss-modules-values "^1.1.0" + postcss-value-parser "^3.3.0" + source-list-map "^2.0.0" + +css-select@^1.1.0, css-select@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + dependencies: + boolbase "~1.0.0" + css-what "2.1" + domutils "1.5.1" + nth-check "~1.0.1" + +css-selector-tokenizer@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.7.0.tgz#e6988474ae8c953477bf5e7efecfceccd9cf4c86" + dependencies: + cssesc "^0.1.0" + fastparse "^1.1.1" + regexpu-core "^1.0.0" + +css-vendor@^0.3.8: + version "0.3.8" + resolved "https://registry.yarnpkg.com/css-vendor/-/css-vendor-0.3.8.tgz#6421cfd3034ce664fe7673972fd0119fc28941fa" + dependencies: + is-in-browser "^1.0.2" + +css-what@2.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd" + +cssesc@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-0.1.0.tgz#c814903e45623371a0477b40109aaafbeeaddbb4" + +"cssnano@>=2.6.1 <4": + version "3.10.0" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-3.10.0.tgz#4f38f6cea2b9b17fa01490f23f1dc68ea65c1c38" + dependencies: + autoprefixer "^6.3.1" + decamelize "^1.1.2" + defined "^1.0.0" + has "^1.0.1" + object-assign "^4.0.1" + postcss "^5.0.14" + postcss-calc "^5.2.0" + postcss-colormin "^2.1.8" + postcss-convert-values "^2.3.4" + postcss-discard-comments "^2.0.4" + postcss-discard-duplicates "^2.0.1" + postcss-discard-empty "^2.0.1" + postcss-discard-overridden "^0.1.1" + postcss-discard-unused "^2.2.1" + postcss-filter-plugins "^2.0.0" + postcss-merge-idents "^2.1.5" + postcss-merge-longhand "^2.0.1" + postcss-merge-rules "^2.0.3" + postcss-minify-font-values "^1.0.2" + postcss-minify-gradients "^1.0.1" + postcss-minify-params "^1.0.4" + postcss-minify-selectors "^2.0.4" + postcss-normalize-charset "^1.1.0" + postcss-normalize-url "^3.0.7" + postcss-ordered-values "^2.1.0" + postcss-reduce-idents "^2.2.2" + postcss-reduce-initial "^1.0.0" + postcss-reduce-transforms "^1.0.3" + postcss-svgo "^2.1.1" + postcss-unique-selectors "^2.0.2" + postcss-value-parser "^3.2.3" + postcss-zindex "^2.0.1" + +csso@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/csso/-/csso-2.3.2.tgz#ddd52c587033f49e94b71fc55569f252e8ff5f85" + dependencies: + clap "^1.0.9" + source-map "^0.5.3" + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" + +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" + dependencies: + cssom "0.3.x" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + dependencies: + es5-ext "^0.10.9" + +damerau-levenshtein@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.6, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +debug@3.1.0, debug@^3.0.1, debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + +decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + +decompress-response@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + dependencies: + mimic-response "^1.0.0" + +deep-diff@^0.3.5: + version "0.3.8" + resolved "https://registry.yarnpkg.com/deep-diff/-/deep-diff-0.3.8.tgz#c01de63efb0eec9798801d40c7e0dae25b582c84" + +deep-equal@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +default-require-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" + dependencies: + strip-bom "^3.0.0" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +del@^2.0.2, del@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +del@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" + dependencies: + globby "^6.1.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + p-map "^1.1.1" + pify "^3.0.0" + rimraf "^2.2.8" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +depd@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" + +depd@~1.1.1, depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +detect-node@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127" + +detect-port-alt@1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/detect-port-alt/-/detect-port-alt-1.1.6.tgz#24707deabe932d4a3cf621302027c2b266568275" + dependencies: + address "^1.0.1" + debug "^2.6.0" + +diff@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +discontinuous-range@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" + +dns-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" + +dns-packet@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a" + dependencies: + ip "^1.1.0" + safe-buffer "^5.0.1" + +dns-txt@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/dns-txt/-/dns-txt-2.0.2.tgz#b91d806f5d27188e4ab3e7d107d881a1cc4642b6" + dependencies: + buffer-indexof "^1.0.0" + +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + dependencies: + esutils "^2.0.2" + +dom-converter@~0.1: + version "0.1.4" + resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.1.4.tgz#a45ef5727b890c9bffe6d7c876e7b19cb0e17f3b" + dependencies: + utila "~0.3" + +dom-serializer@0, dom-serializer@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" + dependencies: + domelementtype "~1.1.1" + entities "~1.1.1" + +dom-urls@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/dom-urls/-/dom-urls-1.1.0.tgz#001ddf81628cd1e706125c7176f53ccec55d918e" + dependencies: + urijs "^1.16.1" + +domain-browser@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + +domelementtype@1, domelementtype@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" + +domelementtype@~1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" + +domhandler@2.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.1.0.tgz#d2646f5e57f6c3bab11cf6cb05d3c0acf7412594" + dependencies: + domelementtype "1" + +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + dependencies: + domelementtype "1" + +domutils@1.1: + version "1.1.6" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.1.6.tgz#bddc3de099b9a2efacc51c623f28f416ecc57485" + dependencies: + domelementtype "1" + +domutils@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + dependencies: + dom-serializer "0" + domelementtype "1" + +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + dependencies: + dom-serializer "0" + domelementtype "1" + +dot-prop@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" + dependencies: + is-obj "^1.0.0" + +dotenv-expand@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-4.2.0.tgz#def1f1ca5d6059d24a766e587942c21106ce1275" + +dotenv@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d" + +duplexer2@~0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + +duplexer@^0.1.1, duplexer@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + +electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.30: + version "1.3.52" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.52.tgz#d2d9f1270ba4a3b967b831c40ef71fb4d9ab5ce0" + +elliptic@^6.0.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +emoji-regex@^6.1.0: + version "6.5.1" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2" + +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + dependencies: + iconv-lite "~0.4.13" + +enhanced-resolve@^3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.4.0" + object-assign "^4.0.1" + tapable "^0.2.7" + +entities@^1.1.1, entities@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + +enzyme-adapter-react-16@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.1.1.tgz#a8f4278b47e082fbca14f5bfb1ee50ee650717b4" + dependencies: + enzyme-adapter-utils "^1.3.0" + lodash "^4.17.4" + object.assign "^4.0.4" + object.values "^1.0.4" + prop-types "^15.6.0" + react-reconciler "^0.7.0" + react-test-renderer "^16.0.0-0" + +enzyme-adapter-utils@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.4.0.tgz#c403b81e8eb9953658569e539780964bdc98de62" + dependencies: + object.assign "^4.1.0" + prop-types "^15.6.0" + +enzyme@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.3.0.tgz#0971abd167f2d4bf3f5bd508229e1c4b6dc50479" + dependencies: + cheerio "^1.0.0-rc.2" + function.prototype.name "^1.0.3" + has "^1.0.1" + is-boolean-object "^1.0.0" + is-callable "^1.1.3" + is-number-object "^1.0.3" + is-string "^1.0.4" + is-subset "^0.1.1" + lodash "^4.17.4" + object-inspect "^1.5.0" + object-is "^1.0.1" + object.assign "^4.1.0" + object.entries "^1.0.4" + object.values "^1.0.4" + raf "^3.4.0" + rst-selector-parser "^2.2.3" + +errno@^0.1.3, errno@~0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + dependencies: + prr "~1.0.1" + +error-ex@^1.2.0, error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.4.3, es-abstract@^1.6.1, es-abstract@^1.7.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.45" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.45.tgz#0bfdf7b473da5919d5adf3bd25ceb754fccc3653" + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.1" + next-tick "1" + +es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-map@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" + +es6-promise@^4.0.3, es6-promise@^4.0.5: + version "4.2.4" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29" + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + dependencies: + es6-promise "^4.0.3" + +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" + +es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + dependencies: + d "1" + es5-ext "~0.10.14" + +es6-weak-map@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escodegen@^1.6.1: + version "1.11.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +escope@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" + dependencies: + es6-map "^0.1.3" + es6-weak-map "^2.0.1" + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-config-origami-component@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-origami-component/-/eslint-config-origami-component-1.0.0.tgz#c6a1d758b227b39d506796f8d44345653a705e46" + +eslint-config-prettier@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3" + dependencies: + get-stdin "^5.0.1" + +eslint-config-react-app@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-2.1.0.tgz#23c909f71cbaff76b945b831d2d814b8bde169eb" + +eslint-import-resolver-node@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + dependencies: + debug "^2.6.9" + resolve "^1.5.0" + +eslint-loader@1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-1.9.0.tgz#7e1be9feddca328d3dcfaef1ad49d5beffe83a13" + dependencies: + loader-fs-cache "^1.0.0" + loader-utils "^1.0.2" + object-assign "^4.0.1" + object-hash "^1.1.4" + rimraf "^2.6.1" + +eslint-module-utils@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" + dependencies: + debug "^2.6.8" + pkg-dir "^1.0.0" + +eslint-plugin-flowtype@2.39.1: + version "2.39.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.39.1.tgz#b5624622a0388bcd969f4351131232dcb9649cd5" + dependencies: + lodash "^4.15.0" + +eslint-plugin-import@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz#fa1b6ef31fcb3c501c09859c1b86f1fc5b986894" + dependencies: + builtin-modules "^1.1.1" + contains-path "^0.1.0" + debug "^2.6.8" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.1" + eslint-module-utils "^2.1.1" + has "^1.0.1" + lodash.cond "^4.3.0" + minimatch "^3.0.3" + read-pkg-up "^2.0.0" + +eslint-plugin-jsx-a11y@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz#5c96bb5186ca14e94db1095ff59b3e2bd94069b1" + dependencies: + aria-query "^0.7.0" + array-includes "^3.0.3" + ast-types-flow "0.0.7" + axobject-query "^0.1.0" + damerau-levenshtein "^1.0.0" + emoji-regex "^6.1.0" + jsx-ast-utils "^1.4.0" + +eslint-plugin-prettier@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz#71998c60aedfa2141f7bfcbf9d1c459bf98b4fad" + dependencies: + fast-diff "^1.1.1" + jest-docblock "^21.0.0" + +eslint-plugin-react@7.4.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.4.0.tgz#300a95861b9729c087d362dd64abcc351a74364a" + dependencies: + doctrine "^2.0.0" + has "^1.0.1" + jsx-ast-utils "^2.0.0" + prop-types "^15.5.10" + +eslint-scope@^3.7.1: + version "3.7.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint@4.10.0: + version "4.10.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.10.0.tgz#f25d0d7955c81968c2309aa5c9a229e045176bb7" + dependencies: + ajv "^5.2.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.0.1" + doctrine "^2.0.0" + eslint-scope "^3.7.1" + espree "^3.5.1" + esquery "^1.0.0" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^9.17.0" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "^4.0.1" + text-table "~0.2.0" + +espree@^3.5.1: + version "3.5.4" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" + dependencies: + acorn "^5.5.0" + acorn-jsx "^3.0.0" + +esprima@^2.6.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + +esquery@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + dependencies: + d "1" + es5-ext "~0.10.14" + +event-stream@~3.3.0: + version "3.3.4" + resolved "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + +eventemitter3@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" + +events@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + +eventsource@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-0.1.6.tgz#0acede849ed7dd1ccc32c811bb11b944d4f29232" + dependencies: + original ">=0.0.5" + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +exec-sh@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" + dependencies: + merge "^1.2.0" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +expand-tilde@^2.0.0, expand-tilde@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + dependencies: + homedir-polyfill "^1.0.1" + +express@^4.13.3: + version "4.16.3" + resolved "https://registry.yarnpkg.com/express/-/express-4.16.3.tgz#6af8a502350db3246ecc4becf6b5a34d22f7ed53" + dependencies: + accepts "~1.3.5" + array-flatten "1.1.1" + body-parser "1.18.2" + content-disposition "0.5.2" + content-type "~1.0.4" + cookie "0.3.1" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.1.1" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.2" + path-to-regexp "0.1.7" + proxy-addr "~2.0.3" + qs "6.5.1" + range-parser "~1.2.0" + safe-buffer "5.1.1" + send "0.16.2" + serve-static "1.13.2" + setprototypeof "1.1.0" + statuses "~1.4.0" + type-is "~1.6.16" + utils-merge "1.0.1" + vary "~1.1.2" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.0, extend@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +external-editor@^2.0.4: + version "2.2.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extract-text-webpack-plugin@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extract-text-webpack-plugin/-/extract-text-webpack-plugin-3.0.2.tgz#5f043eaa02f9750a9258b78c0a6e0dc1408fb2f7" + dependencies: + async "^2.4.1" + loader-utils "^1.1.0" + schema-utils "^0.3.0" + webpack-sources "^1.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + +fast-deep-equal@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + +fast-diff@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +fastparse@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" + +faye-websocket@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" + dependencies: + websocket-driver ">=0.5.1" + +faye-websocket@~0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.1.tgz#f0efe18c4f56e4f40afc7e06c719fd5ee6188f38" + dependencies: + websocket-driver ">=0.5.1" + +fb-watchman@^1.8.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.2.tgz#a24cf47827f82d38fb59a69ad70b76e3b6ae7383" + dependencies: + bser "1.0.2" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + +fbjs@^0.8.16: + version "0.8.17" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.18" + +fetch-mock@^6.5.0: + version "6.5.1" + resolved "https://registry.yarnpkg.com/fetch-mock/-/fetch-mock-6.5.1.tgz#62e903b1444fc921f97edd4b16b3b9bf42711177" + dependencies: + babel-polyfill "^6.26.0" + eslint-config-origami-component "^1.0.0" + eslint-config-prettier "^2.9.0" + eslint-plugin-prettier "^2.6.1" + glob-to-regexp "^0.4.0" + path-to-regexp "^2.2.1" + prettier "^1.13.7" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +file-loader@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.5.tgz#91c25b6b6fbe56dae99f10a425fd64933b5c9daa" + dependencies: + loader-utils "^1.0.2" + schema-utils "^0.3.0" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + +filesize@3.5.11: + version "3.5.11" + resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.5.11.tgz#1919326749433bb3cf77368bd158caabcc19e9ee" + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +finalhandler@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.2" + statuses "~1.4.0" + unpipe "~1.0.0" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-cache-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" + dependencies: + commondir "^1.0.1" + make-dir "^1.0.0" + pkg-dir "^2.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +flat-cache@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +flatten@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" + +flow-bin@^0.77.0: + version "0.77.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.77.0.tgz#4e5c93929f289a0c28e08fb361a9734944a11297" + +flow-typed@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/flow-typed/-/flow-typed-2.5.1.tgz#0ff565cc94d2af8c557744ba364b6f14726a6b9f" + dependencies: + "@octokit/rest" "^15.2.6" + babel-polyfill "^6.26.0" + colors "^1.1.2" + fs-extra "^5.0.0" + glob "^7.1.2" + got "^7.1.0" + md5 "^2.1.0" + mkdirp "^0.5.1" + rimraf "^2.6.2" + semver "^5.5.0" + table "^4.0.2" + through "^2.3.8" + unzipper "^0.8.11" + which "^1.3.0" + yargs "^4.2.0" + +follow-redirects@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.1.tgz#67a8f14f5a1f67f962c2c46469c79eaec0a90291" + dependencies: + debug "^3.1.0" + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +form-data@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" + dependencies: + asynckit "^0.4.0" + combined-stream "1.0.6" + mime-types "^2.1.12" + +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + +from@~0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + +fs-extra@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^3.0.0" + universalify "^0.1.0" + +fs-extra@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" + rimraf "^2.2.8" + +fs-extra@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + dependencies: + minipass "^2.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0, fsevents@^1.1.3, fsevents@^1.2.2: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +function-bind@^1.0.2, function-bind@^1.1.0, function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +function.prototype.name@^1.0.3: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + is-callable "^1.1.3" + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +gaze@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.3.tgz#c441733e13b927ac8c0ff0b4c3b033f28812924a" + dependencies: + globule "^1.0.0" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + +get-stdin@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob-to-regexp@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.0.tgz#49bd677b1671022bd10921c3788f23cdebf9c7e6" + +glob@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@~7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-dirs@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + dependencies: + ini "^1.3.4" + +global-modules@1.0.0, global-modules@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" + dependencies: + global-prefix "^1.0.1" + is-windows "^1.0.1" + resolve-dir "^1.0.0" + +global-prefix@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + dependencies: + expand-tilde "^2.0.2" + homedir-polyfill "^1.0.1" + ini "^1.3.4" + is-windows "^1.0.1" + which "^1.2.14" + +globals@^9.17.0, globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +globby@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + dependencies: + array-union "^1.0.1" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +globule@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.1.tgz#5dffb1b191f22d20797a9369b49eab4e9839696d" + dependencies: + glob "~7.1.1" + lodash "~4.17.10" + minimatch "~3.0.2" + +got@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + dependencies: + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" + url-parse-lax "^1.0.0" + +got@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" + dependencies: + decompress-response "^3.2.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-plain-obj "^1.1.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + p-cancelable "^0.3.0" + p-timeout "^1.1.1" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + url-parse-lax "^1.0.0" + url-to-options "^1.0.1" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + +gzip-size@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-3.0.0.tgz#546188e9bdc337f673772f81660464b389dce520" + dependencies: + duplexer "^0.1.1" + +handle-thing@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" + +handlebars@^4.0.3: + version "4.0.11" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +has-symbol-support-x@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + +has-to-string-tag-x@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + dependencies: + has-symbol-support-x "^1.4.1" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.5.tgz#e38ab4b85dfb1e0c40fe9265c0e9b54854c23812" + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +he@1.1.x: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + +history@^4.7.2: + version "4.7.2" + resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b" + dependencies: + invariant "^2.2.1" + loose-envify "^1.2.0" + resolve-pathname "^2.2.0" + value-equal "^0.4.0" + warning "^3.0.0" + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0: + version "2.5.5" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +homedir-polyfill@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + dependencies: + parse-passwd "^1.0.0" + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + +hpack.js@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" + dependencies: + inherits "^2.0.1" + obuf "^1.0.0" + readable-stream "^2.0.1" + wbuf "^1.1.0" + +html-comment-regex@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.1.tgz#668b93776eaae55ebde8f3ad464b307a4963625e" + +html-encoding-sniffer@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + dependencies: + whatwg-encoding "^1.0.1" + +html-entities@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f" + +html-minifier@^3.2.3: + version "3.5.19" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.19.tgz#ed53c4b7326fe507bc3a1adbcc3bbb56660a2ebd" + dependencies: + camel-case "3.0.x" + clean-css "4.1.x" + commander "2.16.x" + he "1.1.x" + param-case "2.1.x" + relateurl "0.2.x" + uglify-js "3.4.x" + +html-parse-stringify2@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/html-parse-stringify2/-/html-parse-stringify2-2.0.1.tgz#dc5670b7292ca158b7bc916c9a6735ac8872834a" + dependencies: + void-elements "^2.0.1" + +html-webpack-plugin@2.29.0: + version "2.29.0" + resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-2.29.0.tgz#e987f421853d3b6938c8c4c8171842e5fd17af23" + dependencies: + bluebird "^3.4.7" + html-minifier "^3.2.3" + loader-utils "^0.2.16" + lodash "^4.17.3" + pretty-error "^2.0.2" + toposort "^1.0.0" + +htmlparser2@^3.9.1: + version "3.9.2" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" + dependencies: + domelementtype "^1.3.0" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^2.0.2" + +htmlparser2@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.3.0.tgz#cc70d05a59f6542e43f0e685c982e14c924a9efe" + dependencies: + domelementtype "1" + domhandler "2.1" + domutils "1.1" + readable-stream "1.0" + +http-deceiver@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" + +http-errors@1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" + dependencies: + depd "1.1.1" + inherits "2.0.3" + setprototypeof "1.0.3" + statuses ">= 1.3.1 < 2" + +http-errors@~1.6.2: + version "1.6.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + +http-parser-js@>=0.4.0: + version "0.4.13" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.4.13.tgz#3bd6d6fde6e3172c9334c3b33b6c193d80fe1137" + +http-proxy-agent@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" + dependencies: + agent-base "4" + debug "3.1.0" + +http-proxy-middleware@~0.17.4: + version "0.17.4" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz#642e8848851d66f09d4f124912846dbaeb41b833" + dependencies: + http-proxy "^1.16.2" + is-glob "^3.1.0" + lodash "^4.17.2" + micromatch "^2.3.11" + +http-proxy@^1.16.2: + version "1.17.0" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" + dependencies: + eventemitter3 "^3.0.0" + follow-redirects "^1.0.0" + requires-port "^1.0.0" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + +https-proxy-agent@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + dependencies: + agent-base "^4.1.0" + debug "^3.1.0" + +hyphenate-style-name@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz#31160a36930adaf1fc04c6074f7eb41465d4ec4b" + +i18next-browser-languagedetector@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-2.2.2.tgz#b2599e3e8bc8b66038010e9758c28222688df6aa" + +i18next-fetch-backend@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/i18next-fetch-backend/-/i18next-fetch-backend-0.1.0.tgz#18b67920d0e605e616f93bbdf897e59adf9c9c05" + dependencies: + i18next-xhr-backend "^1.4.3" + +i18next-xhr-backend@^1.4.3: + version "1.5.1" + resolved "https://registry.yarnpkg.com/i18next-xhr-backend/-/i18next-xhr-backend-1.5.1.tgz#50282610780c6a696d880dfa7f4ac1d01e8c3ad5" + +i18next@^11.4.0: + version "11.4.0" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-11.4.0.tgz#9179bc27b74158d773893356f19b039bedbc355a" + +iconv-lite@0.4.19: + version "0.4.19" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" + +iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +icss-replace-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" + +icss-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-2.1.0.tgz#83f0a0ec378bf3246178b6c2ad9136f135b1c962" + dependencies: + postcss "^6.0.1" + +ieee754@^1.1.4: + version "1.1.12" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" + +ignore@^3.3.3: + version "3.3.10" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + +import-lazy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + +import-local@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-0.1.1.tgz#b1179572aacdc11c6a91009fb430dbcab5f668a8" + dependencies: + pkg-dir "^2.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +in-publish@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +indexes-of@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + +ini@^1.3.4, ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + +inquirer@3.3.0, inquirer@^3.0.6: + version "3.3.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.0.4" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + +internal-ip@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-1.2.0.tgz#ae9fbf93b984878785d50a8de1b356956058cf5c" + dependencies: + meow "^3.3.0" + +interpret@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" + +invariant@^2.0.0, invariant@^2.2.1, invariant@^2.2.2, invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +ip@^1.1.0, ip@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + +ipaddr.js@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.6.0.tgz#e3fa357b773da619f26e95f049d055c72796f86b" + +is-absolute-url@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-boolean-object@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93" + +is-buffer@^1.1.5, is-buffer@~1.1.1: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + +is-ci@^1.0.10: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" + dependencies: + ci-info "^1.0.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-function@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + dependencies: + is-extglob "^2.1.1" + +is-in-browser@^1.0.2, is-in-browser@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-in-browser/-/is-in-browser-1.1.3.tgz#56ff4db683a078c6082eb95dad7dc62e1d04f835" + +is-installed-globally@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" + dependencies: + global-dirs "^0.1.0" + is-path-inside "^1.0.0" + +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + +is-number-object@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.3.tgz#f265ab89a9f445034ef6aff15a8f00b00f551799" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + +is-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + +is-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + dependencies: + path-is-inside "^1.0.1" + +is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-resolvable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + +is-retry-allowed@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + +is-root@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-root/-/is-root-1.0.0.tgz#07b6c233bc394cd9d02ba15c966bd6660d6342d5" + +is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-string@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64" + +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + +is-svg@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9" + dependencies: + html-comment-regex "^1.1.0" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +is-windows@^1.0.1, is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + +isomorphic-fetch@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul-api@^1.1.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.1.tgz#4c3b05d18c0016d1022e079b98dc82c40f488954" + dependencies: + async "^2.1.4" + compare-versions "^3.1.0" + fileset "^2.0.2" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-hook "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-report "^1.1.4" + istanbul-lib-source-maps "^1.2.4" + istanbul-reports "^1.3.0" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.2, istanbul-lib-coverage@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz#f7d8f2e42b97e37fe796114cb0f9d68b5e3a4341" + +istanbul-lib-hook@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz#f614ec45287b2a8fc4f07f5660af787575601805" + dependencies: + append-transform "^1.0.0" + +istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.4.2: + version "1.10.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.2.0" + semver "^5.3.0" + +istanbul-lib-report@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz#e886cdf505c4ebbd8e099e4396a90d0a28e2acb5" + dependencies: + istanbul-lib-coverage "^1.2.0" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.1.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz#20fb54b14e14b3fb6edb6aca3571fd2143db44e6" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.1.2" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-lib-source-maps@^1.2.4: + version "1.2.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz#ffe6be4e7ab86d3603e4290d54990b14506fc9b1" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.2.0" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.3.0.tgz#2f322e81e1d9520767597dca3c20a0cce89a3554" + dependencies: + handlebars "^4.0.3" + +isurl@^1.0.0-alpha5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + dependencies: + has-to-string-tag-x "^1.2.0" + is-object "^1.0.1" + +jest-changed-files@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.3.tgz#9394d5cc65c438406149bef1bf4d52b68e03e3f8" + +jest-cli@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.4.tgz#e532b19d88ae5bc6c417e8b0593a6fe954b1dc93" + dependencies: + ansi-escapes "^1.4.0" + callsites "^2.0.0" + chalk "^1.1.3" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + istanbul-api "^1.1.1" + istanbul-lib-coverage "^1.0.1" + istanbul-lib-instrument "^1.4.2" + istanbul-lib-source-maps "^1.1.0" + jest-changed-files "^20.0.3" + jest-config "^20.0.4" + jest-docblock "^20.0.3" + jest-environment-jsdom "^20.0.3" + jest-haste-map "^20.0.4" + jest-jasmine2 "^20.0.4" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve-dependencies "^20.0.3" + jest-runtime "^20.0.4" + jest-snapshot "^20.0.3" + jest-util "^20.0.3" + micromatch "^2.3.11" + node-notifier "^5.0.2" + pify "^2.3.0" + slash "^1.0.0" + string-length "^1.0.1" + throat "^3.0.0" + which "^1.2.12" + worker-farm "^1.3.1" + yargs "^7.0.2" + +jest-config@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.4.tgz#e37930ab2217c913605eff13e7bd763ec48faeea" + dependencies: + chalk "^1.1.3" + glob "^7.1.1" + jest-environment-jsdom "^20.0.3" + jest-environment-node "^20.0.3" + jest-jasmine2 "^20.0.4" + jest-matcher-utils "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-validate "^20.0.3" + pretty-format "^20.0.3" + +jest-diff@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.3.tgz#81f288fd9e675f0fb23c75f1c2b19445fe586617" + dependencies: + chalk "^1.1.3" + diff "^3.2.0" + jest-matcher-utils "^20.0.3" + pretty-format "^20.0.3" + +jest-docblock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" + +jest-docblock@^21.0.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" + +jest-environment-jsdom@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.3.tgz#048a8ac12ee225f7190417713834bb999787de99" + dependencies: + jest-mock "^20.0.3" + jest-util "^20.0.3" + jsdom "^9.12.0" + +jest-environment-node@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.3.tgz#d488bc4612af2c246e986e8ae7671a099163d403" + dependencies: + jest-mock "^20.0.3" + jest-util "^20.0.3" + +jest-get-type@^22.1.0: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" + +jest-haste-map@^20.0.4: + version "20.0.5" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.5.tgz#abad74efb1a005974a7b6517e11010709cab9112" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + jest-docblock "^20.0.3" + micromatch "^2.3.11" + sane "~1.6.0" + worker-farm "^1.3.1" + +jest-jasmine2@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz#fcc5b1411780d911d042902ef1859e852e60d5e1" + dependencies: + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-matchers "^20.0.3" + jest-message-util "^20.0.3" + jest-snapshot "^20.0.3" + once "^1.4.0" + p-map "^1.1.1" + +jest-junit@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-5.1.0.tgz#e8e497d810a829bf02783125aab74b5df6caa8fe" + dependencies: + jest-validate "^23.0.1" + mkdirp "^0.5.1" + strip-ansi "^4.0.0" + xml "^1.0.1" + +jest-matcher-utils@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz#b3a6b8e37ca577803b0832a98b164f44b7815612" + dependencies: + chalk "^1.1.3" + pretty-format "^20.0.3" + +jest-matchers@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.3.tgz#ca69db1c32db5a6f707fa5e0401abb55700dfd60" + dependencies: + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" + +jest-message-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.3.tgz#6aec2844306fcb0e6e74d5796c1006d96fdd831c" + dependencies: + chalk "^1.1.3" + micromatch "^2.3.11" + slash "^1.0.0" + +jest-mock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.3.tgz#8bc070e90414aa155c11a8d64c869a0d5c71da59" + +jest-regex-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.3.tgz#85bbab5d133e44625b19faf8c6aa5122d085d762" + +jest-resolve-dependencies@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.3.tgz#6e14a7b717af0f2cb3667c549de40af017b1723a" + dependencies: + jest-regex-util "^20.0.3" + +jest-resolve@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.4.tgz#9448b3e8b6bafc15479444c6499045b7ffe597a5" + dependencies: + browser-resolve "^1.11.2" + is-builtin-module "^1.0.0" + resolve "^1.3.2" + +jest-runtime@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.4.tgz#a2c802219c4203f754df1404e490186169d124d8" + dependencies: + babel-core "^6.0.0" + babel-jest "^20.0.3" + babel-plugin-istanbul "^4.0.0" + chalk "^1.1.3" + convert-source-map "^1.4.0" + graceful-fs "^4.1.11" + jest-config "^20.0.4" + jest-haste-map "^20.0.4" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-util "^20.0.3" + json-stable-stringify "^1.0.1" + micromatch "^2.3.11" + strip-bom "3.0.0" + yargs "^7.0.2" + +jest-snapshot@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.3.tgz#5b847e1adb1a4d90852a7f9f125086e187c76566" + dependencies: + chalk "^1.1.3" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-util "^20.0.3" + natural-compare "^1.4.0" + pretty-format "^20.0.3" + +jest-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.3.tgz#0c07f7d80d82f4e5a67c6f8b9c3fe7f65cfd32ad" + dependencies: + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-message-util "^20.0.3" + jest-mock "^20.0.3" + jest-validate "^20.0.3" + leven "^2.1.0" + mkdirp "^0.5.1" + +jest-validate@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.3.tgz#d0cfd1de4f579f298484925c280f8f1d94ec3cab" + dependencies: + chalk "^1.1.3" + jest-matcher-utils "^20.0.3" + leven "^2.1.0" + pretty-format "^20.0.3" + +jest-validate@^23.0.1: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.4.0.tgz#d96eede01ef03ac909c009e9c8e455197d48c201" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.2.0" + +jest@20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" + dependencies: + jest-cli "^20.0.4" + +js-base64@^2.1.8, js-base64@^2.1.9: + version "2.4.8" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.8.tgz#57a9b130888f956834aa40c5b165ba59c758f033" + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.1: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@~3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" + dependencies: + argparse "^1.0.7" + esprima "^2.6.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsdom@^9.12.0: + version "9.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" + dependencies: + abab "^1.0.3" + acorn "^4.0.4" + acorn-globals "^3.1.0" + array-equal "^1.0.0" + content-type-parser "^1.0.1" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" + escodegen "^1.6.1" + html-encoding-sniffer "^1.0.1" + nwmatcher ">= 1.3.9 < 2.0.0" + parse5 "^1.5.1" + request "^2.79.0" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.2" + webidl-conversions "^4.0.0" + whatwg-encoding "^1.0.1" + whatwg-url "^4.3.0" + xml-name-validator "^2.0.1" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json-loader@^0.5.4: + version "0.5.7" + resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json3@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" + +json5@^0.5.0, json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +jss-camel-case@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jss-camel-case/-/jss-camel-case-6.1.0.tgz#ccb1ff8d6c701c02a1fed6fb6fb6b7896e11ce44" + dependencies: + hyphenate-style-name "^1.0.2" + +jss-compose@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/jss-compose/-/jss-compose-5.0.0.tgz#ce01b2e4521d65c37ea42cf49116e5f7ab596484" + dependencies: + warning "^3.0.0" + +jss-default-unit@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/jss-default-unit/-/jss-default-unit-8.0.2.tgz#cc1e889bae4c0b9419327b314ab1c8e2826890e6" + +jss-expand@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/jss-expand/-/jss-expand-5.3.0.tgz#02be076efe650125c842f5bb6fb68786fe441ed6" + +jss-extend@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/jss-extend/-/jss-extend-6.2.0.tgz#4af09d0b72fb98ee229970f8ca852fec1ca2a8dc" + dependencies: + warning "^3.0.0" + +jss-global@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/jss-global/-/jss-global-3.0.0.tgz#e19e5c91ab2b96353c227e30aa2cbd938cdaafa2" + +jss-nested@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/jss-nested/-/jss-nested-6.0.1.tgz#ef992b79d6e8f63d939c4397b9d99b5cbbe824ca" + dependencies: + warning "^3.0.0" + +jss-preset-default@^4.3.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/jss-preset-default/-/jss-preset-default-4.5.0.tgz#d3a457012ccd7a551312014e394c23c4b301cadd" + dependencies: + jss-camel-case "^6.1.0" + jss-compose "^5.0.0" + jss-default-unit "^8.0.2" + jss-expand "^5.3.0" + jss-extend "^6.2.0" + jss-global "^3.0.0" + jss-nested "^6.0.1" + jss-props-sort "^6.0.0" + jss-template "^1.0.1" + jss-vendor-prefixer "^7.0.0" + +jss-props-sort@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/jss-props-sort/-/jss-props-sort-6.0.0.tgz#9105101a3b5071fab61e2d85ea74cc22e9b16323" + +jss-template@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/jss-template/-/jss-template-1.0.1.tgz#09aed9d86cc547b07f53ef355d7e1777f7da430a" + dependencies: + warning "^3.0.0" + +jss-vendor-prefixer@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/jss-vendor-prefixer/-/jss-vendor-prefixer-7.0.0.tgz#0166729650015ef19d9f02437c73667231605c71" + dependencies: + css-vendor "^0.3.8" + +jss@^9.7.0: + version "9.8.7" + resolved "https://registry.yarnpkg.com/jss/-/jss-9.8.7.tgz#ed9763fc0f2f0260fc8260dac657af61e622ce05" + dependencies: + is-in-browser "^1.1.3" + symbol-observable "^1.1.0" + warning "^3.0.0" + +jsx-ast-utils@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" + +jsx-ast-utils@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f" + dependencies: + array-includes "^3.0.3" + +killable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.0.tgz#da8b84bd47de5395878f95d64d02f2449fe05e6b" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + optionalDependencies: + graceful-fs "^4.1.9" + +latest-version@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" + dependencies: + package-json "^4.0.0" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +listenercount@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/listenercount/-/listenercount-1.0.1.tgz#84c8a72ab59c4725321480c975e6508342e70937" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +loader-fs-cache@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/loader-fs-cache/-/loader-fs-cache-1.0.1.tgz#56e0bf08bd9708b26a765b68509840c8dec9fdbc" + dependencies: + find-cache-dir "^0.1.1" + mkdirp "0.5.1" + +loader-runner@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" + +loader-utils@^0.2.16: + version "0.2.17" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" + dependencies: + big.js "^3.1.3" + emojis-list "^2.0.0" + json5 "^0.5.0" + object-assign "^4.0.1" + +loader-utils@^1.0.2, loader-utils@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd" + dependencies: + big.js "^3.1.3" + emojis-list "^2.0.0" + json5 "^0.5.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash-es@^4.17.5: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.10.tgz#62cd7104cdf5dd87f235a837f0ede0e8e5117e05" + +lodash._reinterpolate@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + +lodash.assign@^4.0.3, lodash.assign@^4.0.6, lodash.assign@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + +lodash.clonedeep@^4.3.2: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + +lodash.cond@^4.3.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + +lodash.defaults@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" + +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + +lodash.memoize@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" + +lodash.mergewith@^4.6.0: + version "4.6.1" + resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" + +lodash.template@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + dependencies: + lodash._reinterpolate "~3.0.0" + +lodash.uniq@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" + +"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@~4.17.10: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + +loglevel@^1.4.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lower-case@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" + +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + +lru-cache@^4.0.1: + version "4.1.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +make-dir@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" + dependencies: + pify "^3.0.0" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + +map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + +math-expression-evaluator@^1.2.14: + version "1.2.17" + resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" + +math-random@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + +md5.js@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +md5@^2.1.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" + dependencies: + charenc "~0.0.1" + crypt "~0.0.1" + is-buffer "~1.1.1" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + +memory-fs@^0.4.0, memory-fs@~0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + +meow@^3.3.0, meow@^3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + +merge@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + +micromatch@^2.1.5, micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.4, micromatch@^3.1.8: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +"mime-db@>= 1.34.0 < 2", mime-db@~1.35.0: + version "1.35.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" + +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7: + version "2.1.19" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" + dependencies: + mime-db "~1.35.0" + +mime@1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" + +mime@^1.4.1, mime@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + +"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimatch@3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" + dependencies: + brace-expansion "^1.0.0" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + +minipass@^2.2.1, minipass@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" + dependencies: + minipass "^2.2.1" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +multicast-dns-service-types@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901" + +multicast-dns@^6.0.1: + version "6.2.3" + resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-6.2.3.tgz#a0ec7bd9055c4282f790c3c82f4e28db3b31b229" + dependencies: + dns-packet "^1.3.1" + thunky "^1.0.2" + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + +nan@^2.10.0, nan@^2.9.2: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +nearley@^2.7.10: + version "2.13.0" + resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.13.0.tgz#6e7b0f4e68bfc3e74c99eaef2eda39e513143439" + dependencies: + nomnom "~1.6.2" + railroad-diagrams "^1.0.0" + randexp "0.4.6" + semver "^5.4.1" + +needle@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +negotiator@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + +neo-async@^2.5.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.1.tgz#acb909e327b1e87ec9ef15f41b8a269512ad41ee" + +next-tick@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + +nice-try@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" + +no-case@^2.2.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" + dependencies: + lower-case "^1.1.1" + +node-fetch@^1.0.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +node-fetch@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" + +node-forge@0.7.5: + version "0.7.5" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df" + +node-gyp@^3.3.1: + version "3.7.0" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.7.0.tgz#789478e8f6c45e277aa014f3e28f958f286f9203" + dependencies: + fstream "^1.0.0" + glob "^7.0.3" + graceful-fs "^4.1.2" + mkdirp "^0.5.0" + nopt "2 || 3" + npmlog "0 || 1 || 2 || 3 || 4" + osenv "0" + request ">=2.9.0 <2.82.0" + rimraf "2" + semver "~5.3.0" + tar "^2.0.0" + which "1" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-libs-browser@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df" + dependencies: + assert "^1.1.1" + browserify-zlib "^0.2.0" + buffer "^4.3.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.11.0" + domain-browser "^1.1.1" + events "^1.0.0" + https-browserify "^1.0.0" + os-browserify "^0.3.0" + path-browserify "0.0.0" + process "^0.11.10" + punycode "^1.2.4" + querystring-es3 "^0.2.0" + readable-stream "^2.3.3" + stream-browserify "^2.0.1" + stream-http "^2.7.2" + string_decoder "^1.0.0" + timers-browserify "^2.0.4" + tty-browserify "0.0.0" + url "^0.11.0" + util "^0.10.3" + vm-browserify "0.0.4" + +node-notifier@^5.0.2: + version "5.2.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + dependencies: + growly "^1.3.0" + semver "^5.4.1" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +node-sass-chokidar@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/node-sass-chokidar/-/node-sass-chokidar-1.3.0.tgz#3839698dd1de23b491bb674417b5e6fffaf25270" + dependencies: + async-foreach "^0.1.3" + chokidar "^1.6.1" + get-stdin "^4.0.1" + glob "^7.0.3" + meow "^3.7.0" + node-sass "^4.7.2" + sass-graph "^2.1.1" + stdout-stream "^1.4.0" + +node-sass@^4.7.2: + version "4.9.2" + resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.9.2.tgz#5e63fe6bd0f2ae3ac9d6c14ede8620e2b8bdb437" + dependencies: + async-foreach "^0.1.3" + chalk "^1.1.1" + cross-spawn "^3.0.0" + gaze "^1.0.0" + get-stdin "^4.0.1" + glob "^7.0.3" + in-publish "^2.0.0" + lodash.assign "^4.2.0" + lodash.clonedeep "^4.3.2" + lodash.mergewith "^4.6.0" + meow "^3.7.0" + mkdirp "^0.5.1" + nan "^2.10.0" + node-gyp "^3.3.1" + npmlog "^4.0.0" + request "2.87.0" + sass-graph "^2.2.4" + stdout-stream "^1.4.0" + "true-case-path" "^1.0.2" + +nomnom@~1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.6.2.tgz#84a66a260174408fc5b77a18f888eccc44fb6971" + dependencies: + colors "0.5.x" + underscore "~1.4.4" + +"nopt@2 || 3": + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + dependencies: + abbrev "1" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + +normalize-url@^1.4.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" + dependencies: + object-assign "^4.0.1" + prepend-http "^1.0.0" + query-string "^4.1.0" + sort-keys "^1.0.0" + +npm-bundled@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + +npm-packlist@^1.1.6: + version "1.1.10" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-all@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.3.tgz#49f15b55a66bb4101664ce270cb18e7103f8f185" + dependencies: + ansi-styles "^3.2.0" + chalk "^2.1.0" + cross-spawn "^6.0.4" + memorystream "^0.3.1" + minimatch "^3.0.4" + ps-tree "^1.1.0" + read-pkg "^3.0.0" + shell-quote "^1.6.1" + string.prototype.padend "^3.0.0" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +nth-check@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" + dependencies: + boolbase "~1.0.0" + +num2fraction@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +"nwmatcher@>= 1.3.9 < 2.0.0": + version "1.4.4" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.4.tgz#2285631f34a95f0d0395cd900c96ed39b58f346e" + +oauth-sign@~0.8.1, oauth-sign@~0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@4.1.1, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-hash@^1.1.4: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.0.tgz#76d9ba6ff113cf8efc0d996102851fe6723963e2" + +object-inspect@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" + +object-is@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" + +object-keys@^1.0.11, object-keys@^1.0.8: + version "1.0.12" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + +object.assign@^4.0.4, object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.entries@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.0.4.tgz#1bf9a4dd2288f5b33f3a993d257661f05d161a5f" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.6.1" + function-bind "^1.1.0" + has "^1.0.1" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + +object.values@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.0.4.tgz#e524da09b4f66ff05df457546ec72ac99f13069a" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.6.1" + function-bind "^1.1.0" + has "^1.0.1" + +obuf@^1.0.0, obuf@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + dependencies: + ee-first "1.1.1" + +on-headers@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" + +once@^1.3.0, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + +opn@5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/opn/-/opn-5.2.0.tgz#71fdf934d6827d676cecbea1531f95d354641225" + dependencies: + is-wsl "^1.1.0" + +opn@^5.1.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/opn/-/opn-5.3.0.tgz#64871565c863875f052cfdf53d3e3cb5adb53b1c" + dependencies: + is-wsl "^1.1.0" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1, optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +original@>=0.0.5: + version "1.0.1" + resolved "https://registry.yarnpkg.com/original/-/original-1.0.1.tgz#b0a53ff42ba997a8c9cd1fb5daaeb42b9d693190" + dependencies: + url-parse "~1.4.0" + +os-browserify@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + +os-homedir@^1.0.0, os-homedir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.0.0" + +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@0, osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-cancelable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +p-map@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + +p-timeout@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" + dependencies: + p-finally "^1.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + +package-json@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" + dependencies: + got "^6.7.1" + registry-auth-token "^3.0.1" + registry-url "^3.0.3" + semver "^5.1.0" + +pako@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" + +param-case@2.1.x: + version "2.1.1" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" + dependencies: + no-case "^2.2.0" + +parse-asn1@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + +parse5@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94" + +parse5@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" + dependencies: + "@types/node" "*" + +parseurl@~1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + +path-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.1, path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + +path-to-regexp@^1.0.1, path-to-regexp@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d" + dependencies: + isarray "0.0.1" + +path-to-regexp@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.2.1.tgz#90b617025a16381a879bc82a38d4e8bdeb2bcf45" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + dependencies: + pify "^2.0.0" + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + dependencies: + pify "^3.0.0" + +pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + dependencies: + through "~2.3" + +pbkdf2@^3.0.3: + version "3.0.16" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.16.tgz#7404208ec6b01b62d85bf83853a8064f8d9c2a5c" + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +pify@^2.0.0, pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + dependencies: + find-up "^2.1.0" + +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + +portfinder@^1.0.9: + version "1.0.13" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.13.tgz#bb32ecd87c27104ae6ee44b5a3ccbf0ebb1aede9" + dependencies: + async "^1.5.2" + debug "^2.2.0" + mkdirp "0.5.x" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + +postcss-calc@^5.2.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-5.3.1.tgz#77bae7ca928ad85716e2fda42f261bf7c1d65b5e" + dependencies: + postcss "^5.0.2" + postcss-message-helpers "^2.0.0" + reduce-css-calc "^1.2.6" + +postcss-colormin@^2.1.8: + version "2.2.2" + resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-2.2.2.tgz#6631417d5f0e909a3d7ec26b24c8a8d1e4f96e4b" + dependencies: + colormin "^1.0.5" + postcss "^5.0.13" + postcss-value-parser "^3.2.3" + +postcss-convert-values@^2.3.4: + version "2.6.1" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-2.6.1.tgz#bbd8593c5c1fd2e3d1c322bb925dcae8dae4d62d" + dependencies: + postcss "^5.0.11" + postcss-value-parser "^3.1.2" + +postcss-discard-comments@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz#befe89fafd5b3dace5ccce51b76b81514be00e3d" + dependencies: + postcss "^5.0.14" + +postcss-discard-duplicates@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-2.1.0.tgz#b9abf27b88ac188158a5eb12abcae20263b91932" + dependencies: + postcss "^5.0.4" + +postcss-discard-empty@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz#d2b4bd9d5ced5ebd8dcade7640c7d7cd7f4f92b5" + dependencies: + postcss "^5.0.14" + +postcss-discard-overridden@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz#8b1eaf554f686fb288cd874c55667b0aa3668d58" + dependencies: + postcss "^5.0.16" + +postcss-discard-unused@^2.2.1: + version "2.2.3" + resolved "https://registry.yarnpkg.com/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz#bce30b2cc591ffc634322b5fb3464b6d934f4433" + dependencies: + postcss "^5.0.14" + uniqs "^2.0.0" + +postcss-filter-plugins@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/postcss-filter-plugins/-/postcss-filter-plugins-2.0.3.tgz#82245fdf82337041645e477114d8e593aa18b8ec" + dependencies: + postcss "^5.0.4" + +postcss-flexbugs-fixes@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-3.2.0.tgz#9b8b932c53f9cf13ba0f61875303e447c33dcc51" + dependencies: + postcss "^6.0.1" + +postcss-load-config@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-1.2.0.tgz#539e9afc9ddc8620121ebf9d8c3673e0ce50d28a" + dependencies: + cosmiconfig "^2.1.0" + object-assign "^4.1.0" + postcss-load-options "^1.2.0" + postcss-load-plugins "^2.3.0" + +postcss-load-options@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/postcss-load-options/-/postcss-load-options-1.2.0.tgz#b098b1559ddac2df04bc0bb375f99a5cfe2b6d8c" + dependencies: + cosmiconfig "^2.1.0" + object-assign "^4.1.0" + +postcss-load-plugins@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/postcss-load-plugins/-/postcss-load-plugins-2.3.0.tgz#745768116599aca2f009fad426b00175049d8d92" + dependencies: + cosmiconfig "^2.1.1" + object-assign "^4.1.0" + +postcss-loader@2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-2.0.8.tgz#8c67ddb029407dfafe684a406cfc16bad2ce0814" + dependencies: + loader-utils "^1.1.0" + postcss "^6.0.0" + postcss-load-config "^1.2.0" + schema-utils "^0.3.0" + +postcss-merge-idents@^2.1.5: + version "2.1.7" + resolved "https://registry.yarnpkg.com/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz#4c5530313c08e1d5b3bbf3d2bbc747e278eea270" + dependencies: + has "^1.0.1" + postcss "^5.0.10" + postcss-value-parser "^3.1.1" + +postcss-merge-longhand@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-2.0.2.tgz#23d90cd127b0a77994915332739034a1a4f3d658" + dependencies: + postcss "^5.0.4" + +postcss-merge-rules@^2.0.3: + version "2.1.2" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-2.1.2.tgz#d1df5dfaa7b1acc3be553f0e9e10e87c61b5f721" + dependencies: + browserslist "^1.5.2" + caniuse-api "^1.5.2" + postcss "^5.0.4" + postcss-selector-parser "^2.2.2" + vendors "^1.0.0" + +postcss-message-helpers@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz#a4f2f4fab6e4fe002f0aed000478cdf52f9ba60e" + +postcss-minify-font-values@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz#4b58edb56641eba7c8474ab3526cafd7bbdecb69" + dependencies: + object-assign "^4.0.1" + postcss "^5.0.4" + postcss-value-parser "^3.0.2" + +postcss-minify-gradients@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz#5dbda11373703f83cfb4a3ea3881d8d75ff5e6e1" + dependencies: + postcss "^5.0.12" + postcss-value-parser "^3.3.0" + +postcss-minify-params@^1.0.4: + version "1.2.2" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz#ad2ce071373b943b3d930a3fa59a358c28d6f1f3" + dependencies: + alphanum-sort "^1.0.1" + postcss "^5.0.2" + postcss-value-parser "^3.0.2" + uniqs "^2.0.0" + +postcss-minify-selectors@^2.0.4: + version "2.1.1" + resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz#b2c6a98c0072cf91b932d1a496508114311735bf" + dependencies: + alphanum-sort "^1.0.2" + has "^1.0.1" + postcss "^5.0.14" + postcss-selector-parser "^2.0.0" + +postcss-modules-extract-imports@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.1.0.tgz#b614c9720be6816eaee35fb3a5faa1dba6a05ddb" + dependencies: + postcss "^6.0.1" + +postcss-modules-local-by-default@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz#f7d80c398c5a393fa7964466bd19500a7d61c069" + dependencies: + css-selector-tokenizer "^0.7.0" + postcss "^6.0.1" + +postcss-modules-scope@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz#d6ea64994c79f97b62a72b426fbe6056a194bb90" + dependencies: + css-selector-tokenizer "^0.7.0" + postcss "^6.0.1" + +postcss-modules-values@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz#ecffa9d7e192518389f42ad0e83f72aec456ea20" + dependencies: + icss-replace-symbols "^1.1.0" + postcss "^6.0.1" + +postcss-normalize-charset@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz#ef9ee71212d7fe759c78ed162f61ed62b5cb93f1" + dependencies: + postcss "^5.0.5" + +postcss-normalize-url@^3.0.7: + version "3.0.8" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz#108f74b3f2fcdaf891a2ffa3ea4592279fc78222" + dependencies: + is-absolute-url "^2.0.0" + normalize-url "^1.4.0" + postcss "^5.0.14" + postcss-value-parser "^3.2.3" + +postcss-ordered-values@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-2.2.3.tgz#eec6c2a67b6c412a8db2042e77fe8da43f95c11d" + dependencies: + postcss "^5.0.4" + postcss-value-parser "^3.0.1" + +postcss-reduce-idents@^2.2.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz#c2c6d20cc958284f6abfbe63f7609bf409059ad3" + dependencies: + postcss "^5.0.4" + postcss-value-parser "^3.0.2" + +postcss-reduce-initial@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz#68f80695f045d08263a879ad240df8dd64f644ea" + dependencies: + postcss "^5.0.4" + +postcss-reduce-transforms@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz#ff76f4d8212437b31c298a42d2e1444025771ae1" + dependencies: + has "^1.0.1" + postcss "^5.0.8" + postcss-value-parser "^3.0.1" + +postcss-selector-parser@^2.0.0, postcss-selector-parser@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz#f9437788606c3c9acee16ffe8d8b16297f27bb90" + dependencies: + flatten "^1.0.2" + indexes-of "^1.0.1" + uniq "^1.0.1" + +postcss-svgo@^2.1.1: + version "2.1.6" + resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-2.1.6.tgz#b6df18aa613b666e133f08adb5219c2684ac108d" + dependencies: + is-svg "^2.0.0" + postcss "^5.0.14" + postcss-value-parser "^3.2.3" + svgo "^0.7.0" + +postcss-unique-selectors@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz#981d57d29ddcb33e7b1dfe1fd43b8649f933ca1d" + dependencies: + alphanum-sort "^1.0.1" + postcss "^5.0.4" + uniqs "^2.0.0" + +postcss-value-parser@^3.0.1, postcss-value-parser@^3.0.2, postcss-value-parser@^3.1.1, postcss-value-parser@^3.1.2, postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15" + +postcss-zindex@^2.0.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/postcss-zindex/-/postcss-zindex-2.2.0.tgz#d2109ddc055b91af67fc4cb3b025946639d2af22" + dependencies: + has "^1.0.1" + postcss "^5.0.4" + uniqs "^2.0.0" + +postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0.14, postcss@^5.0.16, postcss@^5.0.2, postcss@^5.0.4, postcss@^5.0.5, postcss@^5.0.6, postcss@^5.0.8, postcss@^5.2.16: + version "5.2.18" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.18.tgz#badfa1497d46244f6390f58b319830d9107853c5" + dependencies: + chalk "^1.1.3" + js-base64 "^2.1.9" + source-map "^0.5.6" + supports-color "^3.2.3" + +postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.13: + version "6.0.23" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324" + dependencies: + chalk "^2.4.1" + source-map "^0.6.1" + supports-color "^5.4.0" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +prepend-http@^1.0.0, prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +prettier@^1.13.7: + version "1.13.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.7.tgz#850f3b8af784a49a6ea2d2eaa7ed1428a34b7281" + +pretty-bytes@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9" + +pretty-error@^2.0.2: + version "2.1.1" + resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3" + dependencies: + renderkid "^2.0.1" + utila "~0.4" + +pretty-format@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.3.tgz#020e350a560a1fe1a98dc3beb6ccffb386de8b14" + dependencies: + ansi-regex "^2.1.1" + ansi-styles "^3.0.0" + +pretty-format@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.2.0.tgz#3b0aaa63c018a53583373c1cb3a5d96cc5e83017" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + +private@^0.1.6, private@^0.1.7, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + +promise@8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-8.0.1.tgz#e45d68b00a17647b6da711bf85ed6ed47208f450" + dependencies: + asap "~2.0.3" + +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + dependencies: + asap "~2.0.3" + +prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1: + version "15.6.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" + dependencies: + loose-envify "^1.3.1" + object-assign "^4.1.1" + +proxy-addr@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.6.0" + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + +ps-tree@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014" + dependencies: + event-stream "~3.3.0" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +psl@^1.1.24: + version "1.1.28" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.28.tgz#4fb6ceb08a1e2214d4fd4de0ca22dae13740bc7b" + +public-encrypt@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.2.tgz#46eb9107206bf73489f8b85b69d91334c6610994" + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + +punycode@^1.2.4, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + +q@^1.1.2: + version "1.5.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + +qs@6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" + +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +qs@~6.5.1: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + +query-string@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" + dependencies: + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + +querystring-es3@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +querystringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.0.0.tgz#fa3ed6e68eb15159457c89b37bc6472833195755" + +raf@3.4.0, raf@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.0.tgz#a28876881b4bc2ca9117d4138163ddb80f781575" + dependencies: + performance-now "^2.1.0" + +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" + +randexp@0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" + dependencies: + discontinuous-range "1.0.0" + ret "~0.1.10" + +randomatic@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +range-parser@^1.0.3, range-parser@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + +raw-body@2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89" + dependencies: + bytes "3.0.0" + http-errors "1.6.2" + iconv-lite "0.4.19" + unpipe "1.0.0" + +rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +react-dev-utils@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-5.0.1.tgz#1f396e161fe44b595db1b186a40067289bf06613" + dependencies: + address "1.0.3" + babel-code-frame "6.26.0" + chalk "1.1.3" + cross-spawn "5.1.0" + detect-port-alt "1.1.6" + escape-string-regexp "1.0.5" + filesize "3.5.11" + global-modules "1.0.0" + gzip-size "3.0.0" + inquirer "3.3.0" + is-root "1.0.0" + opn "5.2.0" + react-error-overlay "^4.0.0" + recursive-readdir "2.2.1" + shell-quote "1.6.1" + sockjs-client "1.1.4" + strip-ansi "3.0.1" + text-table "0.2.0" + +react-dom@^16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.4.1.tgz#7f8b0223b3a5fbe205116c56deb85de32685dad6" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + +react-error-overlay@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.0.tgz#d198408a85b4070937a98667f500c832f86bd5d4" + +react-i18next@^7.9.0: + version "7.9.0" + resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-7.9.0.tgz#9e4bdfbfbc0d084eddf13d1cd337cbd4beea6232" + dependencies: + hoist-non-react-statics "^2.3.1" + html-parse-stringify2 "2.0.1" + prop-types "^15.6.0" + +react-is@^16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.4.1.tgz#d624c4650d2c65dbd52c72622bbf389435d9776e" + +react-jss@^8.6.0: + version "8.6.1" + resolved "https://registry.yarnpkg.com/react-jss/-/react-jss-8.6.1.tgz#a06e2e1d2c4d91b4d11befda865e6c07fbd75252" + dependencies: + hoist-non-react-statics "^2.5.0" + jss "^9.7.0" + jss-preset-default "^4.3.0" + prop-types "^15.6.0" + theming "^1.3.0" + +react-reconciler@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.7.0.tgz#9614894103e5f138deeeb5eabaf3ee80eb1d026d" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + +react-redux@^5.0.7: + version "5.0.7" + resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-5.0.7.tgz#0dc1076d9afb4670f993ffaef44b8f8c1155a4c8" + dependencies: + hoist-non-react-statics "^2.5.0" + invariant "^2.0.0" + lodash "^4.17.5" + lodash-es "^4.17.5" + loose-envify "^1.1.0" + prop-types "^15.6.0" + +react-router-dom@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6" + dependencies: + history "^4.7.2" + invariant "^2.2.4" + loose-envify "^1.3.1" + prop-types "^15.6.1" + react-router "^4.3.1" + warning "^4.0.1" + +react-router-redux@^5.0.0-alpha.9: + version "5.0.0-alpha.9" + resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-5.0.0-alpha.9.tgz#825431516e0e6f1fd93b8807f6bd595e23ec3d10" + dependencies: + history "^4.7.2" + prop-types "^15.6.0" + react-router "^4.2.0" + +react-router@^4.2.0, react-router@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e" + dependencies: + history "^4.7.2" + hoist-non-react-statics "^2.5.0" + invariant "^2.2.4" + loose-envify "^1.3.1" + path-to-regexp "^1.7.0" + prop-types "^15.6.1" + warning "^4.0.1" + +react-scripts@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-1.1.4.tgz#d5c230e707918d6dd2d06f303b10f5222d017c88" + dependencies: + autoprefixer "7.1.6" + babel-core "6.26.0" + babel-eslint "7.2.3" + babel-jest "20.0.3" + babel-loader "7.1.2" + babel-preset-react-app "^3.1.1" + babel-runtime "6.26.0" + case-sensitive-paths-webpack-plugin "2.1.1" + chalk "1.1.3" + css-loader "0.28.7" + dotenv "4.0.0" + dotenv-expand "4.2.0" + eslint "4.10.0" + eslint-config-react-app "^2.1.0" + eslint-loader "1.9.0" + eslint-plugin-flowtype "2.39.1" + eslint-plugin-import "2.8.0" + eslint-plugin-jsx-a11y "5.1.1" + eslint-plugin-react "7.4.0" + extract-text-webpack-plugin "3.0.2" + file-loader "1.1.5" + fs-extra "3.0.1" + html-webpack-plugin "2.29.0" + jest "20.0.4" + object-assign "4.1.1" + postcss-flexbugs-fixes "3.2.0" + postcss-loader "2.0.8" + promise "8.0.1" + raf "3.4.0" + react-dev-utils "^5.0.1" + resolve "1.6.0" + style-loader "0.19.0" + sw-precache-webpack-plugin "0.11.4" + url-loader "0.6.2" + webpack "3.8.1" + webpack-dev-server "2.9.4" + webpack-manifest-plugin "1.3.2" + whatwg-fetch "2.0.3" + optionalDependencies: + fsevents "^1.1.3" + +react-test-renderer@^16.0.0-0, react-test-renderer@^16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.4.1.tgz#f2fb30c2c7b517db6e5b10ed20bb6b0a7ccd8d70" + dependencies: + fbjs "^0.8.16" + object-assign "^4.1.1" + prop-types "^15.6.0" + react-is "^16.4.1" + +react@^16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@1.0: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.2.9, readable-stream@^2.3.3, readable-stream@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@~2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" + dependencies: + buffer-shims "^1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +recursive-readdir@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.1.tgz#90ef231d0778c5ce093c9a48d74e5c5422d13a99" + dependencies: + minimatch "3.0.3" + +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + +reduce-css-calc@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz#747c914e049614a4c9cfbba629871ad1d2927716" + dependencies: + balanced-match "^0.4.2" + math-expression-evaluator "^1.2.14" + reduce-function-call "^1.0.1" + +reduce-function-call@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/reduce-function-call/-/reduce-function-call-1.0.2.tgz#5a200bf92e0e37751752fe45b0ab330fd4b6be99" + dependencies: + balanced-match "^0.4.2" + +redux-devtools-extension@^2.13.5: + version "2.13.5" + resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.5.tgz#3ff34f7227acfeef3964194f5f7fc2765e5c5a39" + +redux-logger@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/redux-logger/-/redux-logger-3.0.6.tgz#f7555966f3098f3c88604c449cf0baf5778274bf" + dependencies: + deep-diff "^0.3.5" + +redux-mock-store@^1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/redux-mock-store/-/redux-mock-store-1.5.3.tgz#1f10528949b7ce8056c2532624f7cafa98576c6d" + dependencies: + lodash.isplainobject "^4.0.6" + +redux-thunk@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622" + +redux@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.0.tgz#aa698a92b729315d22b34a0553d7e6533555cc03" + dependencies: + loose-envify "^1.1.0" + symbol-observable "^1.2.0" + +regenerate@^1.2.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexpu-core@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +registry-auth-token@^3.0.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" + dependencies: + rc "^1.1.6" + safe-buffer "^5.0.1" + +registry-url@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + dependencies: + rc "^1.0.1" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +relateurl@0.2.x: + version "0.2.7" + resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +renderkid@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.1.tgz#898cabfc8bede4b7b91135a3ffd323e58c0db319" + dependencies: + css-select "^1.1.0" + dom-converter "~0.1" + htmlparser2 "~3.3.0" + strip-ansi "^3.0.0" + utila "~0.3" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request@2.87.0, request@^2.79.0: + version "2.87.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + +"request@>=2.9.0 <2.82.0": + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-from-string@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + dependencies: + resolve-from "^3.0.0" + +resolve-dir@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + dependencies: + expand-tilde "^2.0.0" + global-modules "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + +resolve-pathname@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879" + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" + dependencies: + path-parse "^1.0.5" + +resolve@^1.3.2, resolve@^1.5.0: + version "1.8.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + dependencies: + path-parse "^1.0.5" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@2, rimraf@^2.2.8, rimraf@^2.6.1, rimraf@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rst-selector-parser@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" + dependencies: + lodash.flattendeep "^4.4.0" + nearley "^2.7.10" + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + dependencies: + is-promise "^2.1.0" + +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + +safe-buffer@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +sane@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" + dependencies: + anymatch "^1.3.0" + exec-sh "^0.2.0" + fb-watchman "^1.8.0" + minimatch "^3.0.2" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.10.0" + +sass-graph@^2.1.1, sass-graph@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-2.2.4.tgz#13fbd63cd1caf0908b9fd93476ad43a51d1e0b49" + dependencies: + glob "^7.0.0" + lodash "^4.0.0" + scss-tokenizer "^0.2.3" + yargs "^7.0.0" + +sax@^1.2.1, sax@^1.2.4, sax@~1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +schema-utils@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf" + dependencies: + ajv "^5.0.0" + +scss-tokenizer@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1" + dependencies: + js-base64 "^2.1.8" + source-map "^0.4.2" + +select-hose@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" + +selfsigned@^1.9.1: + version "1.10.3" + resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.3.tgz#d628ecf9e3735f84e8bafba936b3cf85bea43823" + dependencies: + node-forge "0.7.5" + +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + dependencies: + semver "^5.0.3" + +"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +semver@~5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +send@0.16.2: + version "0.16.2" + resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.6.2" + mime "1.4.1" + ms "2.0.0" + on-finished "~2.3.0" + range-parser "~1.2.0" + statuses "~1.4.0" + +serve-index@^1.7.2: + version "1.9.1" + resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" + dependencies: + accepts "~1.3.4" + batch "0.6.1" + debug "2.6.9" + escape-html "~1.0.3" + http-errors "~1.6.2" + mime-types "~2.1.17" + parseurl "~1.3.2" + +serve-static@1.13.2: + version "1.13.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.2" + send "0.16.2" + +serviceworker-cache-polyfill@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/serviceworker-cache-polyfill/-/serviceworker-cache-polyfill-4.0.0.tgz#de19ee73bef21ab3c0740a37b33db62464babdeb" + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.4, setimmediate@^1.0.5, setimmediate@~1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +setprototypeof@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" + +setprototypeof@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +shell-quote@1.6.1, shell-quote@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + dependencies: + array-filter "~0.0.0" + array-map "~0.0.0" + array-reduce "~0.0.0" + jsonify "~0.0.0" + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + dependencies: + is-fullwidth-code-point "^2.0.0" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +sockjs-client@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.1.4.tgz#5babe386b775e4cf14e7520911452654016c8b12" + dependencies: + debug "^2.6.6" + eventsource "0.1.6" + faye-websocket "~0.11.0" + inherits "^2.0.1" + json3 "^3.3.2" + url-parse "^1.1.8" + +sockjs@0.3.18: + version "0.3.18" + resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.18.tgz#d9b289316ca7df77595ef299e075f0f937eb4207" + dependencies: + faye-websocket "^0.10.0" + uuid "^2.0.2" + +sort-keys@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + dependencies: + is-plain-obj "^1.0.0" + +source-list-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + +source-map@0.5.x, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.4.2, source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +spdx-correct@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" + +spdy-transport@^2.0.18: + version "2.1.0" + resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-2.1.0.tgz#4bbb15aaffed0beefdd56ad61dbdc8ba3e2cb7a1" + dependencies: + debug "^2.6.8" + detect-node "^2.0.3" + hpack.js "^2.1.6" + obuf "^1.1.1" + readable-stream "^2.2.9" + safe-buffer "^5.0.1" + wbuf "^1.7.2" + +spdy@^3.4.1: + version "3.4.7" + resolved "https://registry.yarnpkg.com/spdy/-/spdy-3.4.7.tgz#42ff41ece5cc0f99a3a6c28aabb73f5c3b03acbc" + dependencies: + debug "^2.6.8" + handle-thing "^1.2.5" + http-deceiver "^1.2.7" + safe-buffer "^5.0.1" + select-hose "^2.0.0" + spdy-transport "^2.0.18" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + dependencies: + extend-shallow "^3.0.0" + +split@0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + dependencies: + through "2" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.14.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + safer-buffer "^2.0.2" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + +statuses@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" + +stdout-stream@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/stdout-stream/-/stdout-stream-1.4.0.tgz#a2c7c8587e54d9427ea9edb3ac3f2cd522df378b" + dependencies: + readable-stream "^2.0.1" + +stream-browserify@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + dependencies: + duplexer "~0.1.1" + +stream-http@^2.7.2: + version "2.8.3" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.3.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + +string-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" + dependencies: + strip-ansi "^3.0.0" + +string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string.prototype.padend@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.4.3" + function-bind "^1.0.2" + +string_decoder@^1.0.0, string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +stringstream@~0.0.4: + version "0.0.6" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" + +strip-ansi@3.0.1, strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-bom@3.0.0, strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + dependencies: + get-stdin "^4.0.1" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +style-loader@0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.19.0.tgz#7258e788f0fee6a42d710eaf7d6c2412a4c50759" + dependencies: + loader-utils "^1.0.2" + schema-utils "^0.3.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.2, supports-color@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +supports-color@^4.2.1: + version "4.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" + dependencies: + has-flag "^2.0.0" + +supports-color@^5.3.0, supports-color@^5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + dependencies: + has-flag "^3.0.0" + +svgo@^0.7.0: + version "0.7.2" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" + dependencies: + coa "~1.0.1" + colors "~1.1.2" + csso "~2.3.1" + js-yaml "~3.7.0" + mkdirp "~0.5.1" + sax "~1.2.1" + whet.extend "~0.9.9" + +sw-precache-webpack-plugin@0.11.4: + version "0.11.4" + resolved "https://registry.yarnpkg.com/sw-precache-webpack-plugin/-/sw-precache-webpack-plugin-0.11.4.tgz#a695017e54eed575551493a519dc1da8da2dc5e0" + dependencies: + del "^2.2.2" + sw-precache "^5.1.1" + uglify-js "^3.0.13" + +sw-precache@^5.1.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/sw-precache/-/sw-precache-5.2.1.tgz#06134f319eec68f3b9583ce9a7036b1c119f7179" + dependencies: + dom-urls "^1.1.0" + es6-promise "^4.0.5" + glob "^7.1.1" + lodash.defaults "^4.2.0" + lodash.template "^4.4.0" + meow "^3.7.0" + mkdirp "^0.5.1" + pretty-bytes "^4.0.2" + sw-toolbox "^3.4.0" + update-notifier "^2.3.0" + +sw-toolbox@^3.4.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/sw-toolbox/-/sw-toolbox-3.6.0.tgz#26df1d1c70348658e4dea2884319149b7b3183b5" + dependencies: + path-to-regexp "^1.0.1" + serviceworker-cache-polyfill "^4.0.0" + +symbol-observable@^1.1.0, symbol-observable@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + +symbol-tree@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + +table@^4.0.1, table@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" + dependencies: + ajv "^6.0.1" + ajv-keywords "^3.0.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" + +tapable@^0.2.7: + version "0.2.8" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" + +tar@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + +tar@^4: + version "4.4.4" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.4.tgz#ec8409fae9f665a4355cc3b4087d0820232bb8cd" + dependencies: + chownr "^1.0.1" + fs-minipass "^1.2.5" + minipass "^2.3.3" + minizlib "^1.1.0" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +term-size@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" + dependencies: + execa "^0.7.0" + +test-exclude@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" + dependencies: + arrify "^1.0.1" + micromatch "^3.1.8" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +text-table@0.2.0, text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +theming@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/theming/-/theming-1.3.0.tgz#286d5bae80be890d0adc645e5ca0498723725bdc" + dependencies: + brcast "^3.0.1" + is-function "^1.0.1" + is-plain-object "^2.0.1" + prop-types "^15.5.8" + +throat@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.2.0.tgz#50cb0670edbc40237b9e347d7e1f88e4620af836" + +through@2, through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.1: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +thunky@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.0.2.tgz#a862e018e3fb1ea2ec3fce5d55605cf57f247371" + +time-stamp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-2.0.0.tgz#95c6a44530e15ba8d6f4a3ecb8c3a3fac46da357" + +timed-out@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + +timers-browserify@^2.0.4: + version "2.0.10" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" + dependencies: + setimmediate "^1.0.4" + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + dependencies: + os-tmpdir "~1.0.2" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +toposort@^1.0.0: + version "1.0.7" + resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029" + +tough-cookie@^2.3.2: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tough-cookie@~2.3.0, tough-cookie@~2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" + dependencies: + punycode "^1.4.1" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + +"traverse@>=0.3.0 <0.4": + version "0.3.9" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" + +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +"true-case-path@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-1.0.2.tgz#7ec91130924766c7f573be3020c34f8fdfd00d62" + dependencies: + glob "^6.0.4" + +tty-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +type-is@~1.6.15, type-is@~1.6.16: + version "1.6.16" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" + dependencies: + media-typer "0.3.0" + mime-types "~2.1.18" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +ua-parser-js@^0.7.18: + version "0.7.18" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" + +uglify-js@3.4.x, uglify-js@^3.0.13: + version "3.4.5" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.5.tgz#650889c0766cf0f6fd5346cea09cd212f544be69" + dependencies: + commander "~2.16.0" + source-map "~0.6.1" + +uglify-js@^2.6, uglify-js@^2.8.29: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +uglifyjs-webpack-plugin@^0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309" + dependencies: + source-map "^0.5.6" + uglify-js "^2.8.29" + webpack-sources "^1.0.1" + +underscore@~1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +uniq@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" + +uniqs@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" + +unique-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + dependencies: + crypto-random-string "^1.0.0" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + +unzipper@^0.8.11: + version "0.8.14" + resolved "https://registry.yarnpkg.com/unzipper/-/unzipper-0.8.14.tgz#ade0524cd2fc14d11b8de258be22f9d247d3f79b" + dependencies: + big-integer "^1.6.17" + binary "~0.3.0" + bluebird "~3.4.1" + buffer-indexof-polyfill "~1.0.0" + duplexer2 "~0.1.4" + fstream "~1.0.10" + listenercount "~1.0.1" + readable-stream "~2.1.5" + setimmediate "~1.0.4" + +upath@^1.0.5: + version "1.1.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + +update-notifier@^2.3.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" + dependencies: + boxen "^1.2.1" + chalk "^2.0.1" + configstore "^3.0.0" + import-lazy "^2.1.0" + is-ci "^1.0.10" + is-installed-globally "^0.1.0" + is-npm "^1.0.0" + latest-version "^3.0.0" + semver-diff "^2.0.0" + xdg-basedir "^3.0.0" + +upper-case@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" + +uri-js@^4.2.1: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + dependencies: + punycode "^2.1.0" + +urijs@^1.16.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/urijs/-/urijs-1.19.1.tgz#5b0ff530c0cbde8386f6342235ba5ca6e995d25a" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + +url-loader@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-0.6.2.tgz#a007a7109620e9d988d14bce677a1decb9a993f7" + dependencies: + loader-utils "^1.0.2" + mime "^1.4.1" + schema-utils "^0.3.0" + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + dependencies: + prepend-http "^1.0.1" + +url-parse@^1.1.8, url-parse@~1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.1.tgz#4dec9dad3dc8585f862fed461d2e19bbf623df30" + dependencies: + querystringify "^2.0.0" + requires-port "^1.0.0" + +url-template@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" + +url-to-options@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + dependencies: + inherits "2.0.1" + +util@^0.10.3: + version "0.10.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" + dependencies: + inherits "2.0.3" + +utila@~0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/utila/-/utila-0.3.3.tgz#d7e8e7d7e309107092b05f8d9688824d633a4226" + +utila@~0.4: + version "0.4.0" + resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + +uuid@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" + +uuid@^3.0.0, uuid@^3.1.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + +validate-npm-package-license@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +value-equal@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7" + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + +vendors@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.2.tgz#7fcb5eef9f5623b156bcea89ec37d63676f21801" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +vm-browserify@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + dependencies: + indexof "0.0.1" + +void-elements@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" + +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +warning@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c" + dependencies: + loose-envify "^1.0.0" + +warning@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.1.tgz#66ce376b7fbfe8a887c22bdf0e7349d73d397745" + dependencies: + loose-envify "^1.0.0" + +watch@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" + +watchpack@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" + dependencies: + chokidar "^2.0.2" + graceful-fs "^4.1.2" + neo-async "^2.5.0" + +wbuf@^1.1.0, wbuf@^1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" + dependencies: + minimalistic-assert "^1.0.0" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + +webidl-conversions@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + +webpack-dev-middleware@^1.11.0: + version "1.12.2" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz#f8fc1120ce3b4fc5680ceecb43d777966b21105e" + dependencies: + memory-fs "~0.4.1" + mime "^1.5.0" + path-is-absolute "^1.0.0" + range-parser "^1.0.3" + time-stamp "^2.0.0" + +webpack-dev-server@2.9.4: + version "2.9.4" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.9.4.tgz#7883e61759c6a4b33e9b19ec4037bd4ab61428d1" + dependencies: + ansi-html "0.0.7" + array-includes "^3.0.3" + bonjour "^3.5.0" + chokidar "^1.6.0" + compression "^1.5.2" + connect-history-api-fallback "^1.3.0" + debug "^3.1.0" + del "^3.0.0" + express "^4.13.3" + html-entities "^1.2.0" + http-proxy-middleware "~0.17.4" + import-local "^0.1.1" + internal-ip "1.2.0" + ip "^1.1.5" + killable "^1.0.0" + loglevel "^1.4.1" + opn "^5.1.0" + portfinder "^1.0.9" + selfsigned "^1.9.1" + serve-index "^1.7.2" + sockjs "0.3.18" + sockjs-client "1.1.4" + spdy "^3.4.1" + strip-ansi "^3.0.1" + supports-color "^4.2.1" + webpack-dev-middleware "^1.11.0" + yargs "^6.6.0" + +webpack-manifest-plugin@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/webpack-manifest-plugin/-/webpack-manifest-plugin-1.3.2.tgz#5ea8ee5756359ddc1d98814324fe43496349a7d4" + dependencies: + fs-extra "^0.30.0" + lodash ">=3.5 <5" + +webpack-sources@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54" + dependencies: + source-list-map "^2.0.0" + source-map "~0.6.1" + +webpack@3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.8.1.tgz#b16968a81100abe61608b0153c9159ef8bb2bd83" + dependencies: + acorn "^5.0.0" + acorn-dynamic-import "^2.0.0" + ajv "^5.1.5" + ajv-keywords "^2.0.0" + async "^2.1.2" + enhanced-resolve "^3.4.0" + escope "^3.6.0" + interpret "^1.0.0" + json-loader "^0.5.4" + json5 "^0.5.1" + loader-runner "^2.3.0" + loader-utils "^1.1.0" + memory-fs "~0.4.1" + mkdirp "~0.5.0" + node-libs-browser "^2.0.0" + source-map "^0.5.3" + supports-color "^4.2.1" + tapable "^0.2.7" + uglifyjs-webpack-plugin "^0.4.6" + watchpack "^1.4.0" + webpack-sources "^1.0.1" + yargs "^8.0.2" + +websocket-driver@>=0.5.1: + version "0.7.0" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.0.tgz#0caf9d2d755d93aee049d4bdd0d3fe2cca2a24eb" + dependencies: + http-parser-js ">=0.4.0" + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" + +whatwg-encoding@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3" + dependencies: + iconv-lite "0.4.19" + +whatwg-fetch@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" + +whatwg-fetch@>=0.10.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" + +whatwg-url@^4.3.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.8.0.tgz#d2981aa9148c1e00a41c5a6131166ab4683bbcc0" + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +whet.extend@~0.9.9: + version "0.9.9" + resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@1, which@^1.2.12, which@^1.2.14, which@^1.2.9, which@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + +widest-line@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.0.tgz#0142a4e8a243f8882c0233aa0e0281aa76152273" + dependencies: + string-width "^2.1.1" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +window-size@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +worker-farm@^1.3.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" + dependencies: + errno "~0.1.7" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +xdg-basedir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" + +xml-name-validator@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" + +xml@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" + +xtend@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" + +yargs-parser@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" + dependencies: + camelcase "^3.0.0" + lodash.assign "^4.0.6" + +yargs-parser@^4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" + dependencies: + camelcase "^3.0.0" + +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + dependencies: + camelcase "^3.0.0" + +yargs-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" + dependencies: + camelcase "^4.1.0" + +yargs@^4.2.0: + version "4.8.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" + dependencies: + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + lodash.assign "^4.0.3" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.1" + which-module "^1.0.0" + window-size "^0.2.0" + y18n "^3.2.1" + yargs-parser "^2.4.1" + +yargs@^6.6.0: + version "6.6.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^4.2.0" + +yargs@^7.0.0, yargs@^7.0.2: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" + +yargs@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" + dependencies: + camelcase "^4.1.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + read-pkg-up "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^7.0.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" diff --git a/scm-webapp/pom.xml b/scm-webapp/pom.xml index 02ab72b99b..b1e46c2e37 100644 --- a/scm-webapp/pom.xml +++ b/scm-webapp/pom.xml @@ -320,7 +320,6 @@ com.github.sdorra shiro-unit - 1.0.0 test diff --git a/scm-webapp/src/main/java/sonia/scm/ScmServletModule.java b/scm-webapp/src/main/java/sonia/scm/ScmServletModule.java index 0938b8a02a..1d318ce1c8 100644 --- a/scm-webapp/src/main/java/sonia/scm/ScmServletModule.java +++ b/scm-webapp/src/main/java/sonia/scm/ScmServletModule.java @@ -38,7 +38,6 @@ package sonia.scm; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.inject.Provider; import com.google.inject.multibindings.Multibinder; -import com.google.inject.name.Names; import com.google.inject.servlet.RequestScoped; import com.google.inject.servlet.ServletModule; import com.google.inject.throwingproviders.ThrowingProviderBinder; @@ -57,16 +56,8 @@ import sonia.scm.group.xml.XmlGroupDAO; import sonia.scm.io.DefaultFileSystem; import sonia.scm.io.FileSystem; import sonia.scm.net.SSLContextProvider; -import sonia.scm.net.ahc.AdvancedHttpClient; -import sonia.scm.net.ahc.ContentTransformer; -import sonia.scm.net.ahc.DefaultAdvancedHttpClient; -import sonia.scm.net.ahc.JsonContentTransformer; -import sonia.scm.net.ahc.XmlContentTransformer; -import sonia.scm.plugin.DefaultPluginLoader; -import sonia.scm.plugin.DefaultPluginManager; -import sonia.scm.plugin.ExtensionProcessor; -import sonia.scm.plugin.PluginLoader; -import sonia.scm.plugin.PluginManager; +import sonia.scm.net.ahc.*; +import sonia.scm.plugin.*; import sonia.scm.repository.*; import sonia.scm.repository.api.HookContextFactory; import sonia.scm.repository.api.RepositoryServiceFactory; @@ -78,32 +69,12 @@ import sonia.scm.resources.ResourceManager; import sonia.scm.resources.ScriptResourceServlet; import sonia.scm.schedule.QuartzScheduler; import sonia.scm.schedule.Scheduler; -import sonia.scm.security.AuthorizationChangedEventProducer; -import sonia.scm.security.CipherHandler; -import sonia.scm.security.CipherUtil; -import sonia.scm.security.ConfigurableLoginAttemptHandler; -import sonia.scm.security.DefaultKeyGenerator; -import sonia.scm.security.DefaultSecuritySystem; -import sonia.scm.security.KeyGenerator; -import sonia.scm.security.LoginAttemptHandler; -import sonia.scm.security.SecuritySystem; -import sonia.scm.store.BlobStoreFactory; -import sonia.scm.store.ConfigurationEntryStoreFactory; -import sonia.scm.store.ConfigurationStoreFactory; -import sonia.scm.store.DataStoreFactory; -import sonia.scm.store.FileBlobStoreFactory; -import sonia.scm.store.JAXBConfigurationEntryStoreFactory; -import sonia.scm.store.JAXBConfigurationStoreFactory; -import sonia.scm.store.JAXBDataStoreFactory; +import sonia.scm.security.*; +import sonia.scm.store.*; import sonia.scm.template.MustacheTemplateEngine; import sonia.scm.template.TemplateEngine; import sonia.scm.template.TemplateEngineFactory; import sonia.scm.template.TemplateServlet; -import sonia.scm.url.RestJsonUrlProvider; -import sonia.scm.url.RestXmlUrlProvider; -import sonia.scm.url.UrlProvider; -import sonia.scm.url.UrlProviderFactory; -import sonia.scm.url.WebUIUrlProvider; import sonia.scm.user.DefaultUserManager; import sonia.scm.user.UserDAO; import sonia.scm.user.UserManager; @@ -223,7 +194,9 @@ public class ScmServletModule extends ServletModule ScmConfiguration config = getScmConfiguration(); CipherUtil cu = CipherUtil.getInstance(); - + + bind(NamespaceStrategy.class).toProvider(NamespaceStrategyProvider.class); + // bind repository provider ThrowingProviderBinder.create(binder()).bind( RepositoryProvider.class, Repository.class).to( @@ -303,17 +276,6 @@ public class ScmServletModule extends ServletModule bind(ResourceManager.class, DefaultResourceManager.class); } - // bind url provider staff - bind(UrlProvider.class).annotatedWith( - Names.named(UrlProviderFactory.TYPE_RESTAPI_JSON)).toProvider( - RestJsonUrlProvider.class); - bind(UrlProvider.class).annotatedWith( - Names.named(UrlProviderFactory.TYPE_RESTAPI_XML)).toProvider( - RestXmlUrlProvider.class); - bind(UrlProvider.class).annotatedWith( - Names.named(UrlProviderFactory.TYPE_WUI)).toProvider( - WebUIUrlProvider.class); - // bind repository service factory bind(RepositoryServiceFactory.class); @@ -351,10 +313,10 @@ public class ScmServletModule extends ServletModule // bind events // bind(LastModifiedUpdateListener.class); - Class namespaceStrategy = extensionProcessor.byExtensionPoint(NamespaceStrategy.class).iterator().next(); - bind(NamespaceStrategy.class, namespaceStrategy); + } + /** * Method description * diff --git a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/AbstractManagerResource.java b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/AbstractManagerResource.java index b8a3dfc45d..27ceb03a36 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/AbstractManagerResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/AbstractManagerResource.java @@ -48,13 +48,8 @@ import sonia.scm.util.AssertUtil; import sonia.scm.util.HttpUtil; import sonia.scm.util.Util; -import javax.ws.rs.core.CacheControl; -import javax.ws.rs.core.EntityTag; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.Request; -import javax.ws.rs.core.Response; +import javax.ws.rs.core.*; import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriInfo; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; diff --git a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/GroupResource.java b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/GroupResource.java index b9701f7e38..42816abd93 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/GroupResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/GroupResource.java @@ -47,22 +47,8 @@ import sonia.scm.group.GroupException; import sonia.scm.group.GroupManager; import sonia.scm.security.Role; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Request; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import javax.ws.rs.*; +import javax.ws.rs.core.*; import java.util.Collection; //~--- JDK imports ------------------------------------------------------------ diff --git a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/RepositoryImportResource.java b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/RepositoryImportResource.java index f336bbb6e7..1b25fc3f79 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/RepositoryImportResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/RepositoryImportResource.java @@ -50,15 +50,7 @@ import org.slf4j.LoggerFactory; import sonia.scm.NotSupportedFeatuerException; import sonia.scm.Type; import sonia.scm.api.rest.RestActionUploadResult; -import sonia.scm.repository.AdvancedImportHandler; -import sonia.scm.repository.ImportHandler; -import sonia.scm.repository.ImportResult; -import sonia.scm.repository.Repository; -import sonia.scm.repository.RepositoryAlreadyExistsException; -import sonia.scm.repository.RepositoryException; -import sonia.scm.repository.RepositoryHandler; -import sonia.scm.repository.RepositoryManager; -import sonia.scm.repository.RepositoryType; +import sonia.scm.repository.*; import sonia.scm.repository.api.Command; import sonia.scm.repository.api.RepositoryService; import sonia.scm.repository.api.RepositoryServiceFactory; @@ -66,21 +58,8 @@ import sonia.scm.repository.api.UnbundleCommandBuilder; import sonia.scm.security.Role; import sonia.scm.util.IOUtil; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.FormParam; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import javax.ws.rs.*; +import javax.ws.rs.core.*; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -543,7 +522,8 @@ public class RepositoryImportResource try { - repository = new Repository(null, type, name); + // TODO #8783 +// repository = new Repository(null, type, name); manager.create(repository); } catch (RepositoryAlreadyExistsException ex) @@ -738,7 +718,8 @@ public class RepositoryImportResource { for (String repositoryName : repositoryNames) { - Repository repository = manager.get(type, repositoryName); + // TODO #8783 + /*Repository repository = null; //manager.get(type, repositoryName); if (repository != null) { @@ -748,7 +729,7 @@ public class RepositoryImportResource { logger.warn("could not find imported repository {}", repositoryName); - } + }*/ } } } diff --git a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/RepositoryResource.java b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/RepositoryResource.java index 6fc8b9ef48..9b9688332f 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/RepositoryResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/RepositoryResource.java @@ -46,51 +46,16 @@ import org.apache.shiro.SecurityUtils; import org.apache.shiro.authz.AuthorizationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sonia.scm.repository.BlameResult; -import sonia.scm.repository.Branches; -import sonia.scm.repository.BrowserResult; -import sonia.scm.repository.Changeset; -import sonia.scm.repository.ChangesetPagingResult; -import sonia.scm.repository.HealthChecker; -import sonia.scm.repository.Permission; -import sonia.scm.repository.Repository; -import sonia.scm.repository.RepositoryException; -import sonia.scm.repository.RepositoryIsNotArchivedException; -import sonia.scm.repository.RepositoryManager; -import sonia.scm.repository.RepositoryNotFoundException; -import sonia.scm.repository.Tags; -import sonia.scm.repository.api.BlameCommandBuilder; -import sonia.scm.repository.api.BrowseCommandBuilder; -import sonia.scm.repository.api.CatCommandBuilder; -import sonia.scm.repository.api.CommandNotSupportedException; -import sonia.scm.repository.api.DiffCommandBuilder; -import sonia.scm.repository.api.DiffFormat; -import sonia.scm.repository.api.LogCommandBuilder; -import sonia.scm.repository.api.RepositoryService; -import sonia.scm.repository.api.RepositoryServiceFactory; +import sonia.scm.repository.*; +import sonia.scm.repository.api.*; import sonia.scm.util.AssertUtil; import sonia.scm.util.HttpUtil; import sonia.scm.util.IOUtil; import sonia.scm.util.Util; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Request; -import javax.ws.rs.core.Response; +import javax.ws.rs.*; +import javax.ws.rs.core.*; import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.StreamingOutput; -import javax.ws.rs.core.UriInfo; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -556,42 +521,6 @@ public class RepositoryResource extends AbstractManagerResource unsortedRepositories = Collections2.transform( Collections2.filter( repositoryManager.getAll(), new RepositoryTypePredicate(type)) - , new RepositoryTransformFunction(uiUrlProvider, baseUrl) + , new RepositoryTransformFunction(baseUrl) ); List repositories = Ordering.from( @@ -149,43 +143,16 @@ public class RepositoryRootResource * * * @param repository - * @param uiUrlProvider * @param baseUrl */ - public RepositoryTemplateElement(Repository repository, - UrlProvider uiUrlProvider, String baseUrl) + public RepositoryTemplateElement(Repository repository, String baseUrl) { this.repository = repository; - this.urlProvider = uiUrlProvider; this.baseUrl = baseUrl; } //~--- get methods -------------------------------------------------------- - /** - * Method description - * - * - * @return - */ - public String getCommitUrl() - { - return urlProvider.getRepositoryUrlProvider().getChangesetUrl( - repository.getId(), 0, 20); - } - - /** - * Method description - * - * - * @return - */ - public String getDetailUrl() - { - return urlProvider.getRepositoryUrlProvider().getDetailUrl( - repository.getId()); - } - /** * Method description * @@ -208,18 +175,6 @@ public class RepositoryRootResource return repository; } - /** - * Method description - * - * - * @return - */ - public String getSourceUrl() - { - return urlProvider.getRepositoryUrlProvider().getBrowseUrl( - repository.getId(), null, null); - } - /** * Method description * @@ -239,8 +194,6 @@ public class RepositoryRootResource /** Field description */ private Repository repository; - /** Field description */ - private UrlProvider urlProvider; } @@ -284,20 +237,8 @@ public class RepositoryRootResource implements Function { - /** - * Constructs ... - * - * - * - * - * @param request - * @param repositoryManager - * @param urlProvider - * @param baseUrl - */ - public RepositoryTransformFunction(UrlProvider urlProvider, String baseUrl) + public RepositoryTransformFunction(String baseUrl) { - this.urlProvider = urlProvider; this.baseUrl = baseUrl; } @@ -314,15 +255,12 @@ public class RepositoryRootResource @Override public RepositoryTemplateElement apply(Repository repository) { - return new RepositoryTemplateElement(repository, urlProvider, baseUrl); + return new RepositoryTemplateElement(repository, baseUrl); } //~--- fields ------------------------------------------------------------- /** Field description */ private String baseUrl; - - /** Field description */ - private UrlProvider urlProvider; } } diff --git a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/UserResource.java b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/UserResource.java index f9dc40f0fc..8328230672 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/UserResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/UserResource.java @@ -50,21 +50,8 @@ import sonia.scm.user.UserManager; import sonia.scm.util.AssertUtil; import sonia.scm.util.Util; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Request; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import javax.ws.rs.*; +import javax.ws.rs.core.*; import java.util.Collection; //~--- JDK imports ------------------------------------------------------------ diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationRequestDto.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationRequestDto.java new file mode 100644 index 0000000000..3b9f6e5c18 --- /dev/null +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationRequestDto.java @@ -0,0 +1,51 @@ +package sonia.scm.api.v2.resources; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.Strings; + +import javax.ws.rs.FormParam; +import java.util.List; + +public class AuthenticationRequestDto { + + @FormParam("grant_type") + @JsonProperty("grant_type") + private String grantType; + + @FormParam("username") + private String username; + + @FormParam("password") + private String password; + + @FormParam("cookie") + private boolean cookie; + + @FormParam("scope") + private List scope; + + public String getGrantType() { + return grantType; + } + + public String getUsername() { + return username; + } + + public String getPassword() { + return password; + } + + public boolean isCookie() { + return cookie; + } + + public List getScope() { + return scope; + } + + public boolean isValid() { + // password is currently the only valid grant_type + return "password".equals(grantType) && !Strings.isNullOrEmpty(username) && !Strings.isNullOrEmpty(password); + } +} diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationResource.java new file mode 100644 index 0000000000..ffe0ce51d0 --- /dev/null +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationResource.java @@ -0,0 +1,140 @@ +package sonia.scm.api.v2.resources; + +import com.google.inject.Inject; +import com.webcohesion.enunciate.metadata.rs.ResponseCode; +import com.webcohesion.enunciate.metadata.rs.StatusCodes; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authc.AuthenticationException; +import org.apache.shiro.subject.Subject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import sonia.scm.security.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path(AuthenticationResource.PATH) +public class AuthenticationResource { + + private static final Logger LOG = LoggerFactory.getLogger(AuthenticationResource.class); + + static final String PATH = "v2/auth"; + + private final AccessTokenBuilderFactory tokenBuilderFactory; + private final AccessTokenCookieIssuer cookieIssuer; + + @Inject + public AuthenticationResource(AccessTokenBuilderFactory tokenBuilderFactory, AccessTokenCookieIssuer cookieIssuer) + { + this.tokenBuilderFactory = tokenBuilderFactory; + this.cookieIssuer = cookieIssuer; + } + + + @POST + @Path("access_token") + @Consumes(MediaType.APPLICATION_FORM_URLENCODED) + @StatusCodes({ + @ResponseCode(code = 200, condition = "success"), + @ResponseCode(code = 400, condition = "bad request, required parameter is missing"), + @ResponseCode(code = 401, condition = "unauthorized, the specified username or password is wrong"), + @ResponseCode(code = 500, condition = "internal server error") + }) + public Response authenticateViaForm( + @Context HttpServletRequest request, + @Context HttpServletResponse response, + @BeanParam AuthenticationRequestDto authentication + ) { + return authenticate(request, response, authentication); + } + + @POST + @Path("access_token") + @Consumes(MediaType.APPLICATION_JSON) + @StatusCodes({ + @ResponseCode(code = 200, condition = "success"), + @ResponseCode(code = 400, condition = "bad request, required parameter is missing"), + @ResponseCode(code = 401, condition = "unauthorized, the specified username or password is wrong"), + @ResponseCode(code = 500, condition = "internal server error") + }) + public Response authenticateViaJSONBody( + @Context HttpServletRequest request, + @Context HttpServletResponse response, + AuthenticationRequestDto authentication + ) { + return authenticate(request, response, authentication); + } + + private Response authenticate( + HttpServletRequest request, + HttpServletResponse response, + AuthenticationRequestDto authentication + ) { + if (!authentication.isValid()) { + return Response.status(Response.Status.BAD_REQUEST).build(); + } + + Response res; + Subject subject = SecurityUtils.getSubject(); + + try + { + subject.login(Tokens.createAuthenticationToken(request, authentication.getUsername(), authentication.getPassword())); + + AccessTokenBuilder tokenBuilder = tokenBuilderFactory.create(); + if ( authentication.getScope() != null ) { + tokenBuilder.scope(Scope.valueOf(authentication.getScope())); + } + + AccessToken token = tokenBuilder.build(); + + if (authentication.isCookie()) { + cookieIssuer.authenticate(request, response, token); + res = Response.noContent().build(); + } else { + res = Response.ok( token.compact() ).build(); + } + } + catch (AuthenticationException ex) + { + if (LOG.isTraceEnabled()) + { + LOG.trace("authentication failed for user ".concat(authentication.getUsername()), ex); + } + else + { + LOG.warn("authentication failed for user {}", authentication.getUsername()); + } + + // TODO DisabledAccountException, ExcessiveAttemptsException for ui? + + return Response.status(Response.Status.UNAUTHORIZED).build(); + } + + return res; + } + + @DELETE + @Path("access_token") + @StatusCodes({ + @ResponseCode(code = 204, condition = "success"), + @ResponseCode(code = 500, condition = "internal server error") + }) + public Response logout(@Context HttpServletRequest request, @Context HttpServletResponse response) + { + Subject subject = SecurityUtils.getSubject(); + + subject.logout(); + + // remove authentication cookie + cookieIssuer.invalidate(request, response); + + // TODO anonymous access ?? + return Response.noContent().build(); + } + +} diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ConfigDto.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ConfigDto.java new file mode 100644 index 0000000000..13d9ff5351 --- /dev/null +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ConfigDto.java @@ -0,0 +1,42 @@ +package sonia.scm.api.v2.resources; + +import de.otto.edison.hal.HalRepresentation; +import de.otto.edison.hal.Links; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.Set; + +@NoArgsConstructor +@Getter +@Setter +public class ConfigDto extends HalRepresentation { + + private String proxyPassword; + private int proxyPort; + private String proxyServer; + private String proxyUser; + private boolean enableProxy; + private String realmDescription; + private boolean enableRepositoryArchive; + private boolean disableGroupingGrid; + private String dateFormat; + private boolean anonymousAccessEnabled; + private Set adminGroups; + private Set adminUsers; + private String baseUrl; + private boolean forceBaseUrl; + private int loginAttemptLimit; + private Set proxyExcludes; + private boolean skipFailedAuthenticators; + private String pluginUrl; + private long loginAttemptLimitTimeout; + private boolean enabledXsrfProtection; + + @Override + @SuppressWarnings("squid:S1185") // We want to have this method available in this package + protected HalRepresentation add(Links links) { + return super.add(links); + } +} diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ConfigDtoToScmConfigurationMapper.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ConfigDtoToScmConfigurationMapper.java new file mode 100644 index 0000000000..b26d22232d --- /dev/null +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ConfigDtoToScmConfigurationMapper.java @@ -0,0 +1,12 @@ +package sonia.scm.api.v2.resources; + +import org.mapstruct.Mapper; +import sonia.scm.config.ScmConfiguration; + +// Mapstruct does not support parameterized (i.e. non-default) constructors. Thus, we need to use field injection. +@SuppressWarnings("squid:S3306") +@Mapper +public abstract class ConfigDtoToScmConfigurationMapper { + + public abstract ScmConfiguration map(ConfigDto dto); +} diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ConfigResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ConfigResource.java new file mode 100644 index 0000000000..bf3da19416 --- /dev/null +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ConfigResource.java @@ -0,0 +1,87 @@ +package sonia.scm.api.v2.resources; + +import com.webcohesion.enunciate.metadata.rs.ResponseCode; +import com.webcohesion.enunciate.metadata.rs.StatusCodes; +import com.webcohesion.enunciate.metadata.rs.TypeHint; +import sonia.scm.config.ConfigurationPermissions; +import sonia.scm.config.ScmConfiguration; +import sonia.scm.util.ScmConfigurationUtil; +import sonia.scm.web.VndMediaType; + +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +@Path(ConfigResource.CONFIG_PATH_V2) +public class ConfigResource { + + static final String CONFIG_PATH_V2 = "v2/config"; + private final ConfigDtoToScmConfigurationMapper dtoToConfigMapper; + private final ScmConfigurationToConfigDtoMapper configToDtoMapper; + private final ScmConfiguration configuration; + + @Inject + public ConfigResource(ConfigDtoToScmConfigurationMapper dtoToConfigMapper, ScmConfigurationToConfigDtoMapper configToDtoMapper, ScmConfiguration configuration) { + this.dtoToConfigMapper = dtoToConfigMapper; + this.configToDtoMapper = configToDtoMapper; + this.configuration = configuration; + } + + /** + * Returns the global scm config. + */ + @GET + @Path("") + @Produces(VndMediaType.CONFIG) + @TypeHint(UserDto.class) + @StatusCodes({ + @ResponseCode(code = 200, condition = "success"), + @ResponseCode(code = 401, condition = "not authenticated / invalid credentials"), + @ResponseCode(code = 403, condition = "not authorized, the current user has no privileges to read the global config"), + @ResponseCode(code = 500, condition = "internal server error") + }) + public Response get() { + + // We do this permission check in Resource and not in ScmConfiguration, because it must be available for reading + // from within the code (plugins, etc.), but not for the whole anonymous world outside. + ConfigurationPermissions.read(configuration).check(); + + return Response.ok(configToDtoMapper.map(configuration)).build(); + } + + /** + * Modifies the global scm config. + * + * @param configDto new global scm configuration as DTO + */ + @PUT + @Path("") + @Consumes(VndMediaType.CONFIG) + @StatusCodes({ + @ResponseCode(code = 201, condition = "update success"), + @ResponseCode(code = 401, condition = "not authenticated / invalid credentials"), + @ResponseCode(code = 403, condition = "not authorized, the current user has no privileges to update the global config"), + @ResponseCode(code = 500, condition = "internal server error") + }) + @TypeHint(TypeHint.NO_CONTENT.class) + public Response update(ConfigDto configDto, @Context UriInfo uriInfo) { + + // This *could* be moved to ScmConfiguration or ScmConfigurationUtil classes. + // But to where to check? load() or store()? Leave it for now, SCMv1 legacy that can be cleaned up later. + ConfigurationPermissions.write(configuration).check(); + + ScmConfiguration config = dtoToConfigMapper.map(configDto); + synchronized (ScmConfiguration.class) { + configuration.load(config); + ScmConfigurationUtil.getInstance().store(configuration); + } + + return Response.noContent().build(); + } +} diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/GroupCollectionResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/GroupCollectionResource.java index d806d3cee7..0f68894a64 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/GroupCollectionResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/GroupCollectionResource.java @@ -1,23 +1,13 @@ package sonia.scm.api.v2.resources; -import com.webcohesion.enunciate.metadata.rs.ResponseCode; -import com.webcohesion.enunciate.metadata.rs.ResponseHeader; -import com.webcohesion.enunciate.metadata.rs.ResponseHeaders; -import com.webcohesion.enunciate.metadata.rs.StatusCodes; -import com.webcohesion.enunciate.metadata.rs.TypeHint; +import com.webcohesion.enunciate.metadata.rs.*; import sonia.scm.group.Group; import sonia.scm.group.GroupException; import sonia.scm.group.GroupManager; import sonia.scm.web.VndMediaType; import javax.inject.Inject; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.io.IOException; diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/GroupResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/GroupResource.java index c9f066790b..10818ec953 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/GroupResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/GroupResource.java @@ -9,13 +9,7 @@ import sonia.scm.group.GroupManager; import sonia.scm.web.VndMediaType; import javax.inject.Inject; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Response; public class GroupResource { diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MapperModule.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MapperModule.java index 8e22755fe0..69430bf43b 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MapperModule.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MapperModule.java @@ -15,6 +15,9 @@ public class MapperModule extends AbstractModule { bind(GroupToGroupDtoMapper.class).to(Mappers.getMapper(GroupToGroupDtoMapper.class).getClass()); bind(GroupCollectionToDtoMapper.class); + bind(ScmConfigurationToConfigDtoMapper.class).to(Mappers.getMapper(ScmConfigurationToConfigDtoMapper.class).getClass()); + bind(ConfigDtoToScmConfigurationMapper.class).to(Mappers.getMapper(ConfigDtoToScmConfigurationMapper.class).getClass()); + bind(RepositoryToRepositoryDtoMapper.class).to(Mappers.getMapper(RepositoryToRepositoryDtoMapper.class).getClass()); bind(RepositoryDtoToRepositoryMapper.class).to(Mappers.getMapper(RepositoryDtoToRepositoryMapper.class).getClass()); diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MeResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MeResource.java new file mode 100644 index 0000000000..50025d3cdb --- /dev/null +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MeResource.java @@ -0,0 +1,52 @@ +package sonia.scm.api.v2.resources; + +import com.webcohesion.enunciate.metadata.rs.ResponseCode; +import com.webcohesion.enunciate.metadata.rs.StatusCodes; +import com.webcohesion.enunciate.metadata.rs.TypeHint; +import org.apache.shiro.SecurityUtils; +import sonia.scm.user.User; +import sonia.scm.user.UserException; +import sonia.scm.user.UserManager; +import sonia.scm.web.VndMediaType; + +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Request; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + + +@Path(MeResource.ME_PATH_V2) +public class MeResource { + static final String ME_PATH_V2 = "v2/me/"; + + private final UserToUserDtoMapper userToDtoMapper; + + private final IdResourceManagerAdapter adapter; + @Inject + public MeResource(UserToUserDtoMapper userToDtoMapper, UserManager manager) { + this.userToDtoMapper = userToDtoMapper; + this.adapter = new IdResourceManagerAdapter<>(manager, User.class); + } + + /** + * Returns the currently logged in user or a 401 if user is not logged in + */ + @GET + @Path("") + @Produces(VndMediaType.USER) + @TypeHint(UserDto.class) + @StatusCodes({ + @ResponseCode(code = 200, condition = "success"), + @ResponseCode(code = 401, condition = "not authenticated / invalid credentials"), + @ResponseCode(code = 500, condition = "internal server error") + }) + public Response get(@Context Request request, @Context UriInfo uriInfo) { + + String id = (String) SecurityUtils.getSubject().getPrincipals().getPrimaryPrincipal(); + return adapter.get(id, userToDtoMapper::map); + } +} diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryCollectionResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryCollectionResource.java index 7112e7113b..7a70957b91 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryCollectionResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryCollectionResource.java @@ -1,23 +1,13 @@ package sonia.scm.api.v2.resources; -import com.webcohesion.enunciate.metadata.rs.ResponseCode; -import com.webcohesion.enunciate.metadata.rs.ResponseHeader; -import com.webcohesion.enunciate.metadata.rs.ResponseHeaders; -import com.webcohesion.enunciate.metadata.rs.StatusCodes; -import com.webcohesion.enunciate.metadata.rs.TypeHint; +import com.webcohesion.enunciate.metadata.rs.*; import sonia.scm.repository.Repository; import sonia.scm.repository.RepositoryException; import sonia.scm.repository.RepositoryManager; import sonia.scm.web.VndMediaType; import javax.inject.Inject; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Response; public class RepositoryCollectionResource { diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryDtoToRepositoryMapper.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryDtoToRepositoryMapper.java index 2c02bb8180..61e953602f 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryDtoToRepositoryMapper.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryDtoToRepositoryMapper.java @@ -1,10 +1,6 @@ package sonia.scm.api.v2.resources; -import org.mapstruct.AfterMapping; -import org.mapstruct.Context; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.MappingTarget; +import org.mapstruct.*; import sonia.scm.repository.Repository; @Mapper diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryResource.java index 5972508c78..34896149c3 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryResource.java @@ -10,13 +10,7 @@ import sonia.scm.web.VndMediaType; import javax.inject.Inject; import javax.inject.Provider; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.util.Optional; import java.util.function.Predicate; diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ResourceLinks.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ResourceLinks.java index 8f6f1eaae3..d02747d2af 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ResourceLinks.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ResourceLinks.java @@ -76,7 +76,7 @@ class ResourceLinks { return userLinkBuilder.method("getUserResource").parameters(name).method("delete").parameters().href(); } - String update(String name) { + String update(String name) { return userLinkBuilder.method("getUserResource").parameters(name).method("update").parameters().href(); } } @@ -101,6 +101,26 @@ class ResourceLinks { } } + ConfigLinks config() { + return new ConfigLinks(uriInfoStore.get()); + } + + static class ConfigLinks { + private final LinkBuilder configLinkBuilder; + + ConfigLinks(UriInfo uriInfo) { + configLinkBuilder = new LinkBuilder(uriInfo, ConfigResource.class); + } + + String self() { + return configLinkBuilder.method("get").parameters().href(); + } + + String update() { + return configLinkBuilder.method("update").parameters().href(); + } + } + public RepositoryLinks repository() { return new RepositoryLinks(uriInfoStore.get()); } diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ScmConfigurationToConfigDtoMapper.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ScmConfigurationToConfigDtoMapper.java new file mode 100644 index 0000000000..59e56feb11 --- /dev/null +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/ScmConfigurationToConfigDtoMapper.java @@ -0,0 +1,34 @@ +package sonia.scm.api.v2.resources; + +import de.otto.edison.hal.Links; +import org.mapstruct.AfterMapping; +import org.mapstruct.Mapper; +import org.mapstruct.MappingTarget; +import sonia.scm.config.ConfigurationPermissions; +import sonia.scm.config.ScmConfiguration; + +import javax.inject.Inject; + +import static de.otto.edison.hal.Link.link; +import static de.otto.edison.hal.Links.linkingTo; + +// Mapstruct does not support parameterized (i.e. non-default) constructors. Thus, we need to use field injection. +@SuppressWarnings("squid:S3306") +@Mapper +public abstract class ScmConfigurationToConfigDtoMapper { + + @Inject + private ResourceLinks resourceLinks; + + public abstract ConfigDto map(ScmConfiguration config); + + @AfterMapping + void appendLinks(ScmConfiguration config, @MappingTarget ConfigDto target) { + Links.Builder linksBuilder = linkingTo().self(resourceLinks.config().self()); + if (ConfigurationPermissions.write(config).isPermitted()) { + linksBuilder.single(link("update", resourceLinks.config().update())); + } + target.add(linksBuilder.build()); + } + +} diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserCollectionResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserCollectionResource.java index 578361424c..ef826980b3 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserCollectionResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserCollectionResource.java @@ -1,23 +1,13 @@ package sonia.scm.api.v2.resources; -import com.webcohesion.enunciate.metadata.rs.ResponseCode; -import com.webcohesion.enunciate.metadata.rs.ResponseHeader; -import com.webcohesion.enunciate.metadata.rs.ResponseHeaders; -import com.webcohesion.enunciate.metadata.rs.StatusCodes; -import com.webcohesion.enunciate.metadata.rs.TypeHint; +import com.webcohesion.enunciate.metadata.rs.*; import sonia.scm.user.User; import sonia.scm.user.UserException; import sonia.scm.user.UserManager; import sonia.scm.web.VndMediaType; import javax.inject.Inject; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.io.IOException; diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserResource.java index 2dc070d815..f05c8165cb 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserResource.java @@ -9,13 +9,7 @@ import sonia.scm.user.UserManager; import sonia.scm.web.VndMediaType; import javax.inject.Inject; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Response; public class UserResource { diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserToUserDtoMapper.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserToUserDtoMapper.java index 85973bab75..00aba5a700 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserToUserDtoMapper.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/UserToUserDtoMapper.java @@ -1,5 +1,6 @@ package sonia.scm.api.v2.resources; +import com.google.common.annotations.VisibleForTesting; import de.otto.edison.hal.Links; import org.mapstruct.AfterMapping; import org.mapstruct.Mapper; @@ -21,6 +22,11 @@ public abstract class UserToUserDtoMapper extends BaseMapper { @Inject private ResourceLinks resourceLinks; + @VisibleForTesting + void setResourceLinks(ResourceLinks resourceLinks) { + this.resourceLinks = resourceLinks; + } + @AfterMapping void removePassword(@MappingTarget UserDto target) { target.setPassword(UserResource.DUMMY_PASSWORT); diff --git a/scm-webapp/src/main/java/sonia/scm/filter/AdminSecurityFilter.java b/scm-webapp/src/main/java/sonia/scm/filter/AdminSecurityFilter.java index 633f6aa3b5..a5455c6d21 100644 --- a/scm-webapp/src/main/java/sonia/scm/filter/AdminSecurityFilter.java +++ b/scm-webapp/src/main/java/sonia/scm/filter/AdminSecurityFilter.java @@ -49,6 +49,7 @@ import sonia.scm.security.Role; * * @author Sebastian Sdorra */ +// TODO before releasing v2, delete this filter (we use Permission objects now) @WebElement( value = Filters.PATTERN_CONFIG, morePatterns = { diff --git a/scm-webapp/src/main/java/sonia/scm/filter/SecurityFilter.java b/scm-webapp/src/main/java/sonia/scm/filter/SecurityFilter.java index e94b6a3aee..01967afd00 100644 --- a/scm-webapp/src/main/java/sonia/scm/filter/SecurityFilter.java +++ b/scm-webapp/src/main/java/sonia/scm/filter/SecurityFilter.java @@ -44,6 +44,7 @@ import org.apache.shiro.subject.Subject; import sonia.scm.Priority; import sonia.scm.SCMContext; import sonia.scm.config.ScmConfiguration; +import sonia.scm.security.SecurityRequests; import sonia.scm.web.filter.HttpFilter; import sonia.scm.web.filter.SecurityHttpServletRequestWrapper; @@ -69,45 +70,20 @@ public class SecurityFilter extends HttpFilter @VisibleForTesting static final String ATTRIBUTE_REMOTE_USER = "principal"; - /** Field description */ - public static final String URL_AUTHENTICATION = "/api/rest/auth"; + private final ScmConfiguration configuration; - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param configuration - */ @Inject public SecurityFilter(ScmConfiguration configuration) { this.configuration = configuration; } - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param request - * @param response - * @param chain - * - * @throws IOException - * @throws ServletException - */ @Override protected void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { - String uri = - request.getRequestURI().substring(request.getContextPath().length()); - - if (!uri.startsWith(URL_AUTHENTICATION)) + if (!SecurityRequests.isAuthenticationRequest(request)) { Subject subject = SecurityUtils.getSubject(); if (hasPermission(subject)) @@ -139,16 +115,6 @@ public class SecurityFilter extends HttpFilter } } - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param subject - * - * @return - */ protected boolean hasPermission(Subject subject) { return ((configuration != null) @@ -173,8 +139,4 @@ public class SecurityFilter extends HttpFilter return username; } - //~--- fields --------------------------------------------------------------- - - /** scm configuration */ - private final ScmConfiguration configuration; } diff --git a/scm-webapp/src/main/java/sonia/scm/group/DefaultGroupManager.java b/scm-webapp/src/main/java/sonia/scm/group/DefaultGroupManager.java index 4f39fd3196..f22a5519dc 100644 --- a/scm-webapp/src/main/java/sonia/scm/group/DefaultGroupManager.java +++ b/scm-webapp/src/main/java/sonia/scm/group/DefaultGroupManager.java @@ -52,12 +52,7 @@ import sonia.scm.util.CollectionAppender; import sonia.scm.util.Util; import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.LinkedList; -import java.util.List; +import java.util.*; //~--- JDK imports ------------------------------------------------------------ diff --git a/scm-webapp/src/main/java/sonia/scm/repository/DefaultNamespaceStrategy.java b/scm-webapp/src/main/java/sonia/scm/repository/DefaultNamespaceStrategy.java index ce6362ee9c..9cf2c8ab20 100644 --- a/scm-webapp/src/main/java/sonia/scm/repository/DefaultNamespaceStrategy.java +++ b/scm-webapp/src/main/java/sonia/scm/repository/DefaultNamespaceStrategy.java @@ -1,11 +1,17 @@ package sonia.scm.repository; +import org.apache.shiro.SecurityUtils; import sonia.scm.plugin.Extension; +/** + * The DefaultNamespaceStrategy returns the username of the currently logged in user as namespace. + * @since 2.0.0 + */ @Extension -public class DefaultNamespaceStrategy implements NamespaceStrategy{ +public class DefaultNamespaceStrategy implements NamespaceStrategy { + @Override public String getNamespace() { - return "42"; + return SecurityUtils.getSubject().getPrincipal().toString(); } } diff --git a/scm-webapp/src/main/java/sonia/scm/repository/DefaultRepositoryManager.java b/scm-webapp/src/main/java/sonia/scm/repository/DefaultRepositoryManager.java index 7a078ddfa5..6998893652 100644 --- a/scm-webapp/src/main/java/sonia/scm/repository/DefaultRepositoryManager.java +++ b/scm-webapp/src/main/java/sonia/scm/repository/DefaultRepositoryManager.java @@ -42,30 +42,14 @@ import com.google.inject.Singleton; import org.apache.shiro.concurrent.SubjectAwareExecutorService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sonia.scm.ArgumentIsInvalidException; -import sonia.scm.ConfigurationException; -import sonia.scm.HandlerEventType; -import sonia.scm.ManagerDaoAdapter; -import sonia.scm.SCMContextProvider; -import sonia.scm.Type; +import sonia.scm.*; import sonia.scm.config.ScmConfiguration; import sonia.scm.security.KeyGenerator; -import sonia.scm.util.AssertUtil; -import sonia.scm.util.CollectionAppender; -import sonia.scm.util.HttpUtil; -import sonia.scm.util.IOUtil; -import sonia.scm.util.Util; +import sonia.scm.util.*; import javax.servlet.http.HttpServletRequest; import java.io.IOException; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; @@ -126,7 +110,7 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { @Override - public void close() throws IOException { + public void close() { executorService.shutdown(); for (RepositoryHandler handler : handlerMap.values()) { @@ -177,40 +161,16 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { getHandler(toDelete).delete(toDelete); } - /** - * Method description - * - * - * @param repository - * - * @throws IOException - * @throws RepositoryException - */ @Override public void importRepository(Repository repository) throws RepositoryException, IOException { create(repository, false); } - /** - * Method description - * - * - * @param context - */ @Override public void init(SCMContextProvider context) { } - /** - * Method description - * - * - * @param repository - * - * @throws IOException - * @throws RepositoryException - */ @Override public void modify(Repository repository) throws RepositoryException { logger.info("modify repository {} of type {}", repository.getName(), repository.getType()); @@ -226,23 +186,13 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { ); } - /** - * Method description - * - * - * @param repository - * - * @throws IOException - * @throws RepositoryException - */ @Override public void refresh(Repository repository) throws RepositoryException { AssertUtil.assertIsNotNull(repository); RepositoryPermissions.read(repository).check(); - Repository fresh = repositoryDAO.get(repository.getType(), - repository.getName()); + Repository fresh = repositoryDAO.get(repository.getNamespaceAndName()); if (fresh != null) { fresh.copyProperties(repository); @@ -251,16 +201,7 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { } } - //~--- get methods ---------------------------------------------------------- - /** - * Method description - * - * - * @param id - * - * @return - */ @Override public Repository get(String id) { AssertUtil.assertIsNotEmpty(id); @@ -276,21 +217,13 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { return repository; } - /** - * Method description - * - * - * @param type - * @param name - * - * @return - */ @Override - public Repository get(String type, String name) { - AssertUtil.assertIsNotEmpty(type); - AssertUtil.assertIsNotEmpty(name); + public Repository get(NamespaceAndName namespaceAndName) { + AssertUtil.assertIsNotNull(namespaceAndName); + AssertUtil.assertIsNotEmpty(namespaceAndName.getNamespace()); + AssertUtil.assertIsNotEmpty(namespaceAndName.getName()); - Repository repository = repositoryDAO.get(type, name); + Repository repository = repositoryDAO.get(namespaceAndName); if (repository != null) { RepositoryPermissions.read(repository).check(); @@ -300,14 +233,6 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { return repository; } - /** - * Method description - * - * - * - * @param comparator - * @return - */ @Override public Collection getAll(Comparator comparator) { List repositories = Lists.newArrayList(); @@ -330,28 +255,12 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { return repositories; } - /** - * Method description - * - * - * @return - */ @Override public Collection getAll() { return getAll(null); } - /** - * Method description - * - * - * - * @param comparator - * @param start - * @param limit - * - * @return - */ + @Override public Collection getAll(Comparator comparator, int start, int limit) { @@ -369,26 +278,11 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { }, start, limit); } - /** - * Method description - * - * - * @param start - * @param limit - * - * @return - */ @Override public Collection getAll(int start, int limit) { return getAll(null, start, limit); } - /** - * Method description - * - * - * @return - */ @Override public Collection getConfiguredTypes() { List validTypes = Lists.newArrayList(); @@ -402,14 +296,6 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { return validTypes; } - /** - * Method description - * - * - * @param request - * - * @return - */ @Override public Repository getFromRequest(HttpServletRequest request) { AssertUtil.assertIsNotNull(request); @@ -417,17 +303,28 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { return getFromUri(HttpUtil.getStrippedURI(request)); } - /** - * Method description - * - * - * @param type - * @param uri - * - * @return - */ @Override - public Repository getFromTypeAndUri(String type, String uri) { + public Repository getFromUri(String uri) { + AssertUtil.assertIsNotEmpty(uri); + + if (uri.startsWith(HttpUtil.SEPARATOR_PATH)) { + uri = uri.substring(1); + } + + int typeSeparator = uri.indexOf(HttpUtil.SEPARATOR_PATH); + Repository repository = null; + + if (typeSeparator > 0) { + String type = uri.substring(0, typeSeparator); + + uri = uri.substring(typeSeparator + 1); + repository = getFromTypeAndUri(type, uri); + } + + return repository; + } + + private Repository getFromTypeAndUri(String type, String uri) { if (Strings.isNullOrEmpty(type)) { throw new ArgumentIsInvalidException("argument type is required"); } @@ -464,80 +361,21 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { return repository; } - /** - * Method description - * - * - * @param uri - * - * @return - */ - @Override - public Repository getFromUri(String uri) { - AssertUtil.assertIsNotEmpty(uri); - - if (uri.startsWith(HttpUtil.SEPARATOR_PATH)) { - uri = uri.substring(1); - } - - int typeSeperator = uri.indexOf(HttpUtil.SEPARATOR_PATH); - Repository repository = null; - - if (typeSeperator > 0) { - String type = uri.substring(0, typeSeperator); - - uri = uri.substring(typeSeperator + 1); - repository = getFromTypeAndUri(type, uri); - } - - return repository; - } - - /** - * Method description - * - * - * @param type - * - * @return - */ @Override public RepositoryHandler getHandler(String type) { return handlerMap.get(type); } - /** - * Method description - * - * - * @return - */ @Override public Long getLastModified() { return repositoryDAO.getLastModified(); } - /** - * Method description - * - * - * @return - */ @Override public Collection getTypes() { return types; } - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * - * @param contextProvider - * @param handler - */ private void addHandler(SCMContextProvider contextProvider, RepositoryHandler handler) { AssertUtil.assertIsNotNull(handler); @@ -561,19 +399,6 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager { types.add(type); } - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param repository - * - * @return - * - * - * @throws RepositoryException - */ private RepositoryHandler getHandler(Repository repository) throws RepositoryException { String type = repository.getType(); diff --git a/scm-webapp/src/main/java/sonia/scm/repository/LastModifiedUpdateListener.java b/scm-webapp/src/main/java/sonia/scm/repository/LastModifiedUpdateListener.java index bf868b2027..a84324cd60 100644 --- a/scm-webapp/src/main/java/sonia/scm/repository/LastModifiedUpdateListener.java +++ b/scm-webapp/src/main/java/sonia/scm/repository/LastModifiedUpdateListener.java @@ -33,7 +33,7 @@ package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- -import com.google.common.eventbus.Subscribe; +import com.github.legman.Subscribe; import com.google.inject.Inject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/scm-webapp/src/main/java/sonia/scm/repository/RepositoryMatcher.java b/scm-webapp/src/main/java/sonia/scm/repository/RepositoryMatcher.java index d0ad30e84f..8cb3871047 100644 --- a/scm-webapp/src/main/java/sonia/scm/repository/RepositoryMatcher.java +++ b/scm-webapp/src/main/java/sonia/scm/repository/RepositoryMatcher.java @@ -32,14 +32,15 @@ package sonia.scm.repository; -import com.google.common.collect.Maps; -import java.util.Map; -import java.util.Set; -import javax.inject.Inject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import sonia.scm.util.HttpUtil; -import sonia.scm.util.Util; + import com.google.common.collect.Maps; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + import sonia.scm.util.HttpUtil; + import sonia.scm.util.Util; + + import javax.inject.Inject; + import java.util.Map; + import java.util.Set; /** * RepositoryMatcher is able to check if a repository matches the requested path. @@ -83,9 +84,24 @@ public final class RepositoryMatcher { } private boolean isPathMatching(Repository repository, String path) { - return getPathMatcherForType(repository.getType()).isPathMatching(repository, path); + + String namespace = extractNamespace(path); + String remainingPath = path.substring(namespace.length() + 1); + + return getPathMatcherForType(repository.getType()).isPathMatching(repository, remainingPath); } - + + private String extractNamespace(String path) { + if (path.startsWith(HttpUtil.SEPARATOR_PATH)) { + path = path.substring(1); + } + int namespaceSeparator = path.indexOf(HttpUtil.SEPARATOR_PATH); + if (namespaceSeparator > 0) { + return path.substring(0, namespaceSeparator); + } + throw new IllegalArgumentException("no namespace in path " + path); + } + private RepositoryPathMatcher getPathMatcherForType(String type) { RepositoryPathMatcher pathMatcher = pathMatchers.get(type); if (pathMatcher == null) { diff --git a/scm-webapp/src/main/java/sonia/scm/security/AuthorizationChangedEventProducer.java b/scm-webapp/src/main/java/sonia/scm/security/AuthorizationChangedEventProducer.java index c21ec17d18..5a954bb1e7 100644 --- a/scm-webapp/src/main/java/sonia/scm/security/AuthorizationChangedEventProducer.java +++ b/scm-webapp/src/main/java/sonia/scm/security/AuthorizationChangedEventProducer.java @@ -30,8 +30,8 @@ */ package sonia.scm.security; +import com.github.legman.Subscribe; import com.google.common.annotations.VisibleForTesting; -import com.google.common.eventbus.Subscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sonia.scm.EagerSingleton; diff --git a/scm-webapp/src/main/java/sonia/scm/security/SecurityRequests.java b/scm-webapp/src/main/java/sonia/scm/security/SecurityRequests.java new file mode 100644 index 0000000000..225767cd3b --- /dev/null +++ b/scm-webapp/src/main/java/sonia/scm/security/SecurityRequests.java @@ -0,0 +1,24 @@ +package sonia.scm.security; + +import javax.servlet.http.HttpServletRequest; +import java.util.regex.Pattern; + +/** + * Created by masuewer on 04.07.18. + */ +public final class SecurityRequests { + + private static final Pattern URI_LOGIN_PATTERN = Pattern.compile("/api/rest(?:/v2)?/auth/access_token"); + + private SecurityRequests() {} + + public static boolean isAuthenticationRequest(HttpServletRequest request) { + String uri = request.getRequestURI().substring(request.getContextPath().length()); + return isAuthenticationRequest(uri); + } + + public static boolean isAuthenticationRequest(String uri) { + return URI_LOGIN_PATTERN.matcher(uri).matches(); + } + +} diff --git a/scm-webapp/src/main/java/sonia/scm/url/RestJsonUrlProvider.java b/scm-webapp/src/main/java/sonia/scm/url/RestJsonUrlProvider.java deleted file mode 100644 index 7be05d9f39..0000000000 --- a/scm-webapp/src/main/java/sonia/scm/url/RestJsonUrlProvider.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.inject.Inject; -import com.google.inject.Provider; - -import sonia.scm.config.ScmConfiguration; - -/** - * - * @author Sebastian Sdorra - */ -public class RestJsonUrlProvider implements Provider -{ - - /** - * Constructs ... - * - * - * @param configuration - */ - @Inject - public RestJsonUrlProvider(ScmConfiguration configuration) - { - this.configuration = configuration; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public UrlProvider get() - { - return UrlProviderFactory.createUrlProvider(configuration.getBaseUrl(), - UrlProviderFactory.TYPE_RESTAPI_JSON); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private ScmConfiguration configuration; -} diff --git a/scm-webapp/src/main/java/sonia/scm/url/RestXmlUrlProvider.java b/scm-webapp/src/main/java/sonia/scm/url/RestXmlUrlProvider.java deleted file mode 100644 index a4e8d8f1f2..0000000000 --- a/scm-webapp/src/main/java/sonia/scm/url/RestXmlUrlProvider.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.inject.Inject; -import com.google.inject.Provider; - -import sonia.scm.config.ScmConfiguration; - -/** - * - * @author Sebastian Sdorra - */ -public class RestXmlUrlProvider implements Provider -{ - - /** - * Constructs ... - * - * - * @param configuration - */ - @Inject - public RestXmlUrlProvider(ScmConfiguration configuration) - { - this.configuration = configuration; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public UrlProvider get() - { - return UrlProviderFactory.createUrlProvider(configuration.getBaseUrl(), - UrlProviderFactory.TYPE_RESTAPI_XML); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private ScmConfiguration configuration; -} diff --git a/scm-webapp/src/main/java/sonia/scm/url/WebUIUrlProvider.java b/scm-webapp/src/main/java/sonia/scm/url/WebUIUrlProvider.java deleted file mode 100644 index a71b3cd6d7..0000000000 --- a/scm-webapp/src/main/java/sonia/scm/url/WebUIUrlProvider.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.url; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.inject.Inject; -import com.google.inject.Provider; - -import sonia.scm.config.ScmConfiguration; - -/** - * - * @author Sebastian Sdorra - */ -public class WebUIUrlProvider implements Provider -{ - - /** - * Constructs ... - * - * - * @param configuration - */ - @Inject - public WebUIUrlProvider(ScmConfiguration configuration) - { - this.configuration = configuration; - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ - @Override - public UrlProvider get() - { - return UrlProviderFactory.createUrlProvider(configuration.getBaseUrl(), - UrlProviderFactory.TYPE_WUI); - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private ScmConfiguration configuration; -} diff --git a/scm-webapp/src/main/java/sonia/scm/user/DefaultUserManager.java b/scm-webapp/src/main/java/sonia/scm/user/DefaultUserManager.java index c59ec40d4f..25f8c61b3b 100644 --- a/scm-webapp/src/main/java/sonia/scm/user/DefaultUserManager.java +++ b/scm-webapp/src/main/java/sonia/scm/user/DefaultUserManager.java @@ -40,6 +40,7 @@ import com.google.inject.Inject; import com.google.inject.Singleton; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import sonia.scm.EagerSingleton; import sonia.scm.HandlerEventType; import sonia.scm.ManagerDaoAdapter; import sonia.scm.SCMContextProvider; @@ -67,7 +68,7 @@ import java.util.List; * * @author Sebastian Sdorra */ -@Singleton +@Singleton @EagerSingleton public class DefaultUserManager extends AbstractUserManager { diff --git a/scm-webapp/src/main/java/sonia/scm/web/security/ApiAuthenticationFilter.java b/scm-webapp/src/main/java/sonia/scm/web/security/ApiAuthenticationFilter.java index 8340225872..d8fe469af9 100644 --- a/scm-webapp/src/main/java/sonia/scm/web/security/ApiAuthenticationFilter.java +++ b/scm-webapp/src/main/java/sonia/scm/web/security/ApiAuthenticationFilter.java @@ -36,24 +36,22 @@ package sonia.scm.web.security; //~--- non-JDK imports -------------------------------------------------------- import com.google.inject.Inject; - import sonia.scm.Priority; import sonia.scm.config.ScmConfiguration; import sonia.scm.filter.Filters; import sonia.scm.filter.WebElement; -import sonia.scm.web.filter.AuthenticationFilter; +import sonia.scm.security.SecurityRequests; import sonia.scm.web.WebTokenGenerator; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; - -import java.util.Set; +import sonia.scm.web.filter.AuthenticationFilter; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Set; + +//~--- JDK imports ------------------------------------------------------------ /** * Filter to handle authentication for the rest api of SCM-Manager. @@ -66,9 +64,6 @@ import javax.servlet.http.HttpServletResponse; public class ApiAuthenticationFilter extends AuthenticationFilter { - /** login uri */ - public static final String URI_LOGIN = "/api/rest/auth/access_token"; - //~--- constructors --------------------------------------------------------- /** @@ -104,7 +99,7 @@ public class ApiAuthenticationFilter extends AuthenticationFilter throws IOException, ServletException { // skip filter on login resource - if (request.getRequestURI().contains(URI_LOGIN)) + if (SecurityRequests.isAuthenticationRequest(request)) { chain.doFilter(request, response); } diff --git a/scm-webapp/src/main/resources/logback.default.xml b/scm-webapp/src/main/resources/logback.default.xml index e2ed890525..33e914d04d 100644 --- a/scm-webapp/src/main/resources/logback.default.xml +++ b/scm-webapp/src/main/resources/logback.default.xml @@ -99,4 +99,4 @@ - \ No newline at end of file + diff --git a/scm-webapp/src/main/resources/templates/repository-root.mustache b/scm-webapp/src/main/resources/templates/repository-root.mustache index 0263f5356e..7e5cd5951e 100644 --- a/scm-webapp/src/main/resources/templates/repository-root.mustache +++ b/scm-webapp/src/main/resources/templates/repository-root.mustache @@ -93,7 +93,7 @@ diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/AuthenticationResourceTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/AuthenticationResourceTest.java new file mode 100644 index 0000000000..67eb935670 --- /dev/null +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/AuthenticationResourceTest.java @@ -0,0 +1,232 @@ +package sonia.scm.api.v2.resources; + +import com.github.sdorra.shiro.ShiroRule; +import com.github.sdorra.shiro.SubjectAware; +import org.jboss.resteasy.core.Dispatcher; +import org.jboss.resteasy.mock.MockDispatcherFactory; +import org.jboss.resteasy.mock.MockHttpRequest; +import org.jboss.resteasy.mock.MockHttpResponse; +import org.jboss.resteasy.spi.ResteasyProviderFactory; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import sonia.scm.config.ScmConfiguration; +import sonia.scm.security.AccessToken; +import sonia.scm.security.AccessTokenBuilder; +import sonia.scm.security.AccessTokenBuilderFactory; +import sonia.scm.security.AccessTokenCookieIssuer; +import sonia.scm.user.User; +import sonia.scm.user.UserException; +import sonia.scm.user.UserManager; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.UriInfo; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Date; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.*; + +@SubjectAware( + configuration = "classpath:sonia/scm/repository/shiro.ini" +) +@RunWith(MockitoJUnitRunner.class) +public class AuthenticationResourceTest { + + @Rule + public ShiroRule shiro = new ShiroRule(); + + private Dispatcher dispatcher = MockDispatcherFactory.createDispatcher(); + + @Mock + private AccessTokenBuilderFactory accessTokenBuilderFactory; + + @Mock + private AccessTokenBuilder accessTokenBuilder; + + private AccessTokenCookieIssuer cookieIssuer = new AccessTokenCookieIssuer(mock(ScmConfiguration.class)); + + private static final String AUTH_JSON_TRILLIAN = "{\n" + + "\t\"cookie\": true,\n" + + "\t\"grant_type\": \"password\",\n" + + "\t\"username\": \"trillian\",\n" + + "\t\"password\": \"secret\"\n" + + "}"; + + private static final String AUTH_FORMENCODED_TRILLIAN = "cookie=true&grant_type=password&username=trillian&password=secret"; + + private static final String AUTH_JSON_TRILLIAN_WRONG_PW = "{\n" + + "\t\"cookie\": true,\n" + + "\t\"grant_type\": \"password\",\n" + + "\t\"username\": \"trillian\",\n" + + "\t\"password\": \"justWrong\"\n" + + "}"; + + private static final String AUTH_JSON_NOT_EXISTING_USER = "{\n" + + "\t\"cookie\": true,\n" + + "\t\"grant_type\": \"password\",\n" + + "\t\"username\": \"iDoNotExist\",\n" + + "\t\"password\": \"doesNotMatter\"\n" + + "}"; + + private static final String AUTH_JSON_WITHOUT_USERNAME = String.join("\n", + "{", + "\"grant_type\": \"password\",", + "\"password\": \"tricia123\"", + "}" + ); + + private static final String AUTH_JSON_WITHOUT_PASSWORD = String.join("\n", + "{", + "\"grant_type\": \"password\",", + "\"username\": \"trillian\"", + "}" + ); + + private static final String AUTH_JSON_WITHOUT_GRANT_TYPE = String.join("\n", + "{", + "\"username\": \"trillian\",", + "\"password\": \"tricia123\"", + "}" + ); + + private static final String AUTH_JSON_WITH_INVALID_GRANT_TYPE = String.join("\n", + "{", + "\"grant_type\": \"el speciale\",", + "\"username\": \"trillian\",", + "\"password\": \"tricia123\"", + "}" + ); + + @Before + public void prepareEnvironment() { + AuthenticationResource authenticationResource = new AuthenticationResource(accessTokenBuilderFactory, cookieIssuer); + dispatcher.getRegistry().addSingletonResource(authenticationResource); + + AccessToken accessToken = mock(AccessToken.class); + when(accessToken.getExpiration()).thenReturn(new Date(Long.MAX_VALUE)); + when(accessTokenBuilder.build()).thenReturn(accessToken); + + when(accessTokenBuilderFactory.create()).thenReturn(accessTokenBuilder); + + HttpServletRequest servletRequest = mock(HttpServletRequest.class); + ResteasyProviderFactory.getContextDataMap().put(HttpServletRequest.class, servletRequest); + + HttpServletResponse servletResponse = mock(HttpServletResponse.class); + ResteasyProviderFactory.getContextDataMap().put(HttpServletResponse.class, servletResponse); + } + + @Test + public void shouldAuthCorrectly() throws URISyntaxException { + + MockHttpRequest request = getMockHttpRequest(AUTH_JSON_TRILLIAN); + MockHttpResponse response = new MockHttpResponse(); + + dispatcher.invoke(request, response); + + assertEquals(HttpServletResponse.SC_NO_CONTENT, response.getStatus()); + } + + @Test + public void shouldAuthCorrectlyWithFormencodedData() throws URISyntaxException { + + MockHttpRequest request = getMockHttpRequestUrlEncoded(AUTH_FORMENCODED_TRILLIAN); + MockHttpResponse response = new MockHttpResponse(); + + dispatcher.invoke(request, response); + + assertEquals(HttpServletResponse.SC_NO_CONTENT, response.getStatus()); + } + + + @Test + public void shouldNotAuthUserWithWrongPassword() throws URISyntaxException { + + MockHttpRequest request = getMockHttpRequest(AUTH_JSON_TRILLIAN_WRONG_PW); + MockHttpResponse response = new MockHttpResponse(); + + dispatcher.invoke(request, response); + + assertEquals(HttpServletResponse.SC_UNAUTHORIZED, response.getStatus()); + } + + @Test + public void shouldNotAuthNonexistingUser() throws URISyntaxException { + MockHttpRequest request = getMockHttpRequest(AUTH_JSON_NOT_EXISTING_USER); + MockHttpResponse response = new MockHttpResponse(); + + dispatcher.invoke(request, response); + + assertEquals(HttpServletResponse.SC_UNAUTHORIZED, response.getStatus()); + } + + @Test + public void shouldReturnBadStatusIfPasswordParameterIsMissing() throws URISyntaxException { + shouldReturnBadRequest(AUTH_JSON_WITHOUT_USERNAME); + } + + @Test + public void shouldReturnBadStatusIfUsernameParameterIsMissing() throws URISyntaxException { + shouldReturnBadRequest(AUTH_JSON_WITHOUT_PASSWORD); + } + + @Test + public void shouldReturnBadStatusIfGrantTypeParameterIsMissing() throws URISyntaxException { + shouldReturnBadRequest(AUTH_JSON_WITHOUT_GRANT_TYPE); + } + + @Test + public void shouldReturnBadStatusIfGrantTypeParameterIsInvalid() throws URISyntaxException { + shouldReturnBadRequest(AUTH_JSON_WITH_INVALID_GRANT_TYPE); + } + + @Test + @SubjectAware(username = "trillian", password = "secret") + public void shouldSuccessfullyLogoutUser() throws URISyntaxException { + MockHttpRequest request = MockHttpRequest.delete("/" + AuthenticationResource.PATH + "/access_token"); + MockHttpResponse response = new MockHttpResponse(); + + dispatcher.invoke(request, response); + assertEquals(HttpServletResponse.SC_NO_CONTENT, response.getStatus()); + } + + + private void shouldReturnBadRequest(String requestBody) throws URISyntaxException { + MockHttpRequest request = getMockHttpRequest(requestBody); + MockHttpResponse response = new MockHttpResponse(); + + dispatcher.invoke(request, response); + + assertEquals(HttpServletResponse.SC_BAD_REQUEST, response.getStatus()); + } + + private MockHttpRequest getMockHttpRequest(String jsonPayload) throws URISyntaxException { + MockHttpRequest request = MockHttpRequest.post("/" + AuthenticationResource.PATH + "/access_token"); + + request.content(jsonPayload.getBytes()); + request.contentType(MediaType.APPLICATION_JSON_TYPE); + return request; + } + + private MockHttpRequest getMockHttpRequestUrlEncoded(String payload) throws URISyntaxException { + MockHttpRequest request = MockHttpRequest.post("/" + AuthenticationResource.PATH + "/access_token"); + + request.content(payload.getBytes()); + request.contentType(MediaType.APPLICATION_FORM_URLENCODED_TYPE); + return request; + } + +} diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ConfigDtoToScmConfigurationMapperTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ConfigDtoToScmConfigurationMapperTest.java new file mode 100644 index 0000000000..ad1e71368e --- /dev/null +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ConfigDtoToScmConfigurationMapperTest.java @@ -0,0 +1,81 @@ +package sonia.scm.api.v2.resources; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.internal.util.collections.Sets; +import sonia.scm.config.ScmConfiguration; + +import java.util.Arrays; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.MockitoAnnotations.initMocks; + +public class ConfigDtoToScmConfigurationMapperTest { + + @InjectMocks + private ConfigDtoToScmConfigurationMapperImpl mapper; + + private String[] expectedUsers = { "trillian", "arthur" }; + private String[] expectedGroups = { "admin", "plebs" }; + private String[] expectedExcludes = { "ex", "clude" }; + + @Before + public void init() { + initMocks(this); + } + + @Test + public void shouldMapFields() { + ConfigDto dto = createDefaultDto(); + ScmConfiguration config = mapper.map(dto); + + assertEquals("prPw" , config.getProxyPassword()); + assertEquals(42 , config.getProxyPort()); + assertEquals("srvr" , config.getProxyServer()); + assertEquals("user" , config.getProxyUser()); + assertTrue(config.isEnableProxy()); + assertEquals("realm" , config.getRealmDescription()); + assertTrue(config.isEnableRepositoryArchive()); + assertTrue(config.isDisableGroupingGrid()); + assertEquals("yyyy" , config.getDateFormat()); + assertTrue(config.isAnonymousAccessEnabled()); + assertTrue("adminGroups", config.getAdminGroups().containsAll(Arrays.asList(expectedGroups))); + assertTrue("adminUsers", config.getAdminUsers().containsAll(Arrays.asList(expectedUsers))); + assertEquals("baseurl" , config.getBaseUrl()); + assertTrue(config.isForceBaseUrl()); + assertEquals(41 , config.getLoginAttemptLimit()); + assertTrue("proxyExcludes", config.getProxyExcludes().containsAll(Arrays.asList(expectedExcludes))); + assertTrue(config.isSkipFailedAuthenticators()); + assertEquals("https://plug.ins" , config.getPluginUrl()); + assertEquals(40 , config.getLoginAttemptLimitTimeout()); + assertTrue(config.isEnabledXsrfProtection()); + } + + private ConfigDto createDefaultDto() { + ConfigDto configDto = new ConfigDto(); + configDto.setProxyPassword("prPw"); + configDto.setProxyPort(42); + configDto.setProxyServer("srvr"); + configDto.setProxyUser("user"); + configDto.setEnableProxy(true); + configDto.setRealmDescription("realm"); + configDto.setEnableRepositoryArchive(true); + configDto.setDisableGroupingGrid(true); + configDto.setDateFormat("yyyy"); + configDto.setAnonymousAccessEnabled(true); + configDto.setAdminGroups(Sets.newSet(expectedGroups)); + configDto.setAdminUsers(Sets.newSet(expectedUsers)); + configDto.setBaseUrl("baseurl"); + configDto.setForceBaseUrl(true); + configDto.setLoginAttemptLimit(41); + configDto.setProxyExcludes(Sets.newSet(expectedExcludes)); + configDto.setSkipFailedAuthenticators(true); + configDto.setPluginUrl("https://plug.ins"); + configDto.setLoginAttemptLimitTimeout(40); + configDto.setEnabledXsrfProtection(true); + + return configDto; + } +} diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ConfigResourceTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ConfigResourceTest.java new file mode 100644 index 0000000000..5365e9fbde --- /dev/null +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ConfigResourceTest.java @@ -0,0 +1,127 @@ +package sonia.scm.api.v2.resources; + +import com.github.sdorra.shiro.ShiroRule; +import com.github.sdorra.shiro.SubjectAware; +import com.google.common.io.Resources; +import org.jboss.resteasy.core.Dispatcher; +import org.jboss.resteasy.mock.MockDispatcherFactory; +import org.jboss.resteasy.mock.MockHttpRequest; +import org.jboss.resteasy.mock.MockHttpResponse; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.mockito.InjectMocks; +import sonia.scm.config.ScmConfiguration; +import sonia.scm.web.VndMediaType; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.MockitoAnnotations.initMocks; + +@SubjectAware( + configuration = "classpath:sonia/scm/configuration/shiro.ini", + password = "secret" +) +public class ConfigResourceTest { + + @Rule + public ShiroRule shiro = new ShiroRule(); + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + private Dispatcher dispatcher = MockDispatcherFactory.createDispatcher(); + + private final URI baseUri = URI.create("/"); + @SuppressWarnings("unused") // Is injected + private ResourceLinks resourceLinks = ResourceLinksMock.createMock(baseUri); + + @InjectMocks + private ConfigDtoToScmConfigurationMapperImpl dtoToConfigMapper; + @InjectMocks + private ScmConfigurationToConfigDtoMapperImpl configToDtoMapper; + + @Before + public void prepareEnvironment() { + initMocks(this); + + ConfigResource configResource = new ConfigResource(dtoToConfigMapper, configToDtoMapper, createConfiguration()); + + dispatcher.getRegistry().addSingletonResource(configResource); + } + + @Test + @SubjectAware(username = "readOnly") + public void shouldGetGlobalConfig() throws URISyntaxException { + MockHttpRequest request = MockHttpRequest.get("/" + ConfigResource.CONFIG_PATH_V2); + MockHttpResponse response = new MockHttpResponse(); + dispatcher.invoke(request, response); + assertEquals(HttpServletResponse.SC_OK, response.getStatus()); + assertTrue(response.getContentAsString().contains("\"proxyPassword\":\"heartOfGold\"")); + assertTrue(response.getContentAsString().contains("\"self\":{\"href\":\"/v2/config")); + assertFalse("Update link present", response.getContentAsString().contains("\"update\":{\"href\":\"/v2/config")); + } + + @Test + @SubjectAware(username = "writeOnly") + public void shouldGetConfigOnlyWhenAuthorized() throws URISyntaxException { + MockHttpRequest request = MockHttpRequest.get("/" + ConfigResource.CONFIG_PATH_V2); + MockHttpResponse response = new MockHttpResponse(); + + thrown.expectMessage("Subject does not have permission [configuration:read:global]"); + + dispatcher.invoke(request, response); + } + + @Test + @SubjectAware(username = "readWrite") + public void shouldUpdateConfig() throws URISyntaxException, IOException { + URL url = Resources.getResource("sonia/scm/api/v2/config-test-update.json"); + byte[] configJson = Resources.toByteArray(url); + MockHttpRequest request = MockHttpRequest.put("/" + ConfigResource.CONFIG_PATH_V2) + .contentType(VndMediaType.CONFIG) + .content(configJson); + + MockHttpResponse response = new MockHttpResponse(); + dispatcher.invoke(request, response); + assertEquals(HttpServletResponse.SC_NO_CONTENT, response.getStatus()); + + request = MockHttpRequest.get("/" + ConfigResource.CONFIG_PATH_V2); + response = new MockHttpResponse(); + dispatcher.invoke(request, response); + assertEquals(HttpServletResponse.SC_OK, response.getStatus()); + assertTrue(response.getContentAsString().contains("\"proxyPassword\":\"newPassword\"")); + assertTrue(response.getContentAsString().contains("\"self\":{\"href\":\"/v2/config")); + assertTrue("link not found", response.getContentAsString().contains("\"update\":{\"href\":\"/v2/config")); + } + + @Test + @SubjectAware(username = "readOnly") + public void shouldUpdateConfigOnlyWhenAuthorized() throws URISyntaxException, IOException { + URL url = Resources.getResource("sonia/scm/api/v2/config-test-update.json"); + byte[] configJson = Resources.toByteArray(url); + MockHttpRequest request = MockHttpRequest.put("/" + ConfigResource.CONFIG_PATH_V2) + .contentType(VndMediaType.CONFIG) + .content(configJson); + MockHttpResponse response = new MockHttpResponse(); + + thrown.expectMessage("Subject does not have permission [configuration:write:global]"); + + dispatcher.invoke(request, response); + } + + private static ScmConfiguration createConfiguration() { + ScmConfiguration scmConfiguration = new ScmConfiguration(); + scmConfiguration.setProxyPassword("heartOfGold"); + + return scmConfiguration; + } +} diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/GroupRootResourceTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/GroupRootResourceTest.java index 3302d6ef6e..dff9e7e99b 100644 --- a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/GroupRootResourceTest.java +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/GroupRootResourceTest.java @@ -27,9 +27,7 @@ import java.net.URL; import java.util.Collections; import static java.util.Collections.singletonList; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.doNothing; @@ -111,8 +109,6 @@ public class GroupRootResourceTest { Group group = createDummyGroup(); when(groupManager.get("admin")).thenReturn(group); - Group updatedGroup = createDummyGroup(); - updatedGroup.setDescription("Updated description"); MockHttpRequest request = MockHttpRequest .put("/" + GroupRootResource.GROUPS_PATH_V2 + "admin") @@ -134,9 +130,6 @@ public class GroupRootResourceTest { URL url = Resources.getResource("sonia/scm/api/v2/group-test-update.json"); byte[] groupJson = Resources.toByteArray(url); - Group updatedGroup = createDummyGroup(); - updatedGroup.setDescription("Updated description"); - MockHttpRequest request = MockHttpRequest .put("/" + GroupRootResource.GROUPS_PATH_V2 + "idontexist") .contentType(VndMediaType.GROUP) diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/MeResourceTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/MeResourceTest.java new file mode 100644 index 0000000000..56c60098fb --- /dev/null +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/MeResourceTest.java @@ -0,0 +1,104 @@ +package sonia.scm.api.v2.resources; + +import com.github.sdorra.shiro.ShiroRule; +import com.github.sdorra.shiro.SubjectAware; +import com.google.common.io.Resources; +import org.apache.shiro.authc.credential.PasswordService; +import org.apache.shiro.subject.PrincipalCollection; +import org.apache.shiro.subject.Subject; +import org.jboss.resteasy.core.Dispatcher; +import org.jboss.resteasy.mock.MockDispatcherFactory; +import org.jboss.resteasy.mock.MockHttpRequest; +import org.jboss.resteasy.mock.MockHttpResponse; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import sonia.scm.PageResult; +import sonia.scm.user.User; +import sonia.scm.user.UserException; +import sonia.scm.user.UserManager; +import sonia.scm.web.VndMediaType; + +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.UriInfo; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + +import static java.util.Collections.singletonList; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.*; +import static org.mockito.MockitoAnnotations.initMocks; + +@SubjectAware( + configuration = "classpath:sonia/scm/repository/shiro.ini" +) +public class MeResourceTest { + + @Rule + public ShiroRule shiro = new ShiroRule(); + + private Dispatcher dispatcher = MockDispatcherFactory.createDispatcher(); + + + private final ResourceLinks resourceLinks = ResourceLinksMock.createMock(URI.create("/")); + @Mock + private UriInfo uriInfo; + @Mock + private UriInfoStore uriInfoStore; + + @Mock + private UserManager userManager; + + @InjectMocks + private UserToUserDtoMapperImpl userToDtoMapper; + + private ArgumentCaptor userCaptor = ArgumentCaptor.forClass(User.class); + + @Before + public void prepareEnvironment() throws IOException, UserException { + initMocks(this); + createDummyUser("trillian"); + when(userManager.create(userCaptor.capture())).thenAnswer(invocation -> invocation.getArguments()[0]); + doNothing().when(userManager).modify(userCaptor.capture()); + doNothing().when(userManager).delete(userCaptor.capture()); + userToDtoMapper.setResourceLinks(resourceLinks); + MeResource meResource = new MeResource(userToDtoMapper, userManager); + dispatcher.getRegistry().addSingletonResource(meResource); + when(uriInfo.getBaseUri()).thenReturn(URI.create("/")); + when(uriInfoStore.get()).thenReturn(uriInfo); + } + + @Test + @SubjectAware(username = "trillian", password = "secret") + public void shouldReturnCurrentlyAuthenticatedUser() throws URISyntaxException { + MockHttpRequest request = MockHttpRequest.get("/" + MeResource.ME_PATH_V2); + request.accept(VndMediaType.USER); + MockHttpResponse response = new MockHttpResponse(); + + dispatcher.invoke(request, response); + + assertEquals(HttpServletResponse.SC_OK, response.getStatus()); + assertTrue(response.getContentAsString().contains("\"name\":\"trillian\"")); + assertTrue(response.getContentAsString().contains("\"password\":\"__dummypassword__\"")); + assertTrue(response.getContentAsString().contains("\"self\":{\"href\":\"/v2/users/trillian\"}")); + assertTrue(response.getContentAsString().contains("\"delete\":{\"href\":\"/v2/users/trillian\"}")); + } + + private User createDummyUser(String name) { + User user = new User(); + user.setName(name); + user.setPassword("secret"); + user.setCreationDate(System.currentTimeMillis()); + when(userManager.get(name)).thenReturn(user); + return user; + } +} diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/RepositoryRootResourceTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/RepositoryRootResourceTest.java index 24a11fbf09..a8616fe2ce 100644 --- a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/RepositoryRootResourceTest.java +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/RepositoryRootResourceTest.java @@ -27,19 +27,14 @@ import java.net.URL; import static java.util.Collections.singletonList; import static java.util.Optional.empty; import static java.util.Optional.of; -import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST; -import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; -import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT; -import static javax.servlet.http.HttpServletResponse.SC_OK; +import static javax.servlet.http.HttpServletResponse.*; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyObject; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; import static org.mockito.MockitoAnnotations.initMocks; @SubjectAware( diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ResourceLinksMock.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ResourceLinksMock.java index b35bc3820c..b5fe5c4da4 100644 --- a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ResourceLinksMock.java +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ResourceLinksMock.java @@ -24,6 +24,7 @@ public class ResourceLinksMock { when(resourceLinks.changesetCollection()).thenReturn(new ResourceLinks.ChangesetCollectionLinks(uriInfo)); when(resourceLinks.sourceCollection()).thenReturn(new ResourceLinks.SourceCollectionLinks(uriInfo)); when(resourceLinks.permissionCollection()).thenReturn(new ResourceLinks.PermissionCollectionLinks(uriInfo)); + when(resourceLinks.config()).thenReturn(new ResourceLinks.ConfigLinks(uriInfo)); return resourceLinks; } } diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ResourceLinksTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ResourceLinksTest.java index c4bc5c73cd..b850a4b4c6 100644 --- a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ResourceLinksTest.java +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ResourceLinksTest.java @@ -132,6 +132,18 @@ public class ResourceLinksTest { assertEquals(BASE_URL + RepositoryRootResource.REPOSITORIES_PATH_V2 + "space/repo/sources/", url); } + @Test + public void shouldCreateCorrectConfigSelfUrl() { + String url = resourceLinks.config().self(); + assertEquals(BASE_URL + ConfigResource.CONFIG_PATH_V2, url); + } + + @Test + public void shouldCreateCorrectConfigUpdateUrl() { + String url = resourceLinks.config().update(); + assertEquals(BASE_URL + ConfigResource.CONFIG_PATH_V2, url); + } + @Before public void initUriInfo() { initMocks(this); diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ScmConfigurationToConfigDtoMapperTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ScmConfigurationToConfigDtoMapperTest.java new file mode 100644 index 0000000000..ff20516e5a --- /dev/null +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ScmConfigurationToConfigDtoMapperTest.java @@ -0,0 +1,126 @@ +package sonia.scm.api.v2.resources; + +import org.apache.shiro.subject.Subject; +import org.apache.shiro.subject.support.SubjectThreadState; +import org.apache.shiro.util.ThreadContext; +import org.apache.shiro.util.ThreadState; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.internal.util.collections.Sets; +import sonia.scm.config.ScmConfiguration; + +import java.net.URI; +import java.util.Arrays; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.mockito.MockitoAnnotations.initMocks; + +public class ScmConfigurationToConfigDtoMapperTest { + + private URI baseUri = URI.create("http://example.com/base/"); + + private String[] expectedUsers = { "trillian", "arthur" }; + private String[] expectedGroups = { "admin", "plebs" }; + private String[] expectedExcludes = { "ex", "clude" }; + + @SuppressWarnings("unused") // Is injected + private ResourceLinks resourceLinks = ResourceLinksMock.createMock(baseUri); + + @InjectMocks + private ScmConfigurationToConfigDtoMapperImpl mapper; + + private final Subject subject = mock(Subject.class); + private final ThreadState subjectThreadState = new SubjectThreadState(subject); + + private URI expectedBaseUri; + + @Before + public void init() { + initMocks(this); + expectedBaseUri = baseUri.resolve(ConfigResource.CONFIG_PATH_V2); + subjectThreadState.bind(); + ThreadContext.bind(subject); + } + + @After + public void unbindSubject() { + ThreadContext.unbindSubject(); + } + + @Test + public void shouldMapFields() { + ScmConfiguration config = createConfiguration(); + + + when(subject.isPermitted("configuration:write:global")).thenReturn(true); + ConfigDto dto = mapper.map(config); + + assertEquals("heartOfGold" , dto.getProxyPassword()); + assertEquals(1234 , dto.getProxyPort()); + assertEquals("proxyserver" , dto.getProxyServer()); + assertEquals("trillian" , dto.getProxyUser()); + assertTrue(dto.isEnableProxy()); + assertEquals("description" , dto.getRealmDescription()); + assertTrue(dto.isEnableRepositoryArchive()); + assertTrue(dto.isDisableGroupingGrid()); + assertEquals("dd" , dto.getDateFormat()); + assertTrue(dto.isAnonymousAccessEnabled()); + assertTrue("adminGroups", dto.getAdminGroups().containsAll(Arrays.asList(expectedGroups))); + assertTrue("adminUsers", dto.getAdminUsers().containsAll(Arrays.asList(expectedUsers))); + assertEquals("baseurl" , dto.getBaseUrl()); + assertTrue(dto.isForceBaseUrl()); + assertEquals(1 , dto.getLoginAttemptLimit()); + assertTrue("proxyExcludes", dto.getProxyExcludes().containsAll(Arrays.asList(expectedExcludes))); + assertTrue(dto.isSkipFailedAuthenticators()); + assertEquals("pluginurl" , dto.getPluginUrl()); + assertEquals(2 , dto.getLoginAttemptLimitTimeout()); + assertTrue(dto.isEnabledXsrfProtection()); + + assertEquals(expectedBaseUri.toString(), dto.getLinks().getLinkBy("self").get().getHref()); + assertEquals(expectedBaseUri.toString(), dto.getLinks().getLinkBy("update").get().getHref()); + } + + @Test + public void shouldMapFieldsWithoutUpdate() { + ScmConfiguration config = createConfiguration(); + + when(subject.hasRole("configuration:write:global")).thenReturn(false); + ConfigDto dto = mapper.map(config); + + assertEquals("baseurl", dto.getBaseUrl()); + assertEquals(expectedBaseUri.toString(), dto.getLinks().getLinkBy("self").get().getHref()); + assertFalse(dto.getLinks().hasLink("update")); + } + + private ScmConfiguration createConfiguration() { + ScmConfiguration config = new ScmConfiguration(); + config.setProxyPassword("heartOfGold"); + config.setProxyPort(1234); + config.setProxyServer("proxyserver"); + config.setProxyUser("trillian"); + config.setEnableProxy(true); + config.setRealmDescription("description"); + config.setEnableRepositoryArchive(true); + config.setDisableGroupingGrid(true); + config.setDateFormat("dd"); + config.setAnonymousAccessEnabled(true); + config.setAdminGroups(Sets.newSet(expectedGroups)); + config.setAdminUsers(Sets.newSet(expectedUsers)); + config.setBaseUrl("baseurl"); + config.setForceBaseUrl(true); + config.setLoginAttemptLimit(1); + config.setProxyExcludes(Sets.newSet(expectedExcludes)); + config.setSkipFailedAuthenticators(true); + config.setPluginUrl("pluginurl"); + config.setLoginAttemptLimitTimeout(2); + config.setEnabledXsrfProtection(true); + return config; + } + +} diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserCollectionToDtoMapperTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserCollectionToDtoMapperTest.java index 4d2bf7c62e..6ca0ddec4a 100644 --- a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserCollectionToDtoMapperTest.java +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserCollectionToDtoMapperTest.java @@ -18,9 +18,7 @@ import java.util.Arrays; import java.util.List; import static java.util.stream.Collectors.toList; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; import static sonia.scm.PageResult.createPage; diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserRootResourceTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserRootResourceTest.java index 049d8ab1c8..1eee9b2270 100644 --- a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserRootResourceTest.java +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserRootResourceTest.java @@ -27,15 +27,10 @@ import java.net.URISyntaxException; import java.net.URL; import static java.util.Collections.singletonList; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; import static org.mockito.MockitoAnnotations.initMocks; @SubjectAware( diff --git a/scm-webapp/src/test/java/sonia/scm/filter/SecurityFilterTest.java b/scm-webapp/src/test/java/sonia/scm/filter/SecurityFilterTest.java index 13333cc223..983f8d964a 100644 --- a/scm-webapp/src/test/java/sonia/scm/filter/SecurityFilterTest.java +++ b/scm-webapp/src/test/java/sonia/scm/filter/SecurityFilterTest.java @@ -100,14 +100,29 @@ public class SecurityFilterTest { } /** - * Tests filter on authentication endpoint. - * + * Tests filter on authentication endpoint v1. + * * @throws IOException * @throws ServletException */ @Test - public void testDoOnAuthenticationUrl() throws IOException, ServletException { - when(request.getRequestURI()).thenReturn("/scm/api/rest/authentication"); + public void testDoOnAuthenticationUrlV1() throws IOException, ServletException { + checkIfAuthenticationUrlIsPassedThrough("/scm/api/rest/auth/access_token"); + } + + /** + * Tests filter on authentication endpoint v2. + * + * @throws IOException + * @throws ServletException + */ + @Test + public void testDoOnAuthenticationUrlV2() throws IOException, ServletException { + checkIfAuthenticationUrlIsPassedThrough("/scm/api/rest/v2/auth/access_token"); + } + + private void checkIfAuthenticationUrlIsPassedThrough(String uri) throws IOException, ServletException { + when(request.getRequestURI()).thenReturn(uri); securityFilter.doFilter(request, response, chain); verify(request, never()).setAttribute(Mockito.anyString(), Mockito.any()); verify(chain).doFilter(request, response); @@ -235,4 +250,4 @@ public class SecurityFilterTest { } -} \ No newline at end of file +} diff --git a/scm-webapp/src/test/java/sonia/scm/repository/DefaultNamespaceStrategyTest.java b/scm-webapp/src/test/java/sonia/scm/repository/DefaultNamespaceStrategyTest.java new file mode 100644 index 0000000000..dc40d1c1cb --- /dev/null +++ b/scm-webapp/src/test/java/sonia/scm/repository/DefaultNamespaceStrategyTest.java @@ -0,0 +1,24 @@ +package sonia.scm.repository; + +import com.github.sdorra.shiro.ShiroRule; +import com.github.sdorra.shiro.SubjectAware; +import org.junit.Rule; +import org.junit.Test; + +import static org.junit.Assert.*; + +@SubjectAware(configuration = "classpath:sonia/scm/shiro-001.ini") +public class DefaultNamespaceStrategyTest { + + @Rule + public ShiroRule shiroRule = new ShiroRule(); + + private DefaultNamespaceStrategy namespaceStrategy = new DefaultNamespaceStrategy(); + + @Test + @SubjectAware(username = "trillian", password = "secret") + public void testNamespaceStrategy() { + assertEquals("trillian", namespaceStrategy.getNamespace()); + } + +} diff --git a/scm-webapp/src/test/java/sonia/scm/repository/DefaultRepositoryManagerPerfTest.java b/scm-webapp/src/test/java/sonia/scm/repository/DefaultRepositoryManagerPerfTest.java index 95cbd44340..665c54c9e1 100644 --- a/scm-webapp/src/test/java/sonia/scm/repository/DefaultRepositoryManagerPerfTest.java +++ b/scm-webapp/src/test/java/sonia/scm/repository/DefaultRepositoryManagerPerfTest.java @@ -96,8 +96,6 @@ public class DefaultRepositoryManagerPerfTest { private final KeyGenerator keyGenerator = new DefaultKeyGenerator(); - private final NamespaceStrategy namespaceStrategy = new DefaultNamespaceStrategy(); - @Mock private RepositoryHandler repositoryHandler; @@ -114,7 +112,7 @@ public class DefaultRepositoryManagerPerfTest { when(repositoryHandler.getType()).thenReturn(new Type(REPOSITORY_TYPE, REPOSITORY_TYPE)); Set handlerSet = ImmutableSet.of(repositoryHandler); RepositoryMatcher repositoryMatcher = new RepositoryMatcher(Collections.emptySet()); - + NamespaceStrategy namespaceStrategy = mock(NamespaceStrategy.class); repositoryManager = new DefaultRepositoryManager( configuration, contextProvider, @@ -132,10 +130,7 @@ public class DefaultRepositoryManagerPerfTest { ThreadContext.bind(securityManager); } - - /** - * Tear down test objects. - */ + @After public void tearDown(){ ThreadContext.unbindSecurityManager(); @@ -188,8 +183,8 @@ private long calculateAverage(List times) { when(repositoryDAO.getAll()).thenReturn(repositories.values()); } - private Repository createTestRepository(int number){ - Repository repository = new Repository(keyGenerator.createKey(), REPOSITORY_TYPE, "repo-" + number); + private Repository createTestRepository(int number) { + Repository repository = new Repository(keyGenerator.createKey(), REPOSITORY_TYPE, "namespace", "repo-" + number); repository.getPermissions().add(new Permission("trillian", PermissionType.READ)); return repository; } diff --git a/scm-webapp/src/test/java/sonia/scm/repository/DefaultRepositoryManagerTest.java b/scm-webapp/src/test/java/sonia/scm/repository/DefaultRepositoryManagerTest.java index 2c8c6879f4..4c42ceb1ea 100644 --- a/scm-webapp/src/test/java/sonia/scm/repository/DefaultRepositoryManagerTest.java +++ b/scm-webapp/src/test/java/sonia/scm/repository/DefaultRepositoryManagerTest.java @@ -41,12 +41,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.mockito.invocation.InvocationOnMock; -import sonia.scm.HandlerEventType; -import sonia.scm.Manager; -import sonia.scm.ManagerTestBase; -import sonia.scm.ModelObject; -import sonia.scm.Type; -import sonia.scm.TypedObject; +import sonia.scm.*; import sonia.scm.config.ScmConfiguration; import sonia.scm.event.ScmEventBus; import sonia.scm.repository.api.HookContext; @@ -59,24 +54,12 @@ import sonia.scm.security.KeyGenerator; import sonia.scm.store.ConfigurationStoreFactory; import sonia.scm.store.JAXBConfigurationStoreFactory; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; -import java.util.Stack; +import java.util.*; -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; //~--- JDK imports ------------------------------------------------------------ @@ -101,9 +84,8 @@ public class DefaultRepositoryManagerTest extends ManagerTestBase keys = new Stack<>(); @@ -302,9 +250,6 @@ public class DefaultRepositoryManagerTest extends ManagerTestBase mockedNamespace); + return new DefaultRepositoryManager(configuration, contextProvider, keyGenerator, repositoryDAO, handlerSet, createRepositoryMatcher(), namespaceStrategy); } diff --git a/scm-webapp/src/test/java/sonia/scm/repository/RepositoryMatcherTest.java b/scm-webapp/src/test/java/sonia/scm/repository/RepositoryMatcherTest.java index c832bb8691..1d6371074c 100644 --- a/scm-webapp/src/test/java/sonia/scm/repository/RepositoryMatcherTest.java +++ b/scm-webapp/src/test/java/sonia/scm/repository/RepositoryMatcherTest.java @@ -31,10 +31,13 @@ package sonia.scm.repository; import com.google.common.collect.Sets; -import java.util.Set; -import org.junit.Test; -import static org.junit.Assert.*; import org.junit.Before; +import org.junit.Test; + +import java.util.Set; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * Unit tests for {@link RepositoryMatcher}. @@ -54,11 +57,11 @@ public class RepositoryMatcherTest { @Test public void testMatches() { - assertFalse(matcher.matches(repository("hg", "scm"), "hg", "scm-test/ka")); - assertFalse(matcher.matches(repository("git", "scm-test"), "hg", "scm-test")); + assertFalse(matcher.matches(repository("hg", "scm"), "hg", "namespace/scm-test/ka")); + assertFalse(matcher.matches(repository("git", "scm-test"), "hg", "namespace/scm-test")); - assertTrue(matcher.matches(repository("hg", "scm-test"), "hg", "scm-test/ka")); - assertTrue(matcher.matches(repository("hg", "scm-test"), "hg", "scm-test")); + assertTrue(matcher.matches(repository("hg", "scm-test"), "hg", "namespace/scm-test/ka")); + assertTrue(matcher.matches(repository("hg", "scm-test"), "hg", "namespace/scm-test")); } @Test @@ -68,7 +71,7 @@ public class RepositoryMatcherTest { } private Repository repository(String type, String name) { - return new Repository(type + "-" + name, type, name); + return new Repository(type + "-" + name, type, "namespace", name); } private static class AbcRepositoryPathMatcher implements RepositoryPathMatcher { diff --git a/scm-webapp/src/test/java/sonia/scm/security/SecurityRequestsTest.java b/scm-webapp/src/test/java/sonia/scm/security/SecurityRequestsTest.java new file mode 100644 index 0000000000..9e6d54dc0b --- /dev/null +++ b/scm-webapp/src/test/java/sonia/scm/security/SecurityRequestsTest.java @@ -0,0 +1,37 @@ +package sonia.scm.security; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import javax.servlet.http.HttpServletRequest; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.when; + +/** + * Created by masuewer on 04.07.18. + */ +@RunWith(MockitoJUnitRunner.class) +public class SecurityRequestsTest { + + @Mock + private HttpServletRequest request; + + @Test + public void testIsAuthenticationRequestWithContextPath() { + when(request.getRequestURI()).thenReturn("/scm/api/rest/auth/access_token"); + when(request.getContextPath()).thenReturn("/scm"); + + assertTrue(SecurityRequests.isAuthenticationRequest(request)); + } + + @Test + public void testIsAuthenticationRequest() throws Exception { + assertTrue(SecurityRequests.isAuthenticationRequest("/api/rest/auth/access_token")); + assertTrue(SecurityRequests.isAuthenticationRequest("/api/rest/v2/auth/access_token")); + assertFalse(SecurityRequests.isAuthenticationRequest("/api/rest/repositories")); + assertFalse(SecurityRequests.isAuthenticationRequest("/api/rest/v2/repositories")); + } +} diff --git a/scm-webapp/src/test/resources/sonia/scm/api/v2/config-test-update.json b/scm-webapp/src/test/resources/sonia/scm/api/v2/config-test-update.json new file mode 100644 index 0000000000..bc45315a0c --- /dev/null +++ b/scm-webapp/src/test/resources/sonia/scm/api/v2/config-test-update.json @@ -0,0 +1,3 @@ +{ + "proxyPassword": "newPassword" +} diff --git a/scm-webapp/src/test/resources/sonia/scm/configuration/shiro.ini b/scm-webapp/src/test/resources/sonia/scm/configuration/shiro.ini new file mode 100644 index 0000000000..8647142b19 --- /dev/null +++ b/scm-webapp/src/test/resources/sonia/scm/configuration/shiro.ini @@ -0,0 +1,9 @@ +[users] +readOnly = secret, reader +writeOnly = secret, writer +readWrite = secret, readerWriter + +[roles] +reader = configuration:read +writer = configuration:write +readerWriter = configuration:* diff --git a/scm.iml b/scm.iml new file mode 100644 index 0000000000..4ed0077c7f --- /dev/null +++ b/scm.iml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file