diff --git a/build.gradle b/build.gradle index 3be95c9..1c05cdb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + buildscript { repositories { maven { diff --git a/gradle.properties b/gradle.properties index f8348d2..e8307c9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,17 @@ +# +# Copyright 2000-2020 JetBrains s.r.o. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + TeamCityVersion=10.0 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ca78035..758de96 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 106f2e2..2d80b69 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Thu Sep 08 19:18:05 MSK 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index 27309d9..cccdd3d --- a/gradlew +++ b/gradlew @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -154,11 +154,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 832fdb6..f955316 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -49,7 +49,6 @@ goto fail @rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +59,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/settings.gradle b/settings.gradle index a8251ca..24e1d7b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,18 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + rootProject.name = 'teamcity-github-auth' diff --git a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubAuthSettingsController.java b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubAuthSettingsController.java index 591f064..fd61ec6 100644 --- a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubAuthSettingsController.java +++ b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubAuthSettingsController.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import jetbrains.buildServer.controllers.BaseController; diff --git a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubLoginException.java b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubLoginException.java index 9aa0785..c9f275d 100644 --- a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubLoginException.java +++ b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubLoginException.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import org.jetbrains.annotations.NonNls; diff --git a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuth.java b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuth.java index e7262f5..a2c3a3e 100644 --- a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuth.java +++ b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuth.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import com.google.common.annotations.VisibleForTesting; diff --git a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuthClient.java b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuthClient.java index aa7533e..18002da 100644 --- a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuthClient.java +++ b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuthClient.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuthLoginController.java b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuthLoginController.java index 2c5e393..fc1a1da 100644 --- a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuthLoginController.java +++ b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubOAuthLoginController.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import jetbrains.buildServer.controllers.AuthorizationInterceptor; diff --git a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubTokenResponse.java b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubTokenResponse.java index 65cfd9c..d49d7c9 100644 --- a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubTokenResponse.java +++ b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubTokenResponse.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import jetbrains.buildServer.log.Loggable; diff --git a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubUser.java b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubUser.java index e23369a..b6dce22 100644 --- a/src/main/java/org/jetbrains/teamcity/githubauth/GitHubUser.java +++ b/src/main/java/org/jetbrains/teamcity/githubauth/GitHubUser.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import jetbrains.buildServer.log.Loggable; diff --git a/src/main/java/org/jetbrains/teamcity/githubauth/LoginViaGitHubOAuthPageExtension.java b/src/main/java/org/jetbrains/teamcity/githubauth/LoginViaGitHubOAuthPageExtension.java index 8973478..fa45a6c 100644 --- a/src/main/java/org/jetbrains/teamcity/githubauth/LoginViaGitHubOAuthPageExtension.java +++ b/src/main/java/org/jetbrains/teamcity/githubauth/LoginViaGitHubOAuthPageExtension.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import jetbrains.buildServer.serverSide.TeamCityProperties; diff --git a/src/main/java/org/jetbrains/teamcity/githubauth/TeamCityCoreFacade.java b/src/main/java/org/jetbrains/teamcity/githubauth/TeamCityCoreFacade.java index 2bae112..dc7a1e9 100644 --- a/src/main/java/org/jetbrains/teamcity/githubauth/TeamCityCoreFacade.java +++ b/src/main/java/org/jetbrains/teamcity/githubauth/TeamCityCoreFacade.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import jetbrains.buildServer.controllers.interceptors.auth.HttpAuthenticationScheme; diff --git a/src/main/resources/META-INF/build-server-plugin-github-auth.xml b/src/main/resources/META-INF/build-server-plugin-github-auth.xml index 0a80a0f..437e627 100644 --- a/src/main/resources/META-INF/build-server-plugin-github-auth.xml +++ b/src/main/resources/META-INF/build-server-plugin-github-auth.xml @@ -1,4 +1,20 @@ + + <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<%-- + ~ Copyright 2000-2020 JetBrains s.r.o. + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --%> + <%--@elvariable id="connection" type="jetbrains.buildServer.serverSide.oauth.OAuthConnectionDescriptor"--%> diff --git a/src/main/resources/buildServerResources/loginViaGitHub.jsp b/src/main/resources/buildServerResources/loginViaGitHub.jsp index a2cdbef..cd778fb 100644 --- a/src/main/resources/buildServerResources/loginViaGitHub.jsp +++ b/src/main/resources/buildServerResources/loginViaGitHub.jsp @@ -1,5 +1,21 @@ <%@ page import="org.jetbrains.teamcity.githubauth.GitHubOAuthLoginController" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ include file="/include-internal.jsp" %> +<%-- + ~ Copyright 2000-2020 JetBrains s.r.o. + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --%> +
Log in using GitHub account
diff --git a/src/test/java/org/jetbrains/teamcity/githubauth/GitHubOAuthTest.java b/src/test/java/org/jetbrains/teamcity/githubauth/GitHubOAuthTest.java index 204bf6c..d40c4dd 100644 --- a/src/test/java/org/jetbrains/teamcity/githubauth/GitHubOAuthTest.java +++ b/src/test/java/org/jetbrains/teamcity/githubauth/GitHubOAuthTest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2000-2020 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.teamcity.githubauth; import com.intellij.openapi.diagnostic.Log4jLogger;