Commit Graph

27237 Commits

Author SHA1 Message Date
Ludovic Orban 08a829fdd2 #9145 fix ee8 openid module
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-27 17:44:09 +01:00
Simone Bordet ded18f523d
Fixes #9166 - Jetty 12: review/remove ByteBufferPool (#9195)
* Fixes #9166 - Jetty 12: review/remove ByteBufferPool

* Replaced usages of ByteBufferPool with RetainableByteBufferPool.
* Removed ByteBufferPool and related classes.
* Renamed oej.http2.frames.DataFrame.getData() -> getByteBuffer() for consistency.
* Removed Accumulator.acquire(), and updated code to use RetainableByteBufferPool.acquire() instead.
* Fixed HttpOutput callbacks to correctly call super.onCompleteSuccess() and super.onCompleteFailure().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 13:40:49 +01:00
Joakim Erdfelt 63d963d526
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-01-26 14:47:19 -06:00
Joakim Erdfelt 07d36f727f
Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x 2023-01-26 14:25:18 -06:00
Joakim Erdfelt beee5ffff0
Merge pull request #9197 from eclipse/jetty-10.0.x-jenkinsfile-agent-none
use agent none so we do not steal an agent doing nothing except waiting for parallel builds to finish"
2023-01-26 09:27:05 -06:00
Joakim Erdfelt 7f0294d4e5
Jetty 12 - Move test JPMS out of main `module-info.java` (#9203)
* Move test jpms out of main module-info.java
* There's no jetty-core/jetty-security anymore
2023-01-26 09:26:27 -06:00
Joakim Erdfelt 177fc234ef
Removing `@Disabled` on `SecuredRedirectHandlerTest` (#9208)
* Removing @Disabled on `SecuredRedirectHandler`
* Fixing javadoc
2023-01-26 09:26:09 -06:00
Joakim Erdfelt 08b9d6b8d9
Jetty 12 - Fixing simple `@named` virtualhost configuration (#9207)
* Fixing simple `@named` virtualhost configuration
* Fixing javadoc comment
2023-01-25 16:11:45 -06:00
Joakim Erdfelt c3ed8134dd
Adding javadoc 2023-01-25 16:06:35 -06:00
Joakim Erdfelt 81f7031cfe
Jetty 12 - Cleanup Shutdown classes (#9201)
* Fixed ShutdownHandler in jetty-core
* Delete ee9 ShutdownHandler
* Rename GracefulShutdownHandler to just GracefulHandler
* Adding graceful Jetty module
* Improved Javadoc + Token encoding tests
2023-01-25 13:54:53 -06:00
Joakim Erdfelt 035b160bdc
Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x 2023-01-25 08:29:50 -06:00
Jan Bartel e271629cfc
Ensure all eeX versions of the plugin use prefix "jetty" (#9156) 2023-01-25 17:36:25 +11:00
Jan Bartel d46f6f7834
Log as info exceptions from server after sending stop with StopMojo. (#9188)
* Log as info exceptions from server after sending stop with StopMojo.
2023-01-25 17:03:04 +11:00
Joakim Erdfelt 7d8dd946cc
Add and allow plural form of existing args. (#9202)
+ new `--modules=<name>,<name>`
+ new `--libs=<classpath>`
+ updated usage.txt
+ updated warning output hint
2023-01-24 16:02:26 -06:00
Greg Wilkins 39e5667f1d
Jetty-12 Remove usage of HandlerList and reduce usage of Handler.Collection (#9191)
* Remove usage of HandlerList and reduce usage of Handler.Collection

"The best part is no part" - Elon Musk!

The overwhelming usage of `HandlerList` and `Handler.Collection` was for adding the `DefaultHandler` after the main handler.  This PR adds a getter/setter for a `DefaultHandler` on the server, so we no longer need to always create a `Handler.Collection` structure.   This has allowed the deprecated `HandlerList` and `HandlerWrapper` classes to be removed.

In implementing this PR, several problems were found in the calculation of `InvocationType`, not least that it was assumed that an empty `Handler.Collection` was `BLOCKING`.  When this issue was fixed, any dynamic addition of contexts (deployer or SPI server) failed as the `InvocationType` changed.  So this PR also introduces the `isDynamic()` attribute of all `Handler.Container`s.  A dynamic container will always return `BLOCKING` from `getInvocationType()`, as there is always a race with a new handler being added.   A non-dynamic container will return a real `InvocationType`, calculated from its children, but it's mutator methods will ISE if contained handlers are changed.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-25 08:08:09 +11:00
Joakim Erdfelt 53fc33161d
Remove junit internals usage. 2023-01-24 13:46:48 -06:00
Jan Bartel ad344c7d23
Uncomment websocket deps for ee9 jetty maven plugin (#9189)
* Uncomment websocket deps for ee9 jetty maven plugin

* Update jetty-ee8-maven-plugin pom
2023-01-24 18:22:35 +11:00
Simone Bordet 8076aa10e7
Fixes implicit narrowing conversion reported in #9166.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-23 19:51:53 +01:00
Joakim Erdfelt 26a4ee5454
Jetty 12 - Introduce `GracefulShutdownHandler` and Test (#9174)
* Introduce GracefulShutdownHandler and test

+ started with removing `@Disabled` from `GracefulStopTest.java`
+ GracefulShutdownHandler based on Callback manipulation
2023-01-23 09:17:27 -06:00
Joakim Erdfelt 7920102702
Issue #9173 - Make wrapping of `ServletApiResponse` easier (#9175)
* Issue #9173 - Make wrapping of ServletApiResponse easier

* Fixing checkstyle and missing licenses
* Improved HttpCookie with javadoc and attribute handling
2023-01-23 08:23:30 -06:00
Olivier Lamy 039503c8e9
no need to use an agent here before the real build
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-01-23 11:44:31 +10:00
Joakim Erdfelt 4993291af0
Wrong value of `RequestDispatcher.FORWARD_CONTEXT_PATH` attribute on root context (#9123)
* Wrong value of RequestDispatcher.FORWARD_CONTEXT_PATH on root context

* Fixes #9119 - uses proper context path that
  satisfies the root context rules of the servlet
  spec

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-01-20 08:16:43 -06:00
Greg Wilkins 99fdd219b7
Jetty 12.0.x 9131 remove path watcher (#9158)
* Reverted to Scanner for PropertyUserStore
* Remove PathWatcher from unassembled fork mode.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
2023-01-20 08:03:27 +11:00
Greg Poulos 06efbcaa7c
Jetty 12.0.x document modules (#9151)
* Add documentation in "Standard Modules" section for the jmx module
* Add documentation in "Standard Modules" section for the ee8,9,10-webapp modules
* Use shorter markup tags to transclude documentation from .mod files
* Extract EE version strings into variables
* Replace literal usages of EE version numbers with custom attribute
* Use convention 'eeN' instead of 'eex' in filenames
* Update metadata tag for deploy module documentation
* Update deploy module documentation to discuss EE platform-specific deploy modules
* Add documentation for the resources module
* Add resources module into section table of contents
* Use jetty-home instead of JETTY_HOME as documentation attribute

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 19:02:42 +01:00
Joakim Erdfelt fc762aea7d
Remove `@Disabled` from more `jetty-core/jetty-server` tests (#9162)
* Remove @Disabled from ConnectorTimeoutTests
* Remove @Disabled from SlowClientsTest
* Remove @Disabled from SslConnectionFactoryTest
* Remove @Disabled from DetectorConnectionTest
* Disabling quiche from checkstyle
* Removing ConnectorTimeoutTest BlockingTimeout tests
  + The concept of HttpConfiguration.blockingTimeout
     has been removed, these tests are no longer relevant
2023-01-19 10:31:51 -06:00
Joakim Erdfelt a37b8523e5
Jetty 12 - Javadoc cleanup & new inspection profile (#9165)
* Adding intellij-javadoc-inspection.xml for Jetty specific Javadoc inspection profile.
* Javadoc cleanup
2023-01-19 10:31:27 -06:00
Simone Bordet 0a002d7785
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 15:23:13 +01:00
Simone Bordet 8a2e8133a9
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 15:11:53 +01:00
Simone Bordet 7fd62668d7
Fixes #9183 - ConnectHandler may close the connection instead of send… (#9184)
* Fixes #9183 - ConnectHandler may close the connection instead of sending 200 OK.

Delaying the call to UpstreamConnection.fillInterested() until the 200 OK response has been sent.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 15:07:22 +01:00
Ludovic Orban f3c229437a
Add latency recording utility handler (#9172)
* #8069 add latency recording handler

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-19 10:27:05 +01:00
Jan Bartel 7005300421 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-01-18 10:24:39 +11:00
Jan Bartel ec9d6e0003 Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x 2023-01-18 09:52:00 +11:00
Piotrek Żygieło 5659e6df5b
Do not execute any phase for maven plugin :start (#9128) 2023-01-18 09:50:20 +11:00
Joakim Erdfelt a06d1a29bb
Jetty 12 - Fix for HttpParser quick HTTP Version lookahead (#9171)
+ Removed the array optimized look ahead
+ version lookahead now done with getInt
+ improved test harness to check lf and crlf endings
+ added HTTP as int optimization
+ fixed bug in near miss of field cache

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-01-18 09:37:55 +11:00
Joakim Erdfelt 6d1e244af6
Merge pull request #9136 from kohlschuetter/jetty-12-NativeImageResourcePath2
* util: Add support for GraalVM Native-Image resource:-URIs and Paths

GraalVM Native-Image makes its classpath resources accessible through an
opaque resource: URL scheme.

Add support for this scheme in URIUtil and PathResource.

Automatically create the NativeImageResourceFileSystem when necessary.
Also add a workaround where converting such Native-Image Paths back to
URI would yield the wrong URI (potentially a bug in GraalVM).

https://github.com/eclipse/jetty.project/issues/9116
https://github.com/oracle/graal/issues/5720

* URIUtil: Suppress CodeQL false positive error about path injection

Github CodeQL code scanning reports a high-severity error "Uncontrolled
data used in path expression", because a path depends on a user-provided
value.

This is a false positive.

Suppress the error by annotating a corresponding @SuppressWarnings tag.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* URIUtil: Removed unused code

KNOWN_SCHEMES isn't used anywhere.

* PathResource: Selectively enable resource: for GraalVM Native Image

In regular HotSpot VMs, the resource: scheme may be registered by other
clients. However, in GraalVM Native Image, this is used for classpath
resources.

This resource scheme needs to be enabled by default for Native Image
environments so we can support code that is unaware of GraalVM
internals, such as:

URL resourceURL = MyClass.class.getResource("some/resource");
Resource resource = ResourceFactory.root().newResource(resourceURL);

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* PathResourceFactory: Ignore certain RuntimeExceptions upon init

Ignore FileSystemAlreadyExistsException, ProviderNotFoundException, etc.
that may be thrown upon calling FileSystems.newFileSystem.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* PathResource: Work-around false positive CodeQL warning

CodeQL prevents amending the call to Paths.get.

Work-around this by using a separate constructor. The additional benefit
is that URIUtil.correctResourceURI won't need to correct the URI twice.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* PathResource: Fix "isAlias" issue with resource: URIs

Fix two more places where Native Image resource: URIs need to be
changed.

Without this change, Resource#isAlias() would return true for such URIs,
and a warning like "BaseResource resource:/some/package/ is aliased to
resource:file:///resources!/some/package/" would be logged.

* Move GraalVM Native-Image code to NativeImagePathResource/-Factory

Keep the GraalVM Native-Image code contained in custom subclasses.

We still enable the "resource:" URL scheme by default if a GraalVM
Native-Image environment is detected via System property. This allows us
to transparently support calls like
ResourceFactory.root().newResource(MyClass.class.getResorce("webapp"))

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* Refactor Graal native-image resource: handling

Detect the resource: scheme by checking the scheme of a well-known
resource instead of looking at a system property.

Rename NativeImagePathResource* to GraalIssue5720PathResource* and make
these classes package-private.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* Only use GraalIssue5720PathResourceFactory when truly needed

Previously, we were always enabling this resource factory for GraalVM
native-image environments.

We now check if that's actually necessary.

We fall back to MountedPathResourceFactory or PathResourceFactory,
depending on whether the URL contains "!/" or not.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>
2023-01-17 13:08:50 -06:00
Greg Poulos e9f31157ad
Documentation: for consistency, convert "JETTY_HOME" attribute to "jetty-home" (#9152) 2023-01-17 15:44:11 +01:00
Greg Wilkins a4ee42944b suppress test stacks 2023-01-17 16:58:55 +11:00
Greg Wilkins 94991c60c0
Jetty 12 temp directory cleanup (#9153)
+ `Server` now has setter/getter for a temp directory, which can be null
 + `Context` now has a getter for a temp directory, which is never null 
 + Server root Context temp directory is either whatever is set, else a work directory, else java.io.tmpdir
 + WebInfConfiguration will still create a temp directory name, but defers to ContextHandler for creation/persistence of the temp directory
 + temp directory (and BASE) removed from the deployer, as it is now the server temp directory.
2023-01-17 11:44:09 +11:00
Christian Kohlschütter cdea111d3f Only use GraalIssue5720PathResourceFactory when truly needed
Previously, we were always enabling this resource factory for GraalVM
native-image environments.

We now check if that's actually necessary.

We fall back to MountedPathResourceFactory or PathResourceFactory,
depending on whether the URL contains "!/" or not.
2023-01-16 23:27:53 +01:00
Christian Kohlschütter 30ffbcb7e4 Merge remote-tracking branch 'upstream/jetty-12.0.x' into jetty-12-NativeImageResourcePath2 2023-01-16 18:48:04 +01:00
Joakim Erdfelt be3b8f0b9d
Issue #9167 - making assumption in flaky test 2023-01-16 11:33:43 -06:00
Olivier Lamy 58f5e468fc
jetty 12.0.x cleanup duplicate osgi pom metadata (#9093)
* fix naming convention, artifactId == directtory, add comment on maven-eclipse-plugin
* cleanup dependencies from jetty-ee9 osgi
* cleanup dependencies from jetty-ee10 osgi
* remove maven-eclipse-plugin configuration
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-01-16 11:39:37 +10:00
Joakim Erdfelt 8374860661
Jetty 12 - Add tests in util/resource for alternate FileSystem implementations (#9149)
* Add tests in util/resource for alternate FileSystem implementations
2023-01-13 09:45:42 -06:00
Greg Wilkins 8b3bcc3a50
Cleanup non-retainable `Retainable`s (#9159)
`Retainable`s that return false from `canRetain()` now are noops if `retain()` is called, which allows for a simpler calling convention.
`AsyncContent` has also been reworked to allocate less and be clearer in its use of `canRetain()`.
2023-01-13 10:37:16 +01:00
Simone Bordet 46355c6110
Fixes retainability of special Chunks (#9073)
* Fixes #8993 - Retainability of special Chunks

* Restored Jetty 11's AsyncContentProducer and related classes in jetty-ee9-nested module (src and test).
* Introduced Retainable.canRetain().
* Removed Chunk.isTerminal() and replaced it with alternative method calls.
* Clarified AsyncContent.write() in case of Chunk.Error.
* Removed AsyncContent.write(Chunk, Callback) because it was making the API confusing.
  For example, AsyncContent.close() clashing with write(EOF, NOOP), or
  AsyncContent.fail(x) clashing with write(Chunk.Error, NOOP), etc.
* Improved usage of Chunk.from(..., Retainable).
* Improved usage of Chunk.slice().
* Using from() in MultiPart, rather than duplicating code.
* Fixed MultiPart.Parser.Listener.onPartContent() javadocs.
* Renamed non-retaining Chunk.from() to Chunk.asChunk().
* Removed Chunk.slice() methods, inlining them where necessary.
* Carefully reviewed all usages of read()-like methods that return a Retainable instance to make sure it is released.
* Updated HTTP/2 and HTTP/3 usages of Stream.Data to follow the correct retain/release semantic.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-13 01:10:56 +01:00
Olivier Lamy de1f74b132
Merge branch 'jetty-11.0.x' into jetty-12.0.x 2023-01-12 10:31:05 +08:00
Olivier Lamy 779f71ca20
Merge branch 'jetty-10.0.x' into jetty-11.0.x 2023-01-12 10:25:48 +08:00
Jan Bartel 012e7c749e
TCK: Dispatch forward and includes attributes do not meet the spec (#9074)
* Named dispatch includes must not have include attributes set.
2023-01-12 12:37:19 +11:00
Olivier Lamy 7c7a7f3c39
re-enable h3 tests (#8773)
* run h3 tests

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-01-12 09:22:10 +08:00
Joakim Erdfelt 3c63ff2dc6
Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x 2023-01-11 08:17:47 -06:00