Commit Graph
232 Commits
Author SHA1 Message Date
StefanSpiekerandOleg Nenashev 463cd113ba Minor refactorings either for performance or readability (#4845)
Co-authored-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2020-07-17 15:14:46 +01:00
Alessandro Menti b847608ed3 i18n: update the Italian translation 2020-06-29 20:57:12 +02:00
Oleg Nenashev e09f1cd028 Merge pull request #4762 from StefanSpieker/cli_tests
moved test class closer to class and added a test
2020-06-05 23:50:01 +02:00
Stefan Spieker 9da5af317f removed accidently added import 2020-05-31 11:48:10 +02:00
Stefan Spieker ce4cc695bf moved test class closer to class and added a test 2020-05-31 11:06:13 +02:00
Søren A D 90f3047483 Support for bearer tokens in jenkins-cli (#4673)
* added -bearer argument to jenkins-cli

* updated message related to bearer/auth. added warning when both are used anyway.
2020-05-24 17:13:23 +02:00
Stefan Spieker ca167e9c43 minor pom cleanup and switched assertions to junit5 because class was already switched to junit5 2020-04-27 10:43:00 +02:00
Jeff Thompson ce4bc37a0d Remove suppression that were inadvertently merged back in. 2020-01-23 15:04:58 -07:00
Jeff Thompson 348a26f77e Narrow the suppression.
And add TODO connected with JENKINS tickets for relevant issues.
2020-01-23 14:59:51 -07:00
Jeff Thompson ced25e51fd Make sure everything has a justification.
And move a couple of items to the exclude file. If we ever get to a lower threshold, these will show up all over the place.
2020-01-23 14:55:59 -07:00
Jeff Thompson c76ee59810 Add findsecbugs plugin to spotbugs.
And suppress existing warnings. We should clean some of them up, but that's for different PRs.
2020-01-23 14:53:53 -07:00
Jesse Glick 5b5040298f [JEP-222] WebSocket support (#4369)
* Playing with WebSocket connections.

* Pluggable handlers.

* errorWithoutStack

* Server-side keepalive pings.

* Redesigned to work as an HttpResponse.

* Unused dep.

* Comment on JnlpSlaveRestarterInstaller.

* Sketch of WebSocket-based endpoint for JNLPLauncher.

* Comment.

* Test enhancement.

* Making it more obvious from JNLPLauncherTest where remoting.jar is being loaded from.

* Reworked protocol to negotiate remote capabilities.

* Unhelpful comment.

* Simplifying handshake to use HTTP headers.

* Moving code into top-level classes and otherwise prettifying.

* Linking to upstream PRs.

* Timestamped snapshot + incremental.

* Picking up incrementalified build of winstone.

* Working around https://github.com/kohsuke/access-modifier/pull/17.

* Finally have an incrementalified build of remoting.

* Use -webSocket option.

* Handling some close and error methods.

* Sending X-Remoting-Minimum-Version.

* If hudson.remoting.jnlp.Main._main fails, show the error.

* Comment.

* GUI analogue of https://github.com/jenkinsci/remoting/pull/357/commits/86cea5b83fd2fc93a9fc10896962eb42c95f80a0.

* Missing since tags.

* Capitalization.

* WebSockets.isSupported

* Rather than hiding JNLPLauncher.DescriptorImpl when the TCP port is disabled, always display it, but show form validation appropriate to WebSocket or TCP mode.

* Form validation fixes.

* Minor test improvements.

* Reworked WebSocketAgents to be compatible with JnlpAgentReceiver.

* Removing WebSocketSession.keepAlive in favor of a global setting applicable to all services.

* Add a -webSocket option to the Jenkins CLI.

* Using a snapshot deployment of Remoting, pending INFRA-2379.

* After #3838 there is no reason to recheck authentication after parsing CLICommand arguments.

* Advertise the -webSocket option.

* Adapt to newer HtmlUnit.

* https://github.com/HtmlUnit/htmlunit/pull/29 seems to have been incompatible.
WebClient.addRequestHeader will no longer override a header in a WebRequest,
such as when the same WebClient/WebRequest was previously used with different headers.

* Tracked down a behavioral change in passing through URL-encoded path characters.
https://github.com/HtmlUnit/htmlunit/commit/2c4956863420e4baef9d3d8c23ec0577ec64d2bf picks up
https://github.com/apache/httpcomponents-client/commit/8c04c6ae5e5ba1432e40684428338ce68431766b which is the actual change.

* Disabled TCP port does not matter in WebSocket mode.

* Shade dependencies needed for jenkins-cli.jar.

* Help text edit.

* https://github.com/jenkinsci/winstone/pull/79 was released as 5.5.

* https://github.com/jenkinsci/jenkins-test-harness/pull/183 released as 2.59.

* https://github.com/jenkinsci/jenkins/pull/4387#discussion_r362696234

* Bumping remoting to a new deployed snapshot.

* Need https://github.com/jenkinsci/winstone/pull/86.

* https://github.com/jenkinsci/winstone/pull/86 released as 5.6.

* Introduced constant for X-Remoting-Minimum-Version.

* s/slave/agent/ in GUI

* Removing in-JVM test, as it was no longer useful after introducing shading anyway.

* Bump.

* No need to check for anonymous CONNECT here.

* s/jenkins.slaves/jenkins.agents/g for new code.

* Restrict the diagnostic endpoint to administrators.

* Fixed Javadoc import after package move.

* https://github.com/jenkinsci/remoting/pull/357 released as 4.0.
2020-01-21 07:00:39 +01:00
René Scheibe 7a3699d3f4 Fix issues in properties files
- trailing spaces ` ` after backslash `\` for multi-line entries
- missing backslash `\` for multi-line entries
- missing escaping of the key/value separator colon `:` when used literally
- missing key/value separator `=`
- duplicate entries
- extra content without a key
2020-01-06 21:34:43 +01:00
Jesse Glick 8c81991ec0 Race condition in PlainCLIProtocolTest. 2019-11-26 09:03:58 -05:00
StefanSpieker 5057edae53 introduced junit5 as testing backend for cli tests (#4220) 2019-11-18 11:18:22 +01:00
Jesse Glick 642a4ff0f3 jenkins-cli.jar no longer needs to bundle remoting. 2019-11-08 17:28:37 -05:00
Oleg Nenashev 41a13dffc6 Merge pull request #4308 from basil/javadoc
Javadoc cleanup
2019-11-01 01:30:33 +03:00
Mustafa Ulu 84d9076e32 Localization files should end with line feed
Translation tool can append new keys to end of existing files. If a properties file does not end with line feed than the first new key will be appended to the last line of that file.

For example a line like "key=value" will become "key=valueappendedKey=appendedValue"
2019-10-26 14:14:04 +03:00
Basil Crow 20786f087b Fix dangling Javadocs 2019-10-19 14:02:59 -07:00
Oleg Nenashev abf4695421 Merge pull request #4263 from daniel-beck/JENKINS-59267
[JENKINS-59267] Increase ping frequency to prevent timeouts, and make it configurable
2019-10-06 11:31:31 +02:00
Daniel Beck 84b07be2b7 [JENKINS-59267] Increase ping frequency to prevent timeouts 2019-10-04 14:39:41 +02:00
a544a3b3b2 Extracted duplicate code (#4206)
* extracted duplicate code into helper method

* merged two identical switch statements

* Update cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java

Co-Authored-By: Matt Sicker <boards@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Oleg Nenashev <o.v.nenashev@gmail.com>

* Update cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java

Co-Authored-By: Tim Jacomb <t.jacomb@kainos.com>

* renamed method as suggested by timja
2019-09-28 10:29:13 +02:00
StefanSpieker 69a524ab0b Fixed deprecated warnings without changing behaviour (#4177)
* fixed deprecated warnings without changing behaviour

* use Charset.defaultCharset() instead of null
2019-09-13 09:45:34 +02:00
Raihaan Shouhell a7e804399c Replace Apache Commons Codec Base64 implementations with standard java.util.Base64 (#4169)
* Replace apache base64 with java

* Swap to regular encoder
2019-09-04 00:08:15 +02:00
ThomasPerkins1123 f0363a5739 Add unit tests for hudson.cli.HexDump (#4058)
* Add unit tests for hudson.cli.HexDump

These tests were written using Diffblue Cover.

* Changed byte arrays to work for windows
2019-07-03 16:32:57 +02:00
suren a205a20bd1 Remove All localized files of Chinese 2019-05-02 19:18:04 +08:00
Jesse Glick 545bf0facd Removing forgotten mention of now-deleted -remoting CLI option. 2019-04-19 16:50:02 -04:00
Ivan Fernandez Calvo 46cbaf51e8 [JENKINS-56167] Replace Trilead-ssh2 PEMParser class (#3902)
* [JENKINS-56167] Replace Trilead-ssh2 PEMParser class by Mina SSHD SecurityUtils.loadKeyPairIdentity implementation

* Update PrivateKeyProviderTest.java

* Update cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java

Co-Authored-By: kuisathaverat <kuisathaverat@users.noreply.github.com>

* Update PrivateKeyProviderTest.java

* Update PrivateKeyProvider.java

* Update PrivateKeyProviderTest.java

* Update PrivateKeyProvider.java
2019-02-25 10:11:42 +01:00
Oleg Nenashev 621be2a4ce Merge pull request #3899 from jsoref/properties-quotes
Fix single quotes in properties files
2019-02-15 13:17:47 +01:00
Josh Soref f73e15516f Fix single quotes in properties files
Embarrassingly, one of these is from my PR #3588
2019-02-14 19:24:45 -05:00
Jesse Glick f150370166 Forgotten @Deprecated. 2019-02-14 14:45:52 -05:00
Jesse Glick f7ff281997 Removing code to support the Remoting-based CLI. 2019-01-08 22:39:07 -05:00
Francisco Fernández f6ef70a8d4 [JENKINS-54310] java.io.IOException: Stream is closed when the CLI has not read entirely the input (#3708)
* [JENKINS-54310] read the input at once

* [JENKINS-54310] reading as String

* [JENKINS-54310] Change the approach for those CLI that open a shell
2018-11-07 10:08:52 +03:00
Josh Soref 0aea34735d cli: Fix up usage message (#3676)
The properties file naively assumed that leading spaces would be honored.
-- They are not. To get some indentation, one needs to escape a space first.

Further, for no particular reason, the last paragraph had a hard wrap.

Finally, since this commit has to reindent the entire block, fix the alignment of the `:`s
for most of the options.
(-auth is a mess and should be rewritten)
2018-10-09 09:20:34 +02:00
Oleg Nenashev 56c6571d73 [JENKINS-53792] - Update CLI help to advertise usage of credential files (#3684)
* [JENKINS-53792] - Update CLI help to advertise usage of credential files

* [JENKINS-53792] - Use redirect as suggested by @daniel-beck
2018-10-07 19:19:36 +02:00
Francisco Fernández e998a7808f [JENKINS-53792] Env vars to configure CLI -auth option (#3653)
* [JENKINS-53792] Add env vars for auth option

* [JENKINS-53792] Fix encoding after first commit

* [JENKINS-53792] Better readability

* [JENKINS-53792] Refactor and use the ApiToken

* [JENKINS-53792] Fix encoding
2018-10-06 16:05:38 +02:00
Oleg Nenashev 0795e89b30 Merge pull request #3642 from oleg-nenashev/build/javadoc-tt-tag
Javadoc: cleanup `tt` tags from Javadoc (prohibited in JDK11)
2018-09-21 19:10:21 -07:00
Oleg Nenashev b5be66014c [JENKINS-53693] - Update PowerMock and Mockito to a Java11-compatible version (#3637)
* [JENKINS-53693] - Update PowerMock and Mockito to a Java11-compatible version

* [JENKINS-53693] - Fix tests which depend on mocking

* [JENKINS-53693] - Apply fixes to PowerMock
2018-09-21 19:08:35 -07:00
Oleg Nenashev d9d31f9914 Cleanup Javadoc errors in hudson.cli.PrivateKeyProvider (fails in Java 11) 2018-09-21 17:47:03 -07:00
Jesse Glick 0268cc9929 Remove ${build.version} property in favor of ${project.version}. 2018-05-09 15:17:02 -04:00
Oleg Nenashev bb89137596 Merge pull request #3338 from oleg-nenashev/findbugs/JENKINS-50064
Cleanup FindBugs in CLI + some refactoring
2018-03-18 06:59:38 +01:00
Jesse Glick f9e4df59d5 Merge branch 'master' into anonymous-warning-JENKINS-49994 2018-03-12 12:24:31 -04:00
Oleg Nenashev 5e0e553353 [JENKINS-50064] - Suppress FindBugs warning in CLI, switch to the medium level 2018-03-10 21:54:43 +01:00
Jesse Glick d94049cc71 https://github.com/kohsuke/localizer/pull/11 actually works now. 2018-03-09 12:51:56 -05:00
Jesse Glick 73b16084f9 [JENKINS-49994] Warn about Remoting serialization of anonymous inner classes and their ilk. 2018-03-07 14:52:34 -05:00
Jesse Glick d3645f7dfe Updating Powermock and Objenesis to avoid Mockito/Hamcrest library mismatches. 2017-12-08 10:44:58 -05:00
Gentle Yang 8bb8057e8d update to the newest version 2017-11-27 21:33:23 +08:00
Gentle Yang 125cf9d8f1 Create Messages_zh_CN.properties 2017-11-25 22:07:19 +08:00
Alessandro Menti 2934c7b945 Update the Italian localization 2017-10-12 20:34:05 +02:00
Jesse Glick 5e84c5470f [JENKINS-18114] Fixing CLI crumbs (#3019)
* [JENKINS-18114] The CLI client already asks for a crumb; we just to actually serve it, from CrumbIssuer.RestrictedApi.

* serveCliActionToAnonymousUserWithoutPermissions() was checking some stuff better checked by authentication(), and was failing since this fake client was not passing a crumb.

* Bring back CliCrumbExclusion, needed for anonymous use with no read access, and just let the client stop asking for a crumb.

* Added FullDuplexHttpServiceTest; useful to have a simple, self-contained demonstration of the HTTP Duplex transport.
2017-09-22 11:55:52 +03:00