Commit Graph
348 Commits
Author SHA1 Message Date
Stefan Spieker 40206e023c removed some redundant constructs and replaced stringbuilder operations with too few arguments with string concatenation 2019-11-24 16:15:20 +01:00
StefanSpiekerandWadeck Follonier d92b172aaf Set the HttpOnly flag for the page auto-refresh tokens (#4363)
* set HttpOnly flag to prevent cookie read by a malicious script in browser

* Update core/src/main/java/hudson/Functions.java

Co-Authored-By: Wadeck Follonier <Wadeck@users.noreply.github.com>
2019-11-22 10:14:17 +01:00
Daniel Beckanddaniel-beck 90e693b13b Hide password form fields by default (#3991)
* Hide password form fields by default

* Trying to bypass enforced autocompletion by just having a test field at first

Something like onfocus didn't work, you'd tab through form elements
and unless you filled in the user name, changing the form field to
password would cause it to autocomplete.

It looks like, at least in Mac/Firefox, going from plain text to password
in the 'oninput' event handler works. The plain text is revealed neither
with typing nor pasting.

* Update core/src/main/resources/lib/form/password.jelly

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

* Use previously defined value

* Make new password form fields opt-out

* Add support for redacting form secrets in new password field

* Have a password value pre-set in Jelly

* Fix method

* Fix test by clicking on the button to change the password

* Forgot period separator between class and property name
2019-11-13 10:22:40 +01:00
silent-snowmanandMatt Sicker 02522d257c [JENKINS-19887] - Allow time zone to be set on a per user basis (#4113)
* Implement user setting for timezone

* Apply timezone everywhere

* Revert to medium dateStyle

* Simplify and cleanup

* Add javadocs and fix file headers

* Revert auto-changes by IntelliJ

* Add nullable annotation

* Use better display names

* Add tests

* Log a warning when the user's time zone is not valid

* Add username to log statement

* Make suggested change

* Cleaner way of dealing with invalid timezone

* Update core/src/main/resources/hudson/model/TimeZoneProperty/config.jelly

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

* Update tests

* Update config.properties

* Update config.jelly

* Update Functions.java

* Update layout.jelly

* Update Functions.java

* Update TimeZoneProperty.java

* Update TimeZoneProperty.java

* Update config.jelly

* Update config.properties

* Update TimeZonePropertyTest.java

* Update TimeZoneProperty.java

* Update Functions.java
2019-11-01 01:28:28 +03:00
Daniel Beck e084ac66bd Merge pull request #3894 from daniel-beck/auto-refresh-telemetry
Add telemetry for 'auto refresh' feature
2019-10-24 23:46:16 +02:00
Daniel Beck d6c58cfdb6 Add changes from 2.200 2019-10-16 12:22:25 +02:00
Daniel Beck 14b9462d00 Increase logging level to be visible 2019-10-13 01:41:16 +02:00
Daniel Beck f8df1cd432 Address review feedback 2019-10-13 01:11:29 +02:00
Daniel Beck 2b618f36c2 Add telemetry for 'auto refresh' feature 2019-10-13 01:11:29 +02:00
Thomas de Grenier de Latour 96cc9ce0c5 added Functions.urlEncode(String) (#4278) 2019-10-11 09:31:40 +02:00
Oleg Nenashev 531972f113 Merge pull request #4243 from res0nance/infer-types
Use type inference instead of specifying it
2019-10-02 09:46:53 +02:00
Raihaan Shouhell e5d578b617 Use type inference instead of specifying it 2019-10-01 13:30:39 +08:00
Stefan Spieker d408627e9f changed order for compare instead of negating result (Spotbugs RV_NEGATING_RESULT_OF_COMPARETO) 2019-09-29 10:51:34 +02:00
StefanSpieker a26a5db1cf [JENKINS-59164] - Functions#toEmailSafeString() was not really sanitizing the email string (#4185) 2019-09-04 09:30:34 +02:00
Egor18 a9ce57a4e3 Fix always false condition 2019-08-21 00:52:39 -04:00
Jeff Thompson 5731d50d7d Merge branch 'security-stable-2.176' into security-master 2019-07-02 12:43:01 -06:00
Jeff Thompson c31c413865 Merge branch 'security-stable-2.164' into security-stable-2.176 2019-07-02 12:33:27 -06:00
Jeff Thompson ee4ca74771 Merge branch 'security-stable-2.150' into security-stable-2.164 2019-07-02 12:30:25 -06:00
Jeff Thompson 26d65fcbfd Merge branch 'security-stable-2.138' into security-stable-2.150 2019-07-02 12:29:52 -06:00
Matt Sicker 279d8109ed [SECURITY-534] 2019-07-02 12:27:48 -06:00
Gustavo de Souza Bezerra 0e62b68012 [JENKINS-57678] - Change getInstance() (deprecated) to get() (#4042)
* Change getInstance() (deprecated) to get()

* Reverting modifications according review

* Changing for use the variable
2019-06-27 17:24:45 +02:00
Daniel Beck b206e3c588 Remove UI helper function 2019-04-04 22:04:10 +02:00
Daniel Beck 03720d6c83 [FIX JENKINS-40750] Remove cc.xml from core 2019-04-04 22:00:53 +02:00
Josh Soref 264980c707 Java 7: omit explit type in favor of <> 2019-02-20 21:51:03 -05:00
Josh Soref 64ab6e48b5 No need for a boxed double 2019-02-20 21:44:55 -05:00
Jesse Glick a972c43982 Merge pull request #3757 from jglick/generateConsoleAnnotationScriptAndStylesheet
[JENKINS-38719] Console note/annotator script.js URLs must include SESSION_HASH

(cherry picked from commit 0331d47d60)
2018-11-21 09:49:48 +01:00
Matt Sicker f89df720ca Merge branch 'master' into simple-footer-decorators 2018-11-15 15:32:01 -06:00
Jesse Glick b5446558e5 Functions.generateConsoleAnnotationScriptAndStylesheet needs to include the SESSION_HASH in the URL to properly invalidate scripts across restarts. 2018-11-13 12:28:25 -05:00
Matt Sicker 94076ad93c [JENKINS-54325] Add support for multiple footers in SimplePageDecorator
Signed-off-by: Matt Sicker <boards@gmail.com>
2018-11-07 14:42:39 -06:00
Oleg Nenashev ba08ebc97a Refactoring: Cleanup <tt> tags from the Jenkins core Javadoc 2018-09-21 17:47:11 -07:00
Daniel Beck 7c978d954c Clean up at-since 2018-08-13 13:16:34 +02:00
Thorsten Scherler 90670e05c1 [JENKINS-50447] New design and slim down of login page (#3380)
* [JENKINS-50447] New design and slim down of login page

The change will provide a new designed login page that is using no external deps to prevent any possible malvious javascript.
We still allow the user to use the legacy login page, which has not changed the behaviour.

[JENKINS-50447] Implement error case and use final svg jenkins logo

[JENKINS-50447] remove mock up logo

[JENKINS-50447] Fix feet back from jlong

[JENKINS-50447_squash] Use theme css which only contains values to be overriden. Drop ie js since with the theme css it is not needed anymore

* [JENKINS-50447_squash] Fix expression to evaluate when to show an error and when to simply redirect

* eslint - formating changes and fix offences

* [JENKINS-50447_squash] Use system property to controll whether or not to use the legacy login

* [JENKINS-50447_squash] prevent that the jsessionId appears in the url which should fix most tests

* [JENKINS-50447_squash] Fix cli test by adding pageDecorators magic from layout.jelly

* [JENKINS-50447_squash] remove pageDecorators because they assume existence of js that we do not have

* [JENKINS-50447] New design and slim down of login page

The change will provide a new designed login page that is using no external deps to prevent any possible malvious javascript.
We still allow the user to use the legacy login page, which has not changed the behaviour.

[JENKINS-50447] Implement error case and use final svg jenkins logo

[JENKINS-50447] remove mock up logo

[JENKINS-50447] Fix feet back from jlong

[JENKINS-50447_squash] Use theme css which only contains values to be overriden. Drop ie js since with the theme css it is not needed anymore

[JENKINS-50447_squash] Fix expression to evaluate when to show an error and when to simply redirect

eslint - formating changes and fix offences

[JENKINS-50447_squash] Use system property to controll whether or not to use the legacy login

[JENKINS-50447_squash] prevent that the jsessionId appears in the url which should fix most tests

[JENKINS-50447_squash] Fix cli test by adding pageDecorators magic from layout.jelly

[JENKINS-50447_squash] remove pageDecorators because they assume existence of js that we do not have

[JENKINS-50447_squash] make login page extensible with pagedecorators

[JENKINS-50447_squash] drop legacy support

* Make theme customisable by using a magic package for css and header. Limiting the implemetation of those to one.

* [JENKINS-50447_squash] Creating a specific decorator for login which only returns one instance

* [JENKINS-50447_squash] using rounded corner

* JENKINS-50447 remove legacy code

* [JENKINS-50447_squash] Fix comments from @amuniz about javadoc and uniqueness of css for login

* [JENKINS-50447_squash] Fix click on label span to toggle the select of the checkbox

* [JENKINS-50447_squash] fix comments from @daniel-beck

* [JENKINS-50447_squash] Fix license headers

* [JENKINS-50447_squash] Implement loading/restarting and signup with same design

* [JENKINS-50447_squash] Implement the loading/restarting view and signup with same design as the login page

* [JENKINS-50447_squash] Remove limitation that only one validation error can be shown at a time

* [JENKINS-50447_squash] implement password strength checker

* [JENKINS-50447_squash] Fix different comments from @daniel-beck regarding titles. Further enhanced spacing of label and input

* [JENKINS-50447_squash] Fix restart screen css. Fix comments regarding signup page.

* [JENKINS-50447_squash] fix tabindex flow

* harmonize design
- of checkboxes using jdl styles.
- distance of headers

* [JENKINS-50447] Fix comments from @daniel-beck
- fix some accessibility issues
-- html has now a lang tag
-- define main region
- fix missplaced }
- fix when server down for real that we still show the loading page

* [JENKINS-50447_squash] should never ended up here
2018-06-17 18:02:37 +02:00
Daniel Beck 7c23884c59 [FIX JENKINS-50748] Handle null arg to jsStringEscape 2018-04-12 09:45:30 +02:00
Jan Zuchhold 006c51256e [JENKINS-48593] - Add getSystemProperty(key) to fix hudson.consoleTailKB system property (#3200)
* Add getSystemProperty(key) to fix hudson.consoleTailKB system property

* Add Javadoc, @Restricted and delegate to SystemProperties

These changes were requested by @daniel-beck.

* PR was not merged in time for 2.96

* Changes as requested by @oleg-nenashev
2017-12-22 14:36:34 +01:00
Wadeck Follonier b7f42b2e59 [JENKINS-27027] Notify the SecurityListener on authentication (#3074)
* [JENKINS-27026] Notify the SecurityListener in case of Token based authentication success
- due the current version of the method, the UserDetails required for the event was not accessible. In order to stay with the same API in SecurityListener, two "protected" methods were created to split the job and let the UserDetails accessible

* - add test to ensure the SecurityListener is called for REST Token but also for regular basic auth

* - remove the comment about the split, will be put in GitHub comment instead

* - add check for anonymous call instead of just putting a comment
- remove the constructor in the dummy
- add link to PR from Daniel to simplify a call

* - separate the before/after to save one clear and be more explicit
- put more meaning in the assertLastEventIs method by explicitly say we will remove the last event

* - add comment about why we do not fire the "failedToAuthenticated" in the case of an invalid token (tips: it's because it could be a valid password)

* - also add the authenticated trigger on legacy filter as pointed by Ivan

* - add support of event on CLI remoting authentication
- adjust tests by moving the helper class used to spy on events

* - as mentioned Yvan, the code had some problems with null checking, so the approach is changed in order to encapsulate all that internal mechanism

* - add javadoc
- open the getUserDetailsForImpersonation from the User (will let the SSHD module to retrieve UserDetails from that)

* - remove single quote in log messages

* - basic corrections requested by Jesse

* - just another typo

* - adjust the javadoc for SecurityListener events

* - add the link to Jenkins#Anonymous

* - add link (not using see)

* - update comment on the isAnonymous as we (me + Oleg) do not find a best place at the moment

* - put the new method isAnonymous in ACL instead of Functions

* - little typo
- add requirement about the SecurityContext authentication
2017-12-14 20:44:54 +01:00
Oleg Nenashev 8824857752 Add default implementations of deprecated methods of BuilableItem and Item. (#3142)
* Add default implementations to deprecated methods of BuilableItem and Item.

Currently the interface requires the API user to implement already deprecated methods.
It does not make much sense, and the API could be simplified.

* Address comments from @jglick
2017-12-01 10:00:49 +03:00
Jesse Glick 5f8f42624e Introducing ItemGroup.allItems and similar default methods (#3148)
* Introducing ItemGroup.allItems and similar default methods.

* Do not get me started.
2017-11-28 12:28:50 +03:00
Jesse Glick aebb3b235b Clarifying relation between host/port variables as used by Remoting-based CLI vs. other protocol clients. 2017-10-27 10:37:46 -04:00
Devin Nusbaum 562a7fc2d3 [JENKINS-36282] Add support to cc.xml for exporting jobs in folders recursively (#3060)
* Add support for exporting jobs in folders recursively

* Convert cc.xml into a Groovy view

* Revert "Convert cc.xml into a Groovy view"

This reverts commit 990ec3ebfb.

* Move logic in jelly view to static method
2017-10-13 11:40:56 +02:00
Jesse Glick d13b1361e1 Adding some interface default method implementations (#2879)
* Adding some interface default method implementations rather than catching AbstractMethodError or providing partial implementation classes.

* Show Javadoc warnings and errors, but not ‘Generating …/core/target/site/apidocs/jenkins/model/lazy/class-use/AbstractLazyLoadRunMap.html...’ and the like.

* Javadoc fixes.

* Review comments from @oleg-nenashev.

* Test fixes.

* Remove the unused import
2017-05-20 12:32:52 +02:00
Jesse Glick 7c16d8dc46 Fix Javadoc generation on JDK 8. 2017-04-11 09:26:45 -04:00
Daniel Beck 2a03dda885 Reference redirectors and jenkins.io as much as possible (#2756)
* Reference redirectors and jenkins.io as much as possible

* Something went wrong, so this is a troubleshooting URL

* More specific redirect URLs
2017-02-25 19:56:01 +01:00
Jesse Glick 6386257578 @daniel-beck forgot to update since tags when merging #1485. 2017-02-14 14:51:06 -05:00
Josh Soref 496703d0fe Spelling fixes in changelogs, Javadoc, logs and UI (#2718)
* spelling: abstract

* spelling: about

* spelling: absolute

* spelling: across

* spelling: activity

* spelling: actually

* spelling: addition

* spelling: allocating

* spelling: ambiguous

* spelling: analyzes

* spelling: analysis

* spelling: another

* spelling: appear

* spelling: arbitrary

* spelling: artifact

* spelling: assignment

* spelling: associated

* spelling: augment

* spelling: authentication

* spelling: automatically

* spelling: available

* spelling: availability

* spelling: because

* spelling: background

* spelling: beginning

* spelling: boolean

* spelling: browsers

* spelling: building

* spelling: calculation

* spelling: channel

* spelling: column

* spelling: concatenation

* spelling: connect

* spelling: contribute

* spelling: convert

* spelling: copied

* spelling: couldn't

* spelling: scrambled

* spelling: creates-a

* spelling: curr-entry

* spelling: customize

* spelling: diagnostic

* spelling: contain

* spelling: default

* spelling: delimiter

* spelling: descriptor

* spelling: disambiguates

* spelling: different

* spelling: diligently

* spelling: disabled

* spelling: discovered

* spelling: display

* spelling: doesn't

* spelling: dollar

* spelling: downstream

* spelling: dynamically

* spelling: preemptively

* spelling: encrypt

* spelling: erroneous

* spelling: examine

* spelling: existence

* spelling: value

* spelling: february

* spelling: handling

* spelling: hostname

* spelling: convenient

* spelling: identify

* spelling: implementation

* spelling: incorrect

* spelling: individual

* spelling: initialization

* spelling: initialized

* spelling: inputstream

* spelling: instantiated

* spelling: instantiation

* spelling: intended

* spelling: interpreted

* spelling: interrupted

* spelling: invocations

* spelling: kern

* spelling: localization

* spelling: logger

* spelling: malfunctioning

* spelling: methods

* spelling: monitor

* spelling: mutator

* spelling: multiple

* spelling: object

* spelling: configured

* spelling: optionally

* spelling: option

* spelling: overridden

* spelling: parameterized

* spelling: parent

* spelling: permissions

* spelling: plugin

* spelling: potentially

* spelling: preferable

* spelling: problems like

* spelling: programmatically

* spelling: property

* spelling: reallocate

* spelling: recommended

* spelling: redirected

* spelling: registered

* spelling: reliable

* spelling: remember

* spelling: recurrence

* spelling: repeatable

* spelling: repeated

* spelling: resource

* spelling: retrieve

* spelling: returned

* spelling: revision

* spelling: sandwich

* spelling: separator

* spelling: serialization

* spelling: settings

* spelling: shadow

* spelling: should

* spelling: someone

* spelling: source

* spelling: specified

* spelling: style

* spelling: subversion

* spelling: sufficient

* spelling: supplementary

* spelling: suppressing

* spelling: synchronization

* spelling: synchronized

* spelling: this

* spelling: transitioning

* spelling: termination

* spelling: trying

* spelling: truncatable

* spelling: unknown

* spelling: undeployed

* spelling: unnecessary

* spelling: unparseable

* spelling: update

* spelling: upper

* spelling: verify

* spelling: visible

* spelling: warning

* spelling: we're

* spelling: whitespace

* spelling: wide

* spelling: with

* spelling: workspace

* spelling: yielding

* spelling: to

* spelling: by

* spelling: the

* spelling: hours
2017-02-12 13:38:30 +03:00
Jesse Glick 76aa0727f0 Functions.printStackTrace utility method. 2016-12-12 17:56:24 -05:00
Jesse Glick 7f4ce02e42 Handle circular references. 2016-12-12 16:14:48 -05:00
Jesse Glick 187731fd88 Check for printStackTrace overrides. 2016-12-12 16:06:57 -05:00
Jesse Glick da54171682 Handle suppressed exceptions. 2016-12-12 16:00:30 -05:00
Jesse Glick 2abddbdfcc Merge branch 'master' into printStackTrace-JDK-6507809 2016-12-12 14:25:12 -05:00
Jesse Glick c31392d140 [JENKINS-36476] Underprivileged users could not use the default value of a password parameter (#2454)
* [FIXED JENKINS-36476] Do not even send the default password in encrypted form; leave the text field blank, and apply the default upon submission.

* [JENKINS-36476] Use a special token, not the empty string, as the marker for the default value.
2016-07-16 22:14:48 +03:00