├── .github └── workflows │ └── ci.yml ├── .gitignore ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── SECURITY.md ├── benchmarks ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── undertow │ │ └── benchmarks │ │ ├── AsciiEncoders.java │ │ ├── AsciiEncodingBenchmark.java │ │ ├── BenchmarkUtils.java │ │ ├── SimpleBenchmarkState.java │ │ ├── SimpleBenchmarks.java │ │ └── TLSUtils.java │ └── resources │ ├── client.keystore │ ├── client.truststore │ ├── logging.properties │ ├── server.keystore │ └── server.truststore ├── core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── undertow │ │ │ ├── Handlers.java │ │ │ ├── Undertow.java │ │ │ ├── UndertowLogger.java │ │ │ ├── UndertowMessages.java │ │ │ ├── UndertowOptions.java │ │ │ ├── Version.java │ │ │ ├── attribute │ │ │ ├── AuthenticationTypeExchangeAttribute.java │ │ │ ├── BytesSentAttribute.java │ │ │ ├── CompositeExchangeAttribute.java │ │ │ ├── ConstantExchangeAttribute.java │ │ │ ├── CookieAttribute.java │ │ │ ├── DateTimeAttribute.java │ │ │ ├── ExchangeAttribute.java │ │ │ ├── ExchangeAttributeBuilder.java │ │ │ ├── ExchangeAttributeParser.java │ │ │ ├── ExchangeAttributeWrapper.java │ │ │ ├── ExchangeAttributes.java │ │ │ ├── HostAndPortAttribute.java │ │ │ ├── IdentUsernameAttribute.java │ │ │ ├── LocalIPAttribute.java │ │ │ ├── LocalPortAttribute.java │ │ │ ├── LocalServerNameAttribute.java │ │ │ ├── NullAttribute.java │ │ │ ├── PathParameterAttribute.java │ │ │ ├── PredicateContextAttribute.java │ │ │ ├── QueryParameterAttribute.java │ │ │ ├── QueryStringAttribute.java │ │ │ ├── QuotingExchangeAttribute.java │ │ │ ├── ReadOnlyAttributeException.java │ │ │ ├── RelativePathAttribute.java │ │ │ ├── RemoteHostAttribute.java │ │ │ ├── RemoteIPAttribute.java │ │ │ ├── RemoteObfuscatedIPAttribute.java │ │ │ ├── RemoteUserAttribute.java │ │ │ ├── RequestCookieAttribute.java │ │ │ ├── RequestHeaderAttribute.java │ │ │ ├── RequestLineAttribute.java │ │ │ ├── RequestMethodAttribute.java │ │ │ ├── RequestPathAttribute.java │ │ │ ├── RequestProtocolAttribute.java │ │ │ ├── RequestSchemeAttribute.java │ │ │ ├── RequestURLAttribute.java │ │ │ ├── ResolvedPathAttribute.java │ │ │ ├── ResponseCodeAttribute.java │ │ │ ├── ResponseCookieAttribute.java │ │ │ ├── ResponseHeaderAttribute.java │ │ │ ├── ResponseReasonPhraseAttribute.java │ │ │ ├── ResponseTimeAttribute.java │ │ │ ├── SecureExchangeAttribute.java │ │ │ ├── SecureProtocolAttribute.java │ │ │ ├── SslCipherAttribute.java │ │ │ ├── SslClientCertAttribute.java │ │ │ ├── SslSessionIdAttribute.java │ │ │ ├── StoredResponse.java │ │ │ ├── SubstituteEmptyWrapper.java │ │ │ ├── ThreadNameAttribute.java │ │ │ └── TransportProtocolAttribute.java │ │ │ ├── channels │ │ │ ├── DetachableStreamSinkChannel.java │ │ │ └── DetachableStreamSourceChannel.java │ │ │ ├── client │ │ │ ├── ALPNClientSelector.java │ │ │ ├── ClientCallback.java │ │ │ ├── ClientConnection.java │ │ │ ├── ClientExchange.java │ │ │ ├── ClientProvider.java │ │ │ ├── ClientRequest.java │ │ │ ├── ClientResponse.java │ │ │ ├── ClientStatistics.java │ │ │ ├── ContinueNotification.java │ │ │ ├── ProxiedRequestAttachments.java │ │ │ ├── PushCallback.java │ │ │ ├── UndertowClient.java │ │ │ ├── UndertowClientMessages.java │ │ │ ├── ajp │ │ │ │ ├── AjpClientConnection.java │ │ │ │ ├── AjpClientExchange.java │ │ │ │ └── AjpClientProvider.java │ │ │ ├── http │ │ │ │ ├── ClientFixedLengthStreamSinkConduit.java │ │ │ │ ├── HttpClientConnection.java │ │ │ │ ├── HttpClientExchange.java │ │ │ │ ├── HttpClientProvider.java │ │ │ │ ├── HttpRequestConduit.java │ │ │ │ ├── HttpResponseBuilder.java │ │ │ │ ├── HttpResponseParser.java │ │ │ │ └── ResponseParseState.java │ │ │ └── http2 │ │ │ │ ├── Http2ClearClientProvider.java │ │ │ │ ├── Http2ClientConnection.java │ │ │ │ ├── Http2ClientExchange.java │ │ │ │ ├── Http2ClientProvider.java │ │ │ │ └── Http2PriorKnowledgeClientProvider.java │ │ │ ├── conduits │ │ │ ├── AbstractFixedLengthStreamSinkConduit.java │ │ │ ├── AbstractFramedStreamSinkConduit.java │ │ │ ├── BrokenStreamSourceConduit.java │ │ │ ├── ByteActivityCallback.java │ │ │ ├── BytesReceivedStreamSourceConduit.java │ │ │ ├── BytesSentStreamSinkConduit.java │ │ │ ├── ChunkReader.java │ │ │ ├── ChunkedStreamSinkConduit.java │ │ │ ├── ChunkedStreamSourceConduit.java │ │ │ ├── ConduitListener.java │ │ │ ├── DebuggingStreamSinkConduit.java │ │ │ ├── DebuggingStreamSourceConduit.java │ │ │ ├── DeflatingStreamSinkConduit.java │ │ │ ├── EmptyStreamSourceConduit.java │ │ │ ├── FinishableStreamSinkConduit.java │ │ │ ├── FinishableStreamSourceConduit.java │ │ │ ├── FixedLengthStreamSourceConduit.java │ │ │ ├── GzipStreamSinkConduit.java │ │ │ ├── GzipStreamSourceConduit.java │ │ │ ├── HeadStreamSinkConduit.java │ │ │ ├── IdleTimeoutConduit.java │ │ │ ├── InflatingStreamSourceConduit.java │ │ │ ├── PreChunkedStreamSinkConduit.java │ │ │ ├── RangeStreamSinkConduit.java │ │ │ ├── RateLimitingStreamSinkConduit.java │ │ │ ├── ReadDataStreamSourceConduit.java │ │ │ ├── ReadTimeoutStreamSourceConduit.java │ │ │ ├── StoredResponseStreamSinkConduit.java │ │ │ └── WriteTimeoutStreamSinkConduit.java │ │ │ ├── connector │ │ │ ├── ByteBufferPool.java │ │ │ └── PooledByteBuffer.java │ │ │ ├── io │ │ │ ├── AsyncReceiverImpl.java │ │ │ ├── AsyncSenderImpl.java │ │ │ ├── BlockingReceiverImpl.java │ │ │ ├── BlockingSenderImpl.java │ │ │ ├── BufferWritableOutputStream.java │ │ │ ├── DefaultIoCallback.java │ │ │ ├── IoCallback.java │ │ │ ├── Receiver.java │ │ │ ├── Sender.java │ │ │ ├── UndertowInputStream.java │ │ │ └── UndertowOutputStream.java │ │ │ ├── predicate │ │ │ ├── AndPredicate.java │ │ │ ├── AuthenticationRequiredPredicate.java │ │ │ ├── ContainsPredicate.java │ │ │ ├── EqualsPredicate.java │ │ │ ├── ExistsPredicate.java │ │ │ ├── FalsePredicate.java │ │ │ ├── IdempotentPredicate.java │ │ │ ├── MaxContentSizePredicate.java │ │ │ ├── MethodPredicate.java │ │ │ ├── MinContentSizePredicate.java │ │ │ ├── NotPredicate.java │ │ │ ├── OrPredicate.java │ │ │ ├── PathMatchPredicate.java │ │ │ ├── PathPrefixPredicate.java │ │ │ ├── PathSuffixPredicate.java │ │ │ ├── PathTemplatePredicate.java │ │ │ ├── Predicate.java │ │ │ ├── PredicateBuilder.java │ │ │ ├── PredicateParser.java │ │ │ ├── Predicates.java │ │ │ ├── PredicatesHandler.java │ │ │ ├── RegularExpressionPredicate.java │ │ │ ├── RequestLargerThanPredicate.java │ │ │ ├── RequestSmallerThanPredicate.java │ │ │ ├── SecurePredicate.java │ │ │ ├── TruePredicate.java │ │ │ └── ip │ │ │ │ ├── IPMatchBase.java │ │ │ │ └── IPMatchPredicate.java │ │ │ ├── protocols │ │ │ ├── ajp │ │ │ │ ├── AbstractAjpClientStreamSinkChannel.java │ │ │ │ ├── AbstractAjpClientStreamSourceChannel.java │ │ │ │ ├── AjpClientCPingStreamSinkChannel.java │ │ │ │ ├── AjpClientChannel.java │ │ │ │ ├── AjpClientFramePriority.java │ │ │ │ ├── AjpClientRequestClientStreamSinkChannel.java │ │ │ │ ├── AjpClientResponseStreamSourceChannel.java │ │ │ │ ├── AjpConstants.java │ │ │ │ ├── AjpResponseParser.java │ │ │ │ └── AjpUtils.java │ │ │ ├── alpn │ │ │ │ ├── ALPNEngineManager.java │ │ │ │ ├── ALPNManager.java │ │ │ │ ├── ALPNProvider.java │ │ │ │ ├── DefaultAlpnEngineManager.java │ │ │ │ ├── ModularJdkAlpnProvider.java │ │ │ │ └── OpenSSLAlpnProvider.java │ │ │ ├── http2 │ │ │ │ ├── AbstractHttp2StreamSinkChannel.java │ │ │ │ ├── AbstractHttp2StreamSourceChannel.java │ │ │ │ ├── ConnectionErrorException.java │ │ │ │ ├── HPackHuffman.java │ │ │ │ ├── Hpack.java │ │ │ │ ├── HpackDecoder.java │ │ │ │ ├── HpackEncoder.java │ │ │ │ ├── HpackException.java │ │ │ │ ├── Http2Channel.java │ │ │ │ ├── Http2DataFrameParser.java │ │ │ │ ├── Http2DataStreamSinkChannel.java │ │ │ │ ├── Http2DiscardParser.java │ │ │ │ ├── Http2FrameHeaderParser.java │ │ │ │ ├── Http2FramePriority.java │ │ │ │ ├── Http2GoAwayParser.java │ │ │ │ ├── Http2GoAwayStreamSinkChannel.java │ │ │ │ ├── Http2GoAwayStreamSourceChannel.java │ │ │ │ ├── Http2HeaderBlockParser.java │ │ │ │ ├── Http2HeadersParser.java │ │ │ │ ├── Http2HeadersStreamSinkChannel.java │ │ │ │ ├── Http2NoDataStreamSinkChannel.java │ │ │ │ ├── Http2PingParser.java │ │ │ │ ├── Http2PingStreamSinkChannel.java │ │ │ │ ├── Http2PingStreamSourceChannel.java │ │ │ │ ├── Http2PrefaceStreamSinkChannel.java │ │ │ │ ├── Http2PriorityParser.java │ │ │ │ ├── Http2PriorityTree.java │ │ │ │ ├── Http2ProtocolUtils.java │ │ │ │ ├── Http2PushBackParser.java │ │ │ │ ├── Http2PushPromiseParser.java │ │ │ │ ├── Http2PushPromiseStreamSinkChannel.java │ │ │ │ ├── Http2PushPromiseStreamSourceChannel.java │ │ │ │ ├── Http2RstStreamParser.java │ │ │ │ ├── Http2RstStreamSinkChannel.java │ │ │ │ ├── Http2RstStreamStreamSourceChannel.java │ │ │ │ ├── Http2Setting.java │ │ │ │ ├── Http2SettingsParser.java │ │ │ │ ├── Http2SettingsStreamSinkChannel.java │ │ │ │ ├── Http2SettingsStreamSourceChannel.java │ │ │ │ ├── Http2Stream.java │ │ │ │ ├── Http2StreamSinkChannel.java │ │ │ │ ├── Http2StreamSourceChannel.java │ │ │ │ ├── Http2WindowUpdateParser.java │ │ │ │ ├── Http2WindowUpdateStreamSinkChannel.java │ │ │ │ └── StreamErrorException.java │ │ │ └── ssl │ │ │ │ ├── MechanismDatabase.properties │ │ │ │ ├── SNIAlpnEngineManager.java │ │ │ │ ├── SNIContextMatcher.java │ │ │ │ ├── SNISSLContext.java │ │ │ │ ├── SNISSLContextSpi.java │ │ │ │ ├── SNISSLEngine.java │ │ │ │ ├── SNISSLExplorer.java │ │ │ │ ├── SslConduit.java │ │ │ │ ├── UndertowAcceptingSslChannel.java │ │ │ │ ├── UndertowSslConnection.java │ │ │ │ └── UndertowXnioSsl.java │ │ │ ├── security │ │ │ ├── api │ │ │ │ ├── AuthenticatedSessionManager.java │ │ │ │ ├── AuthenticationMechanism.java │ │ │ │ ├── AuthenticationMechanismContext.java │ │ │ │ ├── AuthenticationMechanismFactory.java │ │ │ │ ├── AuthenticationMode.java │ │ │ │ ├── GSSAPIServerSubjectFactory.java │ │ │ │ ├── NonceManager.java │ │ │ │ ├── NotificationReceiver.java │ │ │ │ ├── SecurityContext.java │ │ │ │ ├── SecurityContextFactory.java │ │ │ │ ├── SecurityNotification.java │ │ │ │ └── SessionNonceManager.java │ │ │ ├── handlers │ │ │ │ ├── AbstractConfidentialityHandler.java │ │ │ │ ├── AbstractSecurityContextAssociationHandler.java │ │ │ │ ├── AuthenticationCallHandler.java │ │ │ │ ├── AuthenticationConstraintHandler.java │ │ │ │ ├── AuthenticationMechanismsHandler.java │ │ │ │ ├── CachedAuthenticatedSessionHandler.java │ │ │ │ ├── NotificationReceiverHandler.java │ │ │ │ ├── SecurityActions.java │ │ │ │ ├── SecurityInitialHandler.java │ │ │ │ └── SinglePortConfidentialityHandler.java │ │ │ ├── idm │ │ │ │ ├── Account.java │ │ │ │ ├── Credential.java │ │ │ │ ├── DigestAlgorithm.java │ │ │ │ ├── DigestCredential.java │ │ │ │ ├── ExternalCredential.java │ │ │ │ ├── GSSContextCredential.java │ │ │ │ ├── IdentityManager.java │ │ │ │ ├── PasswordCredential.java │ │ │ │ └── X509CertificateCredential.java │ │ │ └── impl │ │ │ │ ├── AbstractSecurityContext.java │ │ │ │ ├── AuthenticationInfoToken.java │ │ │ │ ├── BasicAuthenticationMechanism.java │ │ │ │ ├── CachedAuthenticatedSessionMechanism.java │ │ │ │ ├── ClientCertAuthenticationMechanism.java │ │ │ │ ├── DigestAuthenticationMechanism.java │ │ │ │ ├── DigestAuthorizationToken.java │ │ │ │ ├── DigestQop.java │ │ │ │ ├── DigestWWWAuthenticateToken.java │ │ │ │ ├── ExternalAuthenticationMechanism.java │ │ │ │ ├── FormAuthenticationMechanism.java │ │ │ │ ├── GSSAPIAuthenticationMechanism.java │ │ │ │ ├── GenericHeaderAuthenticationMechanism.java │ │ │ │ ├── InMemorySingleSignOnManager.java │ │ │ │ ├── SecurityActions.java │ │ │ │ ├── SecurityContextFactoryImpl.java │ │ │ │ ├── SecurityContextImpl.java │ │ │ │ ├── SimpleNonceManager.java │ │ │ │ ├── SingleSignOn.java │ │ │ │ ├── SingleSignOnAuthenticationMechanism.java │ │ │ │ └── SingleSignOnManager.java │ │ │ ├── server │ │ │ ├── AbstractServerConnection.java │ │ │ ├── AggregateConnectorStatistics.java │ │ │ ├── BasicSSLSessionInfo.java │ │ │ ├── BlockingHttpExchange.java │ │ │ ├── ConduitWrapper.java │ │ │ ├── ConnectionSSLSessionInfo.java │ │ │ ├── ConnectorStatistics.java │ │ │ ├── ConnectorStatisticsImpl.java │ │ │ ├── Connectors.java │ │ │ ├── DefaultByteBufferPool.java │ │ │ ├── DefaultResponseListener.java │ │ │ ├── DelegateOpenListener.java │ │ │ ├── DelegatingIterable.java │ │ │ ├── DirectByteBufferDeallocator.java │ │ │ ├── ExchangeCompletionListener.java │ │ │ ├── HandlerWrapper.java │ │ │ ├── HttpHandler.java │ │ │ ├── HttpServerExchange.java │ │ │ ├── HttpUpgradeListener.java │ │ │ ├── JvmRouteHandler.java │ │ │ ├── ListenerRegistry.java │ │ │ ├── MapDelegatingToSet.java │ │ │ ├── OpenListener.java │ │ │ ├── OverridableTreeSet.java │ │ │ ├── ReadOnlyIterator.java │ │ │ ├── RenegotiationRequiredException.java │ │ │ ├── RequestStatistics.java │ │ │ ├── RequestTooBigException.java │ │ │ ├── ResponseCommitListener.java │ │ │ ├── RoutingHandler.java │ │ │ ├── SSLSessionInfo.java │ │ │ ├── SecureCookieCommitListener.java │ │ │ ├── ServerConnection.java │ │ │ ├── TruncatedResponseException.java │ │ │ ├── XnioBufferPoolAdaptor.java │ │ │ ├── XnioByteBufferPool.java │ │ │ ├── handlers │ │ │ │ ├── AccessControlListHandler.java │ │ │ │ ├── ActiveRequestTrackerHandler.java │ │ │ │ ├── AllowedMethodsHandler.java │ │ │ │ ├── AttachmentHandler.java │ │ │ │ ├── BlockingHandler.java │ │ │ │ ├── BlockingReadTimeoutHandler.java │ │ │ │ ├── BlockingWriteTimeoutHandler.java │ │ │ │ ├── ByteRangeHandler.java │ │ │ │ ├── CanonicalPathHandler.java │ │ │ │ ├── ChannelUpgradeHandler.java │ │ │ │ ├── ConfiguredPushHandler.java │ │ │ │ ├── ConnectHandler.java │ │ │ │ ├── Cookie.java │ │ │ │ ├── CookieImpl.java │ │ │ │ ├── CookieSameSiteMode.java │ │ │ │ ├── DateHandler.java │ │ │ │ ├── DisableCacheHandler.java │ │ │ │ ├── DisallowedMethodsHandler.java │ │ │ │ ├── ExceptionHandler.java │ │ │ │ ├── ForwardedHandler.java │ │ │ │ ├── GracefulShutdownHandler.java │ │ │ │ ├── HttpContinueAcceptingHandler.java │ │ │ │ ├── HttpContinueReadHandler.java │ │ │ │ ├── HttpTraceHandler.java │ │ │ │ ├── HttpUpgradeHandshake.java │ │ │ │ ├── IPAddressAccessControlHandler.java │ │ │ │ ├── JDBCLogHandler.java │ │ │ │ ├── LearningPushHandler.java │ │ │ │ ├── LocalNameResolvingHandler.java │ │ │ │ ├── MetricsHandler.java │ │ │ │ ├── NameVirtualHostHandler.java │ │ │ │ ├── OriginHandler.java │ │ │ │ ├── PathHandler.java │ │ │ │ ├── PathSeparatorHandler.java │ │ │ │ ├── PathTemplateHandler.java │ │ │ │ ├── PeerNameResolvingHandler.java │ │ │ │ ├── PredicateContextHandler.java │ │ │ │ ├── PredicateHandler.java │ │ │ │ ├── ProxyPeerAddressHandler.java │ │ │ │ ├── RedirectHandler.java │ │ │ │ ├── RequestBufferingHandler.java │ │ │ │ ├── RequestDumpingHandler.java │ │ │ │ ├── RequestLimit.java │ │ │ │ ├── RequestLimitingHandler.java │ │ │ │ ├── ResponseCodeHandler.java │ │ │ │ ├── ResponseRateLimitingHandler.java │ │ │ │ ├── SSLHeaderHandler.java │ │ │ │ ├── SameSiteCookieHandler.java │ │ │ │ ├── SecureCookieHandler.java │ │ │ │ ├── SetAttributeHandler.java │ │ │ │ ├── SetErrorHandler.java │ │ │ │ ├── SetHeaderHandler.java │ │ │ │ ├── StoredResponseHandler.java │ │ │ │ ├── StuckThreadDetectionHandler.java │ │ │ │ ├── URLDecodingHandler.java │ │ │ │ ├── accesslog │ │ │ │ │ ├── AccessLogHandler.java │ │ │ │ │ ├── AccessLogReceiver.java │ │ │ │ │ ├── DefaultAccessLogReceiver.java │ │ │ │ │ ├── ExtendedAccessLogParser.java │ │ │ │ │ ├── JBossLoggingAccessLogReceiver.java │ │ │ │ │ └── LogFileHeaderGenerator.java │ │ │ │ ├── builder │ │ │ │ │ ├── HandlerBuilder.java │ │ │ │ │ ├── HandlerParser.java │ │ │ │ │ ├── PredicatedHandler.java │ │ │ │ │ ├── PredicatedHandlersParser.java │ │ │ │ │ ├── ResponseCodeHandlerBuilder.java │ │ │ │ │ └── RewriteHandlerBuilder.java │ │ │ │ ├── cache │ │ │ │ │ ├── CacheHandler.java │ │ │ │ │ ├── CachedHttpRequest.java │ │ │ │ │ ├── DirectBufferCache.java │ │ │ │ │ ├── LRUCache.java │ │ │ │ │ ├── LimitedBufferSlicePool.java │ │ │ │ │ ├── ResponseCache.java │ │ │ │ │ ├── ResponseCachingSender.java │ │ │ │ │ └── ResponseCachingStreamSinkConduit.java │ │ │ │ ├── encoding │ │ │ │ │ ├── AllowedContentEncodings.java │ │ │ │ │ ├── ContentEncodedResource.java │ │ │ │ │ ├── ContentEncodedResourceManager.java │ │ │ │ │ ├── ContentEncodingProvider.java │ │ │ │ │ ├── ContentEncodingRepository.java │ │ │ │ │ ├── DeflateEncodingProvider.java │ │ │ │ │ ├── EncodingHandler.java │ │ │ │ │ ├── EncodingMapping.java │ │ │ │ │ ├── GzipEncodingProvider.java │ │ │ │ │ └── RequestEncodingHandler.java │ │ │ │ ├── error │ │ │ │ │ ├── FileErrorPageHandler.java │ │ │ │ │ └── SimpleErrorPageHandler.java │ │ │ │ ├── form │ │ │ │ │ ├── EagerFormParsingHandler.java │ │ │ │ │ ├── FormData.java │ │ │ │ │ ├── FormDataParser.java │ │ │ │ │ ├── FormEncodedDataDefinition.java │ │ │ │ │ ├── FormParserFactory.java │ │ │ │ │ └── MultiPartParserDefinition.java │ │ │ │ ├── proxy │ │ │ │ │ ├── ConnectionPoolErrorHandler.java │ │ │ │ │ ├── ConnectionPoolManager.java │ │ │ │ │ ├── ExclusivityChecker.java │ │ │ │ │ ├── HostTable.java │ │ │ │ │ ├── LoadBalancingProxyClient.java │ │ │ │ │ ├── ProxyCallback.java │ │ │ │ │ ├── ProxyClient.java │ │ │ │ │ ├── ProxyConnection.java │ │ │ │ │ ├── ProxyConnectionPool.java │ │ │ │ │ ├── ProxyConnectionPoolConfig.java │ │ │ │ │ ├── ProxyHandler.java │ │ │ │ │ ├── ProxyHandlerBuilder.java │ │ │ │ │ ├── RouteIteratorFactory.java │ │ │ │ │ ├── RouteParsingStrategy.java │ │ │ │ │ ├── SimpleProxyClientProvider.java │ │ │ │ │ └── mod_cluster │ │ │ │ │ │ ├── Balancer.java │ │ │ │ │ │ ├── Context.java │ │ │ │ │ │ ├── MCMPAdvertiseTask.java │ │ │ │ │ │ ├── MCMPConfig.java │ │ │ │ │ │ ├── MCMPConstants.java │ │ │ │ │ │ ├── MCMPErrorCode.java │ │ │ │ │ │ ├── MCMPHandler.java │ │ │ │ │ │ ├── MCMPInfoUtil.java │ │ │ │ │ │ ├── MCMPWebManager.java │ │ │ │ │ │ ├── ModCluster.java │ │ │ │ │ │ ├── ModClusterContainer.java │ │ │ │ │ │ ├── ModClusterController.java │ │ │ │ │ │ ├── ModClusterProxyClient.java │ │ │ │ │ │ ├── ModClusterProxyTarget.java │ │ │ │ │ │ ├── ModClusterStatus.java │ │ │ │ │ │ ├── Node.java │ │ │ │ │ │ ├── NodeConfig.java │ │ │ │ │ │ ├── NodeHealthChecker.java │ │ │ │ │ │ ├── NodeLbStatus.java │ │ │ │ │ │ ├── NodePingUtil.java │ │ │ │ │ │ ├── NodeStatus.java │ │ │ │ │ │ └── VirtualHost.java │ │ │ │ ├── resource │ │ │ │ │ ├── CachedResource.java │ │ │ │ │ ├── CachingResourceManager.java │ │ │ │ │ ├── ClassPathResourceManager.java │ │ │ │ │ ├── DefaultResourceSupplier.java │ │ │ │ │ ├── DirectoryUtils.java │ │ │ │ │ ├── FileResource.java │ │ │ │ │ ├── FileResourceManager.java │ │ │ │ │ ├── PathResource.java │ │ │ │ │ ├── PathResourceManager.java │ │ │ │ │ ├── PreCompressedResourceSupplier.java │ │ │ │ │ ├── RangeAwareResource.java │ │ │ │ │ ├── Resource.java │ │ │ │ │ ├── ResourceChangeEvent.java │ │ │ │ │ ├── ResourceChangeListener.java │ │ │ │ │ ├── ResourceHandler.java │ │ │ │ │ ├── ResourceManager.java │ │ │ │ │ ├── ResourceSupplier.java │ │ │ │ │ ├── SecurityActions.java │ │ │ │ │ └── URLResource.java │ │ │ │ └── sse │ │ │ │ │ ├── ServerSentEventConnection.java │ │ │ │ │ ├── ServerSentEventConnectionCallback.java │ │ │ │ │ └── ServerSentEventHandler.java │ │ │ ├── protocol │ │ │ │ ├── ParseTimeoutUpdater.java │ │ │ │ ├── ajp │ │ │ │ │ ├── AjpOpenListener.java │ │ │ │ │ ├── AjpReadListener.java │ │ │ │ │ ├── AjpRequestParseState.java │ │ │ │ │ ├── AjpRequestParser.java │ │ │ │ │ ├── AjpServerConnection.java │ │ │ │ │ ├── AjpServerRequestConduit.java │ │ │ │ │ ├── AjpServerResponseConduit.java │ │ │ │ │ └── SecurityActions.java │ │ │ │ ├── framed │ │ │ │ │ ├── AbstractFramedChannel.java │ │ │ │ │ ├── AbstractFramedStreamSinkChannel.java │ │ │ │ │ ├── AbstractFramedStreamSourceChannel.java │ │ │ │ │ ├── FrameHeaderData.java │ │ │ │ │ ├── FramePriority.java │ │ │ │ │ ├── SendFrameHeader.java │ │ │ │ │ └── ShutdownFallbackExecutor.java │ │ │ │ ├── http │ │ │ │ │ ├── ALPNBannedCiphers.java │ │ │ │ │ ├── ALPNLimitingSSLEngine.java │ │ │ │ │ ├── ALPNOfferedClientHelloExplorer.java │ │ │ │ │ ├── AlpnOpenListener.java │ │ │ │ │ ├── CacheMap.java │ │ │ │ │ ├── HttpAttachments.java │ │ │ │ │ ├── HttpContinue.java │ │ │ │ │ ├── HttpOpenListener.java │ │ │ │ │ ├── HttpReadListener.java │ │ │ │ │ ├── HttpRequestParser.java │ │ │ │ │ ├── HttpResponseConduit.java │ │ │ │ │ ├── HttpServerConnection.java │ │ │ │ │ ├── HttpTransferEncoding.java │ │ │ │ │ ├── ParseState.java │ │ │ │ │ ├── PipeliningBufferingStreamSinkConduit.java │ │ │ │ │ └── ServerFixedLengthStreamSinkConduit.java │ │ │ │ ├── http2 │ │ │ │ │ ├── Http2OpenListener.java │ │ │ │ │ ├── Http2ReceiveListener.java │ │ │ │ │ ├── Http2ServerConnection.java │ │ │ │ │ ├── Http2SslSessionInfo.java │ │ │ │ │ └── Http2UpgradeHandler.java │ │ │ │ └── proxy │ │ │ │ │ ├── ProxyProtocolOpenListener.java │ │ │ │ │ └── ProxyProtocolReadListener.java │ │ │ └── session │ │ │ │ ├── InMemorySessionManager.java │ │ │ │ ├── PathParameterSessionConfig.java │ │ │ │ ├── SecureRandomSessionIdGenerator.java │ │ │ │ ├── Session.java │ │ │ │ ├── SessionAttachmentHandler.java │ │ │ │ ├── SessionConfig.java │ │ │ │ ├── SessionCookieConfig.java │ │ │ │ ├── SessionIdGenerator.java │ │ │ │ ├── SessionListener.java │ │ │ │ ├── SessionListeners.java │ │ │ │ ├── SessionManager.java │ │ │ │ ├── SessionManagerStatistics.java │ │ │ │ └── SslSessionConfig.java │ │ │ ├── util │ │ │ ├── AbstractAttachable.java │ │ │ ├── Attachable.java │ │ │ ├── AttachmentKey.java │ │ │ ├── AttachmentList.java │ │ │ ├── BadRequestException.java │ │ │ ├── ByteRange.java │ │ │ ├── CanonicalPathUtils.java │ │ │ ├── Certificates.java │ │ │ ├── ChainedHandlerWrapper.java │ │ │ ├── ClosingChannelExceptionHandler.java │ │ │ ├── ConcurrentDirectDeque.java │ │ │ ├── ConduitFactory.java │ │ │ ├── ConnectionUtils.java │ │ │ ├── Cookies.java │ │ │ ├── CopyOnWriteMap.java │ │ │ ├── DateUtils.java │ │ │ ├── ETag.java │ │ │ ├── ETagUtils.java │ │ │ ├── FastConcurrentDirectDeque.java │ │ │ ├── FileUtils.java │ │ │ ├── FlexBase64.java │ │ │ ├── HeaderMap.java │ │ │ ├── HeaderToken.java │ │ │ ├── HeaderTokenParser.java │ │ │ ├── HeaderValues.java │ │ │ ├── Headers.java │ │ │ ├── HexConverter.java │ │ │ ├── HttpString.java │ │ │ ├── ImmediateAuthenticationMechanismFactory.java │ │ │ ├── ImmediateConduitFactory.java │ │ │ ├── ImmediatePooled.java │ │ │ ├── ImmediatePooledByteBuffer.java │ │ │ ├── LegacyCookieSupport.java │ │ │ ├── LocaleUtils.java │ │ │ ├── MalformedMessageException.java │ │ │ ├── Methods.java │ │ │ ├── MimeMappings.java │ │ │ ├── MultipartParser.java │ │ │ ├── NetworkUtils.java │ │ │ ├── NewInstanceObjectPool.java │ │ │ ├── ObjectPool.java │ │ │ ├── ParameterLimitException.java │ │ │ ├── PathMatcher.java │ │ │ ├── PathTemplate.java │ │ │ ├── PathTemplateMatch.java │ │ │ ├── PathTemplateMatcher.java │ │ │ ├── PipeliningExecutor.java │ │ │ ├── PooledAdaptor.java │ │ │ ├── PooledObject.java │ │ │ ├── PortableConcurrentDirectDeque.java │ │ │ ├── Protocols.java │ │ │ ├── QValueParser.java │ │ │ ├── QueryParameterUtils.java │ │ │ ├── RedirectBuilder.java │ │ │ ├── ReferenceCountedPooled.java │ │ │ ├── Rfc6265CookieSupport.java │ │ │ ├── SameSiteNoneIncompatibleClientChecker.java │ │ │ ├── SameThreadExecutor.java │ │ │ ├── SecurityActions.java │ │ │ ├── Sessions.java │ │ │ ├── SimpleAttachmentKey.java │ │ │ ├── SimpleObjectPool.java │ │ │ ├── StatusCodes.java │ │ │ ├── StringReadChannelListener.java │ │ │ ├── StringWriteChannelListener.java │ │ │ ├── SubstringMap.java │ │ │ ├── Transfer.java │ │ │ ├── URLUtils.java │ │ │ ├── UrlDecodeException.java │ │ │ └── WorkerUtils.java │ │ │ └── websockets │ │ │ ├── WebSocketConnectionCallback.java │ │ │ ├── WebSocketExtension.java │ │ │ ├── WebSocketProtocolHandshakeHandler.java │ │ │ ├── client │ │ │ ├── WebSocket13ClientHandshake.java │ │ │ ├── WebSocketClient.java │ │ │ ├── WebSocketClientHandshake.java │ │ │ └── WebSocketClientNegotiation.java │ │ │ ├── core │ │ │ ├── AbstractReceiveListener.java │ │ │ ├── BinaryOutputStream.java │ │ │ ├── BufferedBinaryMessage.java │ │ │ ├── BufferedTextMessage.java │ │ │ ├── CloseMessage.java │ │ │ ├── InvalidOpCodeException.java │ │ │ ├── SendChannel.java │ │ │ ├── StreamSinkFrameChannel.java │ │ │ ├── StreamSourceFrameChannel.java │ │ │ ├── UTF8Output.java │ │ │ ├── WebSocketCallback.java │ │ │ ├── WebSocketChannel.java │ │ │ ├── WebSocketException.java │ │ │ ├── WebSocketFrame.java │ │ │ ├── WebSocketFrameCorruptedException.java │ │ │ ├── WebSocketFramePriority.java │ │ │ ├── WebSocketFrameType.java │ │ │ ├── WebSocketHandshakeException.java │ │ │ ├── WebSocketInvalidCloseCodeException.java │ │ │ ├── WebSocketLogger.java │ │ │ ├── WebSocketMessages.java │ │ │ ├── WebSocketUtils.java │ │ │ ├── WebSocketVersion.java │ │ │ ├── WebSockets.java │ │ │ ├── function │ │ │ │ ├── ChannelFunction.java │ │ │ │ ├── ChannelFunctionFileChannel.java │ │ │ │ ├── ChannelFunctionReadableByteChannel.java │ │ │ │ ├── ChannelFunctionStreamSourceChannel.java │ │ │ │ └── ChannelFunctionWritableByteChannel.java │ │ │ └── protocol │ │ │ │ ├── Handshake.java │ │ │ │ ├── version07 │ │ │ │ ├── Base64.java │ │ │ │ ├── Hybi07Handshake.java │ │ │ │ ├── Masker.java │ │ │ │ ├── UTF8Checker.java │ │ │ │ ├── WebSocket07BinaryFrameSinkChannel.java │ │ │ │ ├── WebSocket07BinaryFrameSourceChannel.java │ │ │ │ ├── WebSocket07Channel.java │ │ │ │ ├── WebSocket07CloseFrameSinkChannel.java │ │ │ │ ├── WebSocket07CloseFrameSourceChannel.java │ │ │ │ ├── WebSocket07FrameSinkChannel.java │ │ │ │ ├── WebSocket07PingFrameSinkChannel.java │ │ │ │ ├── WebSocket07PingFrameSourceChannel.java │ │ │ │ ├── WebSocket07PongFrameSinkChannel.java │ │ │ │ ├── WebSocket07PongFrameSourceChannel.java │ │ │ │ ├── WebSocket07TextFrameSinkChannel.java │ │ │ │ └── WebSocket07TextFrameSourceChannel.java │ │ │ │ ├── version08 │ │ │ │ ├── Hybi08Handshake.java │ │ │ │ └── WebSocket08Channel.java │ │ │ │ └── version13 │ │ │ │ ├── Hybi13Handshake.java │ │ │ │ └── WebSocket13Channel.java │ │ │ ├── extensions │ │ │ ├── CompositeExtensionFunction.java │ │ │ ├── ExtensionFunction.java │ │ │ ├── ExtensionHandshake.java │ │ │ ├── NoopExtensionFunction.java │ │ │ ├── PerMessageDeflateFunction.java │ │ │ └── PerMessageDeflateHandshake.java │ │ │ └── spi │ │ │ ├── AsyncWebSocketHttpServerExchange.java │ │ │ ├── BlockingWebSocketHttpServerExchange.java │ │ │ └── WebSocketHttpExchange.java │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ ├── io.undertow.attribute.ExchangeAttributeBuilder │ │ │ ├── io.undertow.client.ClientProvider │ │ │ ├── io.undertow.predicate.PredicateBuilder │ │ │ ├── io.undertow.protocols.alpn.ALPNEngineManager │ │ │ ├── io.undertow.protocols.alpn.ALPNProvider │ │ │ └── io.undertow.server.handlers.builder.HandlerBuilder │ │ └── io │ │ └── undertow │ │ └── version.properties │ └── test │ ├── java │ └── io │ │ └── undertow │ │ ├── attribute │ │ └── ExchangeAttributeParserTest.java │ │ ├── client │ │ ├── http │ │ │ ├── AjpClientTestCase.java │ │ │ ├── H2CUpgradeContinuationTestCase.java │ │ │ ├── H2CUpgradeResetTestCase.java │ │ │ ├── Http2ClientTestCase.java │ │ │ ├── Http2WindowUpdateTimeoutTestCase.java │ │ │ ├── HttpClientSNITestCase.java │ │ │ ├── HttpClientTestCase.java │ │ │ └── ResponseParserResumeTestCase.java │ │ └── http2 │ │ │ └── DoSHttp2ClientConnection.java │ │ ├── conduits │ │ └── ChunkedStreamSinkConduitTest.java │ │ ├── predicate │ │ └── PredicateParsingTestCase.java │ │ ├── protocols │ │ └── http2 │ │ │ ├── HpackHuffmanDecodingStringLiteralRepresentation.java │ │ │ ├── HpackHuffmanEncodingUnitTestCase.java │ │ │ ├── HpackSpecExamplesUnitTestCase.java │ │ │ ├── PushResourceRSTTestCase.java │ │ │ └── RapidResetDDoSUnitTestCase.java │ │ ├── server │ │ ├── ConnectionTerminationTestCase.java │ │ ├── DirectByteBufferDeallocatorTestCase.java │ │ ├── EncodedEncodedSlashTestCase.java │ │ ├── HttpServerExchangeTestCase.java │ │ ├── InvalidHtpRequestTestCase.java │ │ ├── MaxRequestSizeTestCase.java │ │ ├── MultipleRequestsWriteTimeoutTestCase.java │ │ ├── NewlineInHeadersTestCase.java │ │ ├── ParseTimeoutTestCase.java │ │ ├── ReadTimeoutTestCase.java │ │ ├── StopTestCase.java │ │ ├── WriteTimeoutTestCase.java │ │ ├── handlers │ │ │ ├── ActiveRequestTrackerTest.java │ │ │ ├── AllowedMethodsTestCase.java │ │ │ ├── BadRequestTestCase.java │ │ │ ├── BlockingReadTimeoutHandlerTestCase.java │ │ │ ├── BlockingWriteTimeoutHandlerTestCase.java │ │ │ ├── ChunkedRequestNotConsumedTestCase.java │ │ │ ├── ChunkedRequestTrailersTestCase.java │ │ │ ├── ChunkedRequestTransferCodingTestCase.java │ │ │ ├── ChunkedResponseTrailersTestCase.java │ │ │ ├── ChunkedResponseTransferCodingTestCase.java │ │ │ ├── DateHandlerTestCase.java │ │ │ ├── DefaultMaxHeaderTestCase.java │ │ │ ├── ExceptionHandlerTestCase.java │ │ │ ├── FixedLengthRequestTestCase.java │ │ │ ├── FixedLengthResponseTestCase.java │ │ │ ├── ForwardedHandlerTestCase.java │ │ │ ├── GracefulShutdownTestCase.java │ │ │ ├── HeadBlockingExchangeTestCase.java │ │ │ ├── HeadTestCase.java │ │ │ ├── HttpContinueAcceptingHandlerTestCase.java │ │ │ ├── HttpContinueConduitWrappingHandlerBufferLeakTestCase.java │ │ │ ├── HttpContinueConduitWrappingHandlerTestCase.java │ │ │ ├── HttpTunnelingViaConnectTestCase.java │ │ │ ├── IPAddressAccessControlHandlerUnitTestCase.java │ │ │ ├── IPAddressAccessControlHandlerWithProxyPeerAddressHandlerTestCase.java │ │ │ ├── IPMatchPredicateTestCase.java │ │ │ ├── JDBCLogDatabaseTestCase.java │ │ │ ├── LongURLTestCase.java │ │ │ ├── LotsOfHeadersRequestTestCase.java │ │ │ ├── LotsOfHeadersResponseTestCase.java │ │ │ ├── LotsOfQueryParametersTestCase.java │ │ │ ├── MetricsHandlerTestCase.java │ │ │ ├── OriginTestCase.java │ │ │ ├── PathTemplateHandlerTestCase.java │ │ │ ├── PreChunkedResponseTransferCodingTestCase.java │ │ │ ├── PredicatedHandlersProxyTestCase.java │ │ │ ├── PredicatedHandlersTestCase.java │ │ │ ├── QueryParametersTestCase.java │ │ │ ├── RangeRequestTestCase.java │ │ │ ├── ReceiverTestCase.java │ │ │ ├── RedirectTestCase.java │ │ │ ├── RequestLimitingHandlerTestCase.java │ │ │ ├── ResourcePredicateHandlerTestCase.java │ │ │ ├── ResumeWritesTestCase.java │ │ │ ├── RoutingHandlerTestCase.java │ │ │ ├── SameSiteCookieHandlerTestCase.java │ │ │ ├── SecureCookieHandlerTestCase.java │ │ │ ├── SenderTestCase.java │ │ │ ├── SetAttributeTestCase.java │ │ │ ├── SimpleNonBlockingServerTestCase.java │ │ │ ├── StatusLineTestCase.java │ │ │ ├── URLDecodingHandlerTestCase.java │ │ │ ├── UserAgentAccessControlHandlerUnitTestCase.java │ │ │ ├── VirtualHostTestCase.java │ │ │ ├── accesslog │ │ │ │ ├── AccessLogFileTestCase.java │ │ │ │ ├── AccessLogFileWithUnescapedCharactersTestCase.java │ │ │ │ ├── AccessLogTestCase.java │ │ │ │ └── ExtendedAccessLogFileTestCase.java │ │ │ ├── blocking │ │ │ │ ├── BlockingServerStreamClosureTestCase.java │ │ │ │ ├── BlockingServerStreamResetTestCase.java │ │ │ │ └── SimpleBlockingServerTestCase.java │ │ │ ├── builder │ │ │ │ └── PredicatedHandlersParserTestCase.java │ │ │ ├── caching │ │ │ │ └── CacheHandlerTestCase.java │ │ │ ├── encoding │ │ │ │ ├── DeflateContentEncodingTestCase.java │ │ │ │ ├── EncodingSelectionTestCase.java │ │ │ │ ├── GzipContentEncodingSimpleObjectPoolTestCase.java │ │ │ │ ├── GzipContentEncodingTestCase.java │ │ │ │ ├── RequestContentEncodingTestCase.java │ │ │ │ ├── RequestContentEncodingTestCase2.java │ │ │ │ ├── RequestContentEncodingTestCase3.java │ │ │ │ └── RequestContentEncodingTestCase4.java │ │ │ ├── error │ │ │ │ ├── FileErrorPageHandlerTestCase.java │ │ │ │ ├── SimpleErrorPageHandlerTestCase.java │ │ │ │ └── errorpage.html │ │ │ ├── file │ │ │ │ ├── ContentEncodedResourceTestCase.java │ │ │ │ ├── FileHandlerIndexTestCase.java │ │ │ │ ├── FileHandlerStressTestCase.java │ │ │ │ ├── FileHandlerSymlinksTestCase.java │ │ │ │ ├── FileHandlerTestCase.java │ │ │ │ ├── FileHandlerWithPredicateTestCase.java │ │ │ │ ├── PathResourceManagerTestCase.java │ │ │ │ ├── PreCompressedResourceTestCase.java │ │ │ │ ├── data1.json │ │ │ │ ├── data2.json │ │ │ │ ├── page.html │ │ │ │ └── subdir │ │ │ │ │ └── a.txt │ │ │ ├── form │ │ │ │ ├── FormDataParserTestCase.java │ │ │ │ ├── MultipartFormDataParserTestCase.java │ │ │ │ └── uploadfile.txt │ │ │ ├── largerange.txt │ │ │ ├── path │ │ │ │ └── PathTestCase.java │ │ │ ├── proxy │ │ │ │ ├── AbstractLoadBalancingProxyTestCase.java │ │ │ │ ├── LoadBalancerConnectionPoolingTestCase.java │ │ │ │ ├── LoadBalancingProxyAJPTestCase.java │ │ │ │ ├── LoadBalancingProxyHTTP2TestCase.java │ │ │ │ ├── LoadBalancingProxyHTTP2ViaUpgradeTestCase.java │ │ │ │ ├── LoadBalancingProxyHttpsTestCase.java │ │ │ │ ├── LoadBalancingProxyTestCase.java │ │ │ │ ├── LoadBalancingProxyWithCustomHostSelectorTestCase.java │ │ │ │ ├── LoadBalancingProxyWithHeaderTableSizeSettingsTestCase.java │ │ │ │ ├── ProxyHandlerXForwardedForTestCase.java │ │ │ │ ├── ProxyPathHandlingTest.java │ │ │ │ └── mod_cluster │ │ │ │ │ ├── AbstractModClusterTestBase.java │ │ │ │ │ ├── BasicMCMPUnitTestCase.java │ │ │ │ │ ├── MCMPTestClient.java │ │ │ │ │ ├── ModClusterTestSetup.java │ │ │ │ │ ├── NodeTestConfig.java │ │ │ │ │ ├── NodeTestHandlers.java │ │ │ │ │ ├── RouteIteratorFactoryTestCase.java │ │ │ │ │ ├── StickySessionForceUnitTestCase.java │ │ │ │ │ └── StickySessionUnitTestCase.java │ │ │ ├── range.txt │ │ │ ├── session │ │ │ │ ├── InMemorySessionTestCase.java │ │ │ │ ├── SSLSessionTestCase.java │ │ │ │ ├── SSLSessionWithExpandedBufferTestCase.java │ │ │ │ └── URLRewritingSessionTestCase.java │ │ │ └── sse │ │ │ │ └── ServerSentEventTestCase.java │ │ ├── protocol │ │ │ ├── ajp │ │ │ │ ├── AjpCharacterEncodingTestCase.java │ │ │ │ ├── AjpParsingUnitTestCase.java │ │ │ │ └── sample-ajp-request │ │ │ ├── http │ │ │ │ ├── ContentOverrunTestCase.java │ │ │ │ ├── ParserResumeTestCase.java │ │ │ │ └── SimpleParserTestCase.java │ │ │ ├── http2 │ │ │ │ ├── HTTP2OnListenerTestCase.java │ │ │ │ ├── HTTP2ViaUpgradeTestCase.java │ │ │ │ ├── HTTP2ViaUpgradeWithUnEncodedURLCharactersTestCase.java │ │ │ │ └── Http2EndExchangeTestCase.java │ │ │ └── proxy │ │ │ │ └── ProxyProtocolTestCase.java │ │ ├── security │ │ │ ├── AuthenticationTestBase.java │ │ │ ├── BasicAuthenticationTestCase.java │ │ │ ├── ClientCertRenegotiationTestCase.java │ │ │ ├── ClientCertTestCase.java │ │ │ ├── DigestAuthentication2069TestCase.java │ │ │ ├── DigestAuthenticationAuthTestCase.java │ │ │ ├── FormAuthTestCase.java │ │ │ ├── GenericHeaderAuthenticationTestCase.java │ │ │ ├── KerberosKDCUtil.java │ │ │ ├── ParseDigestAuthorizationTokenTestCase.java │ │ │ ├── SimpleConfidentialRedirectTestCase.java │ │ │ ├── SpnegoAuthenticationTestCase.java │ │ │ ├── SpnegoBasicAuthenticationTestCase.java │ │ │ ├── SpnegoDigestAuthenticationTestCase.java │ │ │ └── SsoTestCase.java │ │ └── ssl │ │ │ ├── ComplexSSLTestCase.java │ │ │ ├── DelegatedTaskExecutorTestCase.java │ │ │ ├── SimpleSSLTestCase.java │ │ │ └── TLS13HalfCloseHangTestCase.java │ │ ├── testutils │ │ ├── AjpIgnore.java │ │ ├── DebuggingSlicePool.java │ │ ├── DefaultServer.java │ │ ├── HttpClientUtils.java │ │ ├── HttpOneOnly.java │ │ ├── HttpsIgnore.java │ │ ├── IPv6Ignore.java │ │ ├── IPv6Only.java │ │ ├── ProxyIgnore.java │ │ ├── RunDefaultServer.java │ │ ├── StopServerWithExternalWorkerUtils.java │ │ ├── TestHttpClient.java │ │ └── category │ │ │ ├── FunctionalTest.java │ │ │ └── UnitTest.java │ │ ├── util │ │ ├── ByteRangeTestCase.java │ │ ├── CanonicalPathUtilsTestCase.java │ │ ├── CompletionLatchHandler.java │ │ ├── ContentTypeParsingTestCase.java │ │ ├── CookiesTestCase.java │ │ ├── DateUtilsTestCase.java │ │ ├── ETagUtilsTestCase.java │ │ ├── FlexBase64TestCase.java │ │ ├── HeaderMapTestCase.java │ │ ├── HeaderOrderTestCase.java │ │ ├── HeaderTokenParserTestCase.java │ │ ├── HeaderValuesTestCase.java │ │ ├── HeadersUtilsTestCase.java │ │ ├── HttpStringTestCase.java │ │ ├── LocaleUtilsTestCase.java │ │ ├── MimeDecodingTestCase.java │ │ ├── NetworkUtilsAddressObfuscationTestCase.java │ │ ├── NetworkUtilsAddressParsingTestCase.java │ │ ├── NodeStatusCodesTestCase.java │ │ ├── PathMatcherTestCase.java │ │ ├── PathTemplateMatcherTestCase.java │ │ ├── PathTemplateTestCase.java │ │ ├── SameSiteNoneIncompatibleClientCheckerTestCase.java │ │ ├── SimpleObjectPoolTestCase.java │ │ ├── SingleByteStreamSinkConduit.java │ │ ├── SingleByteStreamSourceConduit.java │ │ ├── SubstringMapTestCase.java │ │ ├── TestVersion.java │ │ ├── URLUtilsTestCase.java │ │ ├── mime-multiline.txt │ │ ├── mime-utf8.txt │ │ ├── mime1.txt │ │ ├── mime2.txt │ │ ├── mime3.txt │ │ └── mime4.txt │ │ └── websockets │ │ ├── client │ │ └── version13 │ │ │ └── WebSocketClient13TestCase.java │ │ ├── core │ │ └── protocol │ │ │ ├── AbstractWebSocketServerTest.java │ │ │ ├── WebSocket07ServerTest.java │ │ │ ├── WebSocket08ServerTest.java │ │ │ ├── WebSocket13ServerTestCase.java │ │ │ ├── WebSocketTimeoutTestCase.java │ │ │ └── server │ │ │ └── AutobahnWebSocketServer.java │ │ ├── extensions │ │ ├── AutobahnExtensionCustomReceiverServer.java │ │ ├── AutobahnExtensionsServer.java │ │ ├── CompressionUtilsTest.java │ │ ├── DebugExtensionsHeaderHandler.java │ │ ├── DebugExtensionsListener.java │ │ ├── WebSocketExtensionBasicTestCase.java │ │ └── WebSocketExtensionParserTest.java │ │ └── utils │ │ ├── FrameChecker.java │ │ ├── StreamSinkChannelAdapter.java │ │ ├── StreamSourceChannelAdapter.java │ │ ├── TestUtils.java │ │ └── WebSocketTestClient.java │ └── resources │ ├── ajp-apache-site │ ├── byteman-netwok.btm │ ├── ca.crt │ ├── client.keystore │ ├── client.truststore │ ├── krb5.conf │ ├── ldif │ ├── krbtgt.ldif │ ├── partition.ldif │ ├── server.ldif │ └── user.ldif │ ├── logging.properties │ ├── server.keystore │ ├── server.pem │ └── server.truststore ├── coverage-report └── pom.xml ├── dist ├── assembly-src.xml ├── assembly.xml └── pom.xml ├── examples ├── README ├── conf │ └── nodes.xml ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── undertow │ │ └── examples │ │ ├── Runner.java │ │ ├── UndertowExample.java │ │ ├── chat │ │ ├── ChatServer.java │ │ └── index.html │ │ ├── fileserving │ │ └── FileServer.java │ │ ├── helloworld │ │ └── HelloWorldServer.java │ │ ├── http2 │ │ ├── Http2Server.java │ │ ├── client.keystore │ │ ├── client.truststore │ │ ├── server.keystore │ │ ├── server.pem │ │ └── server.truststore │ │ ├── jsrwebsockets │ │ ├── JSRWebSocketServer.java │ │ ├── JsrChatWebSocketEndpoint.java │ │ └── index.html │ │ ├── predicates │ │ └── PredicateParser.java │ │ ├── reverseproxy │ │ ├── ModClusterProxyServer.java │ │ └── ReverseProxyServer.java │ │ ├── security │ │ └── basic │ │ │ ├── BasicAuthServer.java │ │ │ └── MapIdentityManager.java │ │ ├── servlet │ │ ├── MessageServlet.java │ │ └── ServletServer.java │ │ ├── sessionhandling │ │ └── SessionServer.java │ │ ├── sse │ │ ├── ServerSentEventsServer.java │ │ └── index.html │ │ ├── websockets │ │ ├── WebSocketServer.java │ │ └── index.html │ │ └── websockets_extension │ │ ├── WebSocketServer.java │ │ └── index.html │ └── resources │ └── logging.properties ├── karaf ├── pom.xml └── src │ └── main │ └── resources │ └── features.xml ├── parser-generator ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── undertow │ │ └── annotationprocessor │ │ ├── AbstractParserGenerator.java │ │ ├── HttpParserAnnotationProcessor.java │ │ ├── HttpParserConfig.java │ │ ├── HttpResponseParserConfig.java │ │ ├── RequestParserGenerator.java │ │ └── ResponseParserGenerator.java │ └── resources │ └── META-INF │ └── services │ └── javax.annotation.processing.Processor ├── pom.xml ├── servlet ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── undertow │ │ │ └── servlet │ │ │ ├── ExceptionLog.java │ │ │ ├── ServletExtension.java │ │ │ ├── Servlets.java │ │ │ ├── UndertowServletLogger.java │ │ │ ├── UndertowServletMessages.java │ │ │ ├── api │ │ │ ├── AuthMethodConfig.java │ │ │ ├── AuthorizationManager.java │ │ │ ├── ClassIntrospecter.java │ │ │ ├── ConfidentialPortManager.java │ │ │ ├── CrawlerSessionManagerConfig.java │ │ │ ├── DefaultServletConfig.java │ │ │ ├── Deployment.java │ │ │ ├── DeploymentInfo.java │ │ │ ├── DeploymentManager.java │ │ │ ├── ErrorPage.java │ │ │ ├── ExceptionHandler.java │ │ │ ├── FilterInfo.java │ │ │ ├── FilterMappingInfo.java │ │ │ ├── HttpMethodSecurityInfo.java │ │ │ ├── InstanceFactory.java │ │ │ ├── InstanceHandle.java │ │ │ ├── LegacyThreadSetupActionWrapper.java │ │ │ ├── LifecycleInterceptor.java │ │ │ ├── ListenerInfo.java │ │ │ ├── LoggingExceptionHandler.java │ │ │ ├── LoginConfig.java │ │ │ ├── MetricsCollector.java │ │ │ ├── MimeMapping.java │ │ │ ├── SecurityActions.java │ │ │ ├── SecurityConstraint.java │ │ │ ├── SecurityInfo.java │ │ │ ├── SecurityRoleRef.java │ │ │ ├── ServletContainer.java │ │ │ ├── ServletContainerInitializerInfo.java │ │ │ ├── ServletDispatcher.java │ │ │ ├── ServletInfo.java │ │ │ ├── ServletSecurityInfo.java │ │ │ ├── ServletSessionConfig.java │ │ │ ├── ServletStackTraces.java │ │ │ ├── SessionConfigWrapper.java │ │ │ ├── SessionManagerFactory.java │ │ │ ├── SessionPersistenceManager.java │ │ │ ├── SingleConstraintMatch.java │ │ │ ├── ThreadSetupAction.java │ │ │ ├── ThreadSetupHandler.java │ │ │ ├── TransportGuaranteeType.java │ │ │ └── WebResourceCollection.java │ │ │ ├── attribute │ │ │ ├── ServletContextAttribute.java │ │ │ ├── ServletNameAttribute.java │ │ │ ├── ServletRelativePathAttribute.java │ │ │ ├── ServletRequestAttribute.java │ │ │ ├── ServletRequestCharacterEncodingAttribute.java │ │ │ ├── ServletRequestLineAttribute.java │ │ │ ├── ServletRequestLocaleAttribute.java │ │ │ ├── ServletRequestParameterAttribute.java │ │ │ ├── ServletRequestURLAttribute.java │ │ │ ├── ServletRequestedSessionIdAttribute.java │ │ │ ├── ServletRequestedSessionIdFromCookieAttribute.java │ │ │ ├── ServletRequestedSessionIdValidAttribute.java │ │ │ ├── ServletSessionAttribute.java │ │ │ └── ServletSessionIdAttribute.java │ │ │ ├── compat │ │ │ └── rewrite │ │ │ │ ├── Resolver.java │ │ │ │ ├── RewriteCond.java │ │ │ │ ├── RewriteConfig.java │ │ │ │ ├── RewriteConfigFactory.java │ │ │ │ ├── RewriteHandler.java │ │ │ │ ├── RewriteMap.java │ │ │ │ ├── RewriteRule.java │ │ │ │ ├── Substitution.java │ │ │ │ └── UndertowResolver.java │ │ │ ├── core │ │ │ ├── ApplicationListeners.java │ │ │ ├── BlockingWriterSenderImpl.java │ │ │ ├── ContextClassLoaderSetupAction.java │ │ │ ├── DefaultAuthorizationManager.java │ │ │ ├── DefaultCharsetMapping.java │ │ │ ├── DeploymentImpl.java │ │ │ ├── DeploymentManagerImpl.java │ │ │ ├── ErrorPages.java │ │ │ ├── InMemorySessionManagerFactory.java │ │ │ ├── Lifecycle.java │ │ │ ├── LifecyleInterceptorInvocation.java │ │ │ ├── ManagedFilter.java │ │ │ ├── ManagedFilters.java │ │ │ ├── ManagedListener.java │ │ │ ├── ManagedServlet.java │ │ │ ├── ManagedServlets.java │ │ │ ├── MetricsChainHandler.java │ │ │ ├── SecurityActions.java │ │ │ ├── ServletBlockingHttpExchange.java │ │ │ ├── ServletContainerImpl.java │ │ │ ├── ServletExtensionHolder.java │ │ │ ├── ServletRequestContextThreadSetupAction.java │ │ │ ├── ServletUpgradeListener.java │ │ │ └── SessionListenerBridge.java │ │ │ ├── handlers │ │ │ ├── CrawlerSessionManagerHandler.java │ │ │ ├── DefaultServlet.java │ │ │ ├── FilterHandler.java │ │ │ ├── MarkSecureHandler.java │ │ │ ├── Paths.java │ │ │ ├── RedirectDirHandler.java │ │ │ ├── SecurityActions.java │ │ │ ├── SendErrorPageHandler.java │ │ │ ├── ServletChain.java │ │ │ ├── ServletDebugPageHandler.java │ │ │ ├── ServletDispatchingHandler.java │ │ │ ├── ServletHandler.java │ │ │ ├── ServletInitialHandler.java │ │ │ ├── ServletPathMatch.java │ │ │ ├── ServletPathMatches.java │ │ │ ├── ServletPathMatchesData.java │ │ │ ├── ServletRequestContext.java │ │ │ ├── SessionRestoringHandler.java │ │ │ └── security │ │ │ │ ├── CachedAuthenticatedSessionHandler.java │ │ │ │ ├── SSLInformationAssociationHandler.java │ │ │ │ ├── SecurityPathMatch.java │ │ │ │ ├── SecurityPathMatches.java │ │ │ │ ├── ServletAuthenticationCallHandler.java │ │ │ │ ├── ServletAuthenticationConstraintHandler.java │ │ │ │ ├── ServletConfidentialityConstraintHandler.java │ │ │ │ ├── ServletFormAuthenticationMechanism.java │ │ │ │ ├── ServletSecurityConstraintHandler.java │ │ │ │ ├── ServletSecurityRoleHandler.java │ │ │ │ ├── ServletSingleSignOnAuthenticationMechainism.java │ │ │ │ └── ServletSingleSignOnAuthenticationMechanism.java │ │ │ ├── predicate │ │ │ ├── DirectoryPredicate.java │ │ │ ├── DispatcherTypePredicate.java │ │ │ └── FilePredicate.java │ │ │ ├── spec │ │ │ ├── AsyncContextImpl.java │ │ │ ├── ContentTypeInfo.java │ │ │ ├── FilterConfigImpl.java │ │ │ ├── FilterRegistrationImpl.java │ │ │ ├── HttpServletRequestImpl.java │ │ │ ├── HttpServletResponseImpl.java │ │ │ ├── HttpSessionImpl.java │ │ │ ├── MappingImpl.java │ │ │ ├── PartImpl.java │ │ │ ├── PushBuilderImpl.java │ │ │ ├── RequestDispatcherImpl.java │ │ │ ├── SecurityActions.java │ │ │ ├── ServletConfigImpl.java │ │ │ ├── ServletConnectionImpl.java │ │ │ ├── ServletContextImpl.java │ │ │ ├── ServletCookieAdaptor.java │ │ │ ├── ServletInputStreamImpl.java │ │ │ ├── ServletOutputStreamImpl.java │ │ │ ├── ServletPrintWriter.java │ │ │ ├── ServletPrintWriterDelegate.java │ │ │ ├── ServletRegistrationImpl.java │ │ │ ├── SessionCookieConfigImpl.java │ │ │ ├── UpgradeServletInputStream.java │ │ │ ├── UpgradeServletOutputStream.java │ │ │ └── WebConnectionImpl.java │ │ │ ├── sse │ │ │ ├── ServerSentEvent.java │ │ │ └── ServerSentEventSCI.java │ │ │ ├── util │ │ │ ├── ConstructorInstanceFactory.java │ │ │ ├── DefaultClassIntrospector.java │ │ │ ├── DispatchUtils.java │ │ │ ├── EmptyEnumeration.java │ │ │ ├── ImmediateInstanceFactory.java │ │ │ ├── ImmediateInstanceHandle.java │ │ │ ├── InMemorySessionPersistence.java │ │ │ ├── IteratorEnumeration.java │ │ │ └── SavedRequest.java │ │ │ └── websockets │ │ │ ├── SecurityActions.java │ │ │ ├── ServletWebSocketHttpExchange.java │ │ │ └── WebSocketServlet.java │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ ├── io.undertow.attribute.ExchangeAttributeBuilder │ │ │ ├── io.undertow.predicate.PredicateBuilder │ │ │ ├── io.undertow.server.handlers.builder.HandlerBuilder │ │ │ └── jakarta.servlet.ServletContainerInitializer │ │ └── io │ │ └── undertow │ │ └── servlet │ │ └── core │ │ └── charset.mapping │ └── test │ ├── java │ └── io │ │ └── undertow │ │ └── servlet │ │ └── test │ │ ├── HandlerListingTestCase.java │ │ ├── ProxyForwardedTestCase.java │ │ ├── ProxyXForwardedTestCase.java │ │ ├── SimpleServletTestCase.java │ │ ├── async │ │ ├── AnotherAsyncServlet.java │ │ ├── AsyncDispatchPathTestServlet.java │ │ ├── AsyncDispatchServlet.java │ │ ├── AsyncDoubleCompleteServlet.java │ │ ├── AsyncErrorListenerServlet.java │ │ ├── AsyncErrorServlet.java │ │ ├── AsyncServlet.java │ │ ├── SimpleAsyncTestCase.java │ │ ├── SimpleDateThreadLocalAsyncServlet.java │ │ └── TestAsyncRespWrapper.java │ │ ├── charset │ │ ├── CharacterEncodingTestCase.java │ │ ├── CharsetServlet.java │ │ ├── DefaultCharacterEncodingServlet.java │ │ ├── DefaultCharacterEncodingTestCase.java │ │ ├── DefaultCharsetFormParserServlet.java │ │ ├── DefaultCharsetServlet.java │ │ ├── DefaultCharsetTestCase.java │ │ ├── EchoServlet.java │ │ ├── ParameterCharacterEncodingTestCase.java │ │ └── UnmappableCharacterTestCase.java │ │ ├── compat │ │ └── rewrite │ │ │ └── RewriteTestCase.java │ │ ├── constant │ │ └── GenericServletConstants.java │ │ ├── crosscontext │ │ └── CrossContextClassLoaderTestCase.java │ │ ├── defaultservlet │ │ ├── DefaultServletCachingListenerTestCase.java │ │ ├── DefaultServletCachingTestCase.java │ │ ├── DefaultServletNoDirectoryListingTestCase.java │ │ ├── DefaultServletTestCase.java │ │ ├── GetDateFilter.java │ │ ├── HelloFilter.java │ │ ├── NoOpFilter.java │ │ ├── SecurityRedirectTestCase.java │ │ ├── ServletAndResourceWelcomeFileTestCase.java │ │ ├── WelcomeFileSecurityTestCase.java │ │ ├── WelcomeFileTestCase.java │ │ ├── disallowed.sh │ │ ├── filterpath │ │ │ └── filtered.txt │ │ ├── foo │ │ │ ├── .gitkeep │ │ │ ├── meta-inf │ │ │ │ └── notsecret │ │ │ └── web-inf │ │ │ │ └── notsecret │ │ ├── index.html │ │ ├── meta-inf │ │ │ └── secret │ │ ├── path │ │ │ └── .gitkeep │ │ └── range.txt │ │ ├── dispatcher │ │ ├── DispatcherForwardServlet.java │ │ ├── DispatcherForwardTestCase.java │ │ ├── DispatcherIncludeServlet.java │ │ ├── DispatcherIncludeTestCase.java │ │ ├── ForwardPathTestServlet.java │ │ ├── ForwardServlet.java │ │ ├── IncludePathTestServlet.java │ │ ├── IncludeServlet.java │ │ ├── NextServlet.java │ │ ├── snippet.html │ │ └── util │ │ │ └── DispatcherUtil.java │ │ ├── dispatchingfilter │ │ ├── DispatchingFilter.java │ │ └── DispatchingFilterTestCase.java │ │ ├── errorpage │ │ ├── ChildException.java │ │ ├── ErrorPageTestCase.java │ │ ├── ErrorServlet.java │ │ ├── ParentException.java │ │ ├── PathServlet.java │ │ ├── SecureServlet.java │ │ └── SecurityErrorPageTestCase.java │ │ ├── handlers │ │ ├── AbstractHttpContinueServletTestCase.java │ │ ├── HttpContinueServletTestCase.java │ │ ├── HttpContinueSslServletTestCase.java │ │ ├── IsSecureFilter.java │ │ └── MarkSecureHandlerTestCase.java │ │ ├── lifecycle │ │ ├── EagerServletLifecycleTestCase.java │ │ ├── FirstServlet.java │ │ ├── InitializeInOrderTestCase.java │ │ ├── LifeCycleServlet.java │ │ ├── LifecycleFilter.java │ │ ├── SecondServlet.java │ │ ├── ServletLifecycleTestCase.java │ │ └── ThirdServlet.java │ │ ├── listener │ │ ├── ordering │ │ │ ├── FirstListener.java │ │ │ ├── SecondListener.java │ │ │ └── ServletSessionListenerOrderingTestCase.java │ │ ├── request │ │ │ └── async │ │ │ │ ├── AnotherAsyncServlet.java │ │ │ │ ├── AsyncListenerExceptionTest.java │ │ │ │ ├── AsyncServlet.java │ │ │ │ ├── CompleteAsyncServlet.java │ │ │ │ ├── RequestListenerAsyncRequestTestCase.java │ │ │ │ ├── onComplete │ │ │ │ ├── AsyncListenerOnCompleteTest.java │ │ │ │ └── OnCompleteServlet.java │ │ │ │ ├── onError │ │ │ │ ├── AsyncEventListener.java │ │ │ │ ├── AsyncListenerOnErrorTest.java │ │ │ │ ├── AsyncServlet1.java │ │ │ │ ├── AsyncServlet2.java │ │ │ │ ├── AsyncServlet3.java │ │ │ │ ├── AsyncServlet4.java │ │ │ │ ├── AsyncServlet5.java │ │ │ │ ├── AsyncTask.java │ │ │ │ ├── FaultyServlet.java │ │ │ │ └── SimpleAsyncListener.java │ │ │ │ └── onTimeout │ │ │ │ ├── AsyncServlet.java │ │ │ │ ├── NestedListenerInvocationTestCase.java │ │ │ │ ├── SimpleAsyncListener.java │ │ │ │ └── SimpleRequestListener.java │ │ ├── servletcontext │ │ │ ├── CheckRolesServlet.java │ │ │ ├── DeclareRolesServletContextListener.java │ │ │ ├── ServletContextListenerTestCase.java │ │ │ ├── ServletContextRolesTestCase.java │ │ │ ├── ServletContextTestListener.java │ │ │ └── TestSci.java │ │ └── session │ │ │ ├── ServletSessionInvalidateWithListenerTestCase.java │ │ │ ├── SessionServlet.java │ │ │ └── SimpleSessionListener.java │ │ ├── metrics │ │ ├── MetricTestServlet.java │ │ ├── ServletMetricsHandlerTestCase.java │ │ └── TestMetricsCollector.java │ │ ├── mock │ │ └── MockRequestTestCase.java │ │ ├── multipart │ │ ├── AddMultipartServetListener.java │ │ ├── MultiPartServlet.java │ │ ├── MultiPartTestCase.java │ │ ├── forward │ │ │ ├── ForwardingServlet.java │ │ │ ├── MultiPartCapableServlet.java │ │ │ └── MultiPartForwardTestCase.java │ │ └── uploadfile.txt │ │ ├── path │ │ ├── FilterPathMappingTestCase.java │ │ ├── GetMappingServlet.java │ │ ├── MappingTestCase.java │ │ ├── MultipleMatchingMappingTestCase.java │ │ ├── PathFilter.java │ │ ├── PathMappingServlet.java │ │ ├── RealPathServlet.java │ │ ├── RealPathTestCase.java │ │ ├── ServletPathMappingTestCase.java │ │ ├── ServletSpecExampleTestCase.java │ │ └── file.txt │ │ ├── proprietry │ │ ├── BypassServletTestCase.java │ │ ├── ExchangeCompletionTestCase.java │ │ ├── IgnoresRequestAndSetsAttributeAsyncServlet.java │ │ ├── IgnoresRequestAndSetsAttributeServlet.java │ │ └── TransferTestCase.java │ │ ├── protocol │ │ └── cookie │ │ │ └── CookieAssemblyTestCase.java │ │ ├── push │ │ ├── PushPromisesTestCase.java │ │ └── PushServlet.java │ │ ├── redirect │ │ ├── RedirectEncodedServlet.java │ │ ├── RedirectEncodedToSubPathTestCase.java │ │ ├── RedirectWithContentLengthServlet.java │ │ ├── RedirectWithContentLengthTestCase.java │ │ ├── RelativeRedirectServlet.java │ │ └── RelativeRedirectServletTestCase.java │ │ ├── request │ │ ├── ExecutorPerServletTestCase.java │ │ ├── HttpHostValuesTestCase.java │ │ ├── RaceyAddServlet.java │ │ ├── RedirectServlet.java │ │ ├── RedirectTestCase.java │ │ ├── RequestHostValuesServlet.java │ │ ├── RequestPathServlet.java │ │ └── RequestPathTestCase.java │ │ ├── response │ │ ├── contenttype │ │ │ ├── ContentTypeCharsetTestCase.java │ │ │ ├── ContentTypeFilesTestCase.java │ │ │ ├── ContentTypeServlet.java │ │ │ └── webstart.jnlp │ │ ├── cookies │ │ │ ├── AddCookiesServlet.java │ │ │ ├── DuplicateCookiesServlet.java │ │ │ ├── JSessionIDCookiesServlet.java │ │ │ ├── OverwriteCookiesServlet.java │ │ │ └── ResponseCookiesTestCase.java │ │ └── writer │ │ │ ├── AsyncExceptionWriterServlet.java │ │ │ ├── AsyncLargeResponseWriterServlet.java │ │ │ ├── AsyncResponseWriterOnPostServlet.java │ │ │ ├── AsyncResponseWriterServlet.java │ │ │ ├── ExceptionWriterServlet.java │ │ │ ├── LargeResponseWriterServlet.java │ │ │ ├── ResponseWriterOnPostServlet.java │ │ │ ├── ResponseWriterServlet.java │ │ │ └── ResponseWriterTestCase.java │ │ ├── security │ │ ├── MultipartAcceptingServlet.java │ │ ├── SendAuthTypeServlet.java │ │ ├── SendSchemeServlet.java │ │ ├── SendUsernameServlet.java │ │ ├── basic │ │ │ ├── ServletBasicAuthTestCase.java │ │ │ ├── ServletCertAndDigestAuthTestCase.java │ │ │ └── ServletClientCertAuthTestCase.java │ │ ├── constraint │ │ │ ├── AuthenticationMessageServlet.java │ │ │ ├── DenyUncoveredHttpMethodsTestCase.java │ │ │ ├── EmptyRoleSemanticTestCase.java │ │ │ ├── SecurityConstraintUrlMappingTestCase.java │ │ │ ├── SecurityConstraintUrlMappingWithUnspecifiedForbiddenTestCase.java │ │ │ └── ServletIdentityManager.java │ │ ├── custom │ │ │ ├── CustomAuthenticationMechanism.java │ │ │ ├── CustomEncodingAuthenticationMechanism.java │ │ │ ├── ServletCustomAuthFormEncodingTestCase.java │ │ │ └── ServletCustomAuthTestCase.java │ │ ├── digest │ │ │ └── DigestAuthTestCase.java │ │ ├── form │ │ │ ├── EchoServlet.java │ │ │ ├── FormAuthenticationRootContextRedirectTestCase.java │ │ │ ├── FormLoginServlet.java │ │ │ ├── RequestParamEchoServlet.java │ │ │ ├── SaveOriginalPostRequestTestCase.java │ │ │ ├── ServletFormAuthDefaultPageTestCase.java │ │ │ ├── ServletFormAuthTestCase.java │ │ │ ├── ServletFormAuthURLRewriteTestCase.java │ │ │ └── error.html │ │ ├── login │ │ │ ├── LoginFilter.java │ │ │ └── ServletLoginTestCase.java │ │ └── ssl │ │ │ ├── ConfidentialityConstraintUrlMappingTestCase.java │ │ │ ├── SSLAttributesServlet.java │ │ │ ├── SSLMetaDataProxyTestCase.java │ │ │ ├── SSLMetaDataTestCase.java │ │ │ └── SSLMetaDataWithExpandedBufferTestCase.java │ │ ├── servletcontext │ │ ├── 1#2.txt │ │ ├── GetResourceTestCase.java │ │ ├── ReadFileServlet.java │ │ └── file.txt │ │ ├── session │ │ ├── ChangeSessionIdListener.java │ │ ├── ChangeSessionIdServlet.java │ │ ├── ChangeSessionIdTestCase.java │ │ ├── CrossContextServletBrokenSessionFactoryTestCase.java │ │ ├── CrossContextServletSessionTestCase.java │ │ ├── CrossContextServletSharedSessionTestCase.java │ │ ├── LastAccessTimeSessionServlet.java │ │ ├── RequestedSessionIdServlet.java │ │ ├── ServletSessionCrawlerTestCase.java │ │ ├── ServletSessionPersistenceTestCase.java │ │ ├── ServletSessionTestCase.java │ │ ├── ServletURLRewritingSessionTestCase.java │ │ ├── SessionCookieConfigListener.java │ │ ├── SessionIdHandlingTestCase.java │ │ ├── SessionServlet.java │ │ └── invalidate │ │ │ ├── ServletSessionInvalidateTestCase.java │ │ │ └── SessionServlet.java │ │ ├── spec │ │ ├── FilterMappingTestCase.java │ │ ├── GetCookiesTestCase.java │ │ ├── ParameterEchoTestCase.java │ │ ├── PathTestCase.java │ │ ├── UnavailableServlet.java │ │ ├── UnavailableServletTestCase.java │ │ └── ValidCookieEchoServlet.java │ │ ├── streams │ │ ├── AbstractServletInputStreamTestCase.java │ │ ├── AsyncInputStreamServlet.java │ │ ├── AsyncOutputStreamServlet.java │ │ ├── BlockingInputStreamServlet.java │ │ ├── BlockingOutputStreamServlet.java │ │ ├── ConnectionTerminationServlet.java │ │ ├── ContentLengthCloseFlushServlet.java │ │ ├── EagerAsyncInputStreamServlet.java │ │ ├── EarlyCloseClientServlet.java │ │ ├── EarlyCloseServlet.java │ │ ├── ForceDrainServlet.java │ │ ├── ResetBufferServlet.java │ │ ├── ServletInputStreamConnectionTerminationTestCase.java │ │ ├── ServletInputStreamDrainTestCase.java │ │ ├── ServletInputStreamEarlyCloseClientSideTestCase.java │ │ ├── ServletInputStreamEarlyCloseTestCase.java │ │ ├── ServletInputStreamRequestBufferingTestCase.java │ │ ├── ServletInputStreamSSLTestCase.java │ │ ├── ServletInputStreamTestCase.java │ │ ├── ServletOutputStreamClosureTestCase.java │ │ ├── ServletOutputStreamSSLTestCase.java │ │ └── ServletOutputStreamTestCase.java │ │ ├── upgrade │ │ ├── AsyncUpgradeServlet.java │ │ ├── SimpleUpgradeTestCase.java │ │ ├── SslUpgradeTestCase.java │ │ └── UpgradeServlet.java │ │ ├── util │ │ ├── DeploymentUtils.java │ │ ├── EmptyServlet.java │ │ ├── MessageFilter.java │ │ ├── MessageServlet.java │ │ ├── ParameterEchoServlet.java │ │ ├── PathTestServlet.java │ │ ├── ProxyPeerXForwardedHandlerServlet.java │ │ ├── SetHeaderFilter.java │ │ ├── TXServlet.java │ │ ├── TestClassIntrospector.java │ │ ├── TestConfidentialPortManager.java │ │ ├── TestListener.java │ │ ├── TestResourceLoader.java │ │ └── Tracker.java │ │ ├── websocket │ │ └── WebSocketServletTest.java │ │ └── wrapper │ │ ├── AbstractResponseWrapperTestCase.java │ │ ├── NonStandardRequestWrapper.java │ │ ├── NonStandardRequestWrappingFilter.java │ │ ├── NonStandardResponseWrapper.java │ │ ├── NonStandardResponseWrapperTestCase.java │ │ ├── StandardRequestWrapper.java │ │ ├── StandardRequestWrappingFilter.java │ │ ├── StandardResponseWrapper.java │ │ ├── StandardResponseWrapperTestCase.java │ │ └── WrapperServlet.java │ └── resources │ ├── dummy.keystore │ └── logging.properties ├── spotbugs-exclude.xml ├── websockets-jsr ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── undertow │ │ │ └── websockets │ │ │ └── jsr │ │ │ ├── Bootstrap.java │ │ │ ├── ConfiguredClientEndpoint.java │ │ │ ├── ConfiguredServerEndpoint.java │ │ │ ├── DefaultContainerConfigurator.java │ │ │ ├── DefaultPongMessage.java │ │ │ ├── DefaultWebSocketClientSslProvider.java │ │ │ ├── Encoding.java │ │ │ ├── EncodingFactory.java │ │ │ ├── EndpointSessionHandler.java │ │ │ ├── ExtensionImpl.java │ │ │ ├── FrameHandler.java │ │ │ ├── JsrWebSocketFilter.java │ │ │ ├── JsrWebSocketLogger.java │ │ │ ├── JsrWebSocketMessages.java │ │ │ ├── JsrWebSocketProtocolHandshakeHandler.java │ │ │ ├── OrderedExecutor.java │ │ │ ├── SecurityActions.java │ │ │ ├── SendHandlerAdapter.java │ │ │ ├── SendResultFuture.java │ │ │ ├── ServerEndpointConfigImpl.java │ │ │ ├── ServerWebSocketContainer.java │ │ │ ├── SessionContainer.java │ │ │ ├── UndertowContainerProvider.java │ │ │ ├── UndertowSession.java │ │ │ ├── WebSocketDeploymentInfo.java │ │ │ ├── WebSocketReconnectHandler.java │ │ │ ├── WebSocketSessionRemoteEndpoint.java │ │ │ ├── WebsocketClientSslProvider.java │ │ │ ├── annotated │ │ │ ├── AnnotatedEndpoint.java │ │ │ ├── AnnotatedEndpointFactory.java │ │ │ ├── BoundMethod.java │ │ │ ├── BoundParameter.java │ │ │ ├── DecoderUtils.java │ │ │ └── EmptyEndpointConfig.java │ │ │ ├── handshake │ │ │ ├── ExchangeHandshakeRequest.java │ │ │ ├── ExchangeHandshakeResponse.java │ │ │ ├── HandshakeUtil.java │ │ │ ├── JsrHybi07Handshake.java │ │ │ ├── JsrHybi08Handshake.java │ │ │ ├── JsrHybi13Handshake.java │ │ │ ├── PerConnectionConfiguredServerEndpoint.java │ │ │ └── PerConnectionServerEndpointConfig.java │ │ │ └── util │ │ │ └── ClassUtils.java │ └── resources │ │ └── META-INF │ │ └── services │ │ ├── io.undertow.servlet.ServletExtension │ │ ├── io.undertow.websockets.jsr.WebsocketClientSslProvider │ │ ├── jakarta.websocket.ContainerProvider │ │ └── jakarta.websocket.server.ServerEndpointConfig$Configurator │ └── test │ └── java │ └── io │ └── undertow │ └── websockets │ └── jsr │ └── test │ ├── AddEndpointServlet.java │ ├── BinaryEndpointServlet.java │ ├── BinaryEndpointTest.java │ ├── BinaryPartialEndpoint.java │ ├── ClassUtilsTest.java │ ├── JsrWebSocketServer07Test.java │ ├── JsrWebSocketServer08Test.java │ ├── JsrWebSocketServer13Test.java │ ├── ProgramaticEndpoint.java │ ├── ProgramaticErrorEndpoint.java │ ├── ProgramaticLazyEndpointTest.java │ ├── TestMessagesReceivedInOrder.java │ ├── annotated │ ├── AnnotatedAddedProgrammaticallyEndpoint.java │ ├── AnnotatedClientEndpoint.java │ ├── AnnotatedClientEndpointWithConfigurator.java │ ├── AnnotatedEndpointTest.java │ ├── AnnotatedGenericClientEndpoint.java │ ├── BadAnnotatedEndpointTestCase.java │ ├── BadOnMessageEndpoint.java │ ├── ClientConfigurator.java │ ├── EncodableObject.java │ ├── EncodableObjectSubClass.java │ ├── EncodingEndpoint.java │ ├── EncodingGenericsEndpoint.java │ ├── ErrorEndpoint.java │ ├── GenericSuperclassDecoder.java │ ├── GenericWebSocketClientEndpoint.java │ ├── IncrementEndpoint.java │ ├── MessageEndpoint.java │ ├── MiddleClassDecoder.java │ ├── RequestUriEndpoint.java │ ├── RootContextEndpoint.java │ ├── SubclassDecoder.java │ ├── ThreadSafetyEndpoint.java │ └── TimeoutEndpoint.java │ ├── autobahn │ ├── AnnotatedAutobahnServer.java │ ├── AutobahnAnnotatedEndpoint.java │ ├── ProgramaticAutobahnEndpoint.java │ └── ProgramaticAutobahnServer.java │ ├── dynamicupgrade │ ├── DoUpgradeServlet.java │ ├── DynamicEndpointTest.java │ ├── EchoEndpoint.java │ └── EchoProgramaticEndpoint.java │ ├── extension │ └── JsrWebsocketExtensionTestCase.java │ ├── reconnect │ ├── AnnotatedClientReconnectEndpoint.java │ ├── ClientEndpointReconnectTestCase.java │ └── DisconnectServerEndpoint.java │ ├── security │ └── WebsocketBasicAuthTestCase.java │ ├── stress │ ├── StressEndpoint.java │ └── WebsocketStressTestCase.java │ └── suspendresume │ ├── SuspendResumeEndpoint.java │ └── SuspendResumeTestCase.java └── zanata.xml /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.iml 3 | .idea 4 | .settings 5 | .project 6 | .classpath 7 | *~ 8 | local-test 9 | out 10 | lib 11 | bin 12 | dependency-reduced-pom.xml 13 | hotspot.log 14 | .directory 15 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | @undertow-io/codeowners -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Undertow 2 | ======== 3 | Undertow is a Java web server based on non-blocking IO. It consists of a few different parts: 4 | 5 | - A core HTTP server that supports both blocking and non-blocking IO 6 | - A Servlet 4.0/5.0/6.0 implementation 7 | - A JSR-356/Jakarta 2.0 compliant Web Socket implementation 8 | 9 | Website: http://undertow.io 10 | 11 | Issues: https://issues.redhat.com/projects/UNDERTOW 12 | 13 | Project Lead: Flavia Rainone 14 | 15 | Undertow Dev Group: https://groups.google.com/g/undertow-dev/ 16 | (you can access archived discussions of old undertow-dev mail list [here](http://lists.jboss.org/mailman/listinfo/undertow-dev)) 17 | 18 | Zulip Chat: https://wildfly.zulipchat.com stream [#undertow](https://wildfly.zulipchat.com/#narrow/stream/174183-undertow) 19 | 20 | Notifying Security Relevant Bugs 21 | -------------------------------- 22 | 23 | If you find a bug that has a security impact, please notify us sending an email to Red Hat SecAlert with a copy to Flavia Rainone . This will ensure the bug is properly handled without causing unnecessary negative impacts for the Undertow's user base. 24 | 25 | You can find more information about the security procedures at [this page](https://access.redhat.com/security/team/contact "Security Contacts and Procedures"). 26 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | The following versions of Undertow are supported with security updates: 6 | 7 | | Version | Supported | 8 | |---------|--------------------| 9 | | < 2.2.x | :x: | 10 | | 2.2.x | :white_check_mark: | 11 | | 2.3.x | :white_check_mark: | 12 | 13 | 14 | ## Reporting a Vulnerability 15 | 16 | If you find a vulnerability, please send an email to secalert@redhat.com. To expedite things, you can copy Flavia Rainone (frainone@redhat.com). 17 | This will ensure the bug is properly handled without causing unnecessary negative impacts for the Undertow's user base. 18 | You can find more information about the security procedures at [this page](https://access.redhat.com/security/team/contact "Security Contacts and Procedures"). 19 | -------------------------------------------------------------------------------- /benchmarks/README.md: -------------------------------------------------------------------------------- 1 | # Undertow Benchmarks 2 | 3 | ## JMH 4 | 5 | Benchmarks use the [JMH harness](https://openjdk.java.net/projects/code-tools/jmh/). 6 | 7 | ## Running 8 | 9 | ```bash 10 | mvn install 11 | java -jar benchmarks/target/undertow-benchmarks.jar 12 | ``` 13 | 14 | Alternatively benchmarks may be run from the IDE using a JMH plugin like 15 | [this one for idea](https://plugins.jetbrains.com/plugin/7529-jmh-plugin). -------------------------------------------------------------------------------- /benchmarks/src/main/resources/client.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/benchmarks/src/main/resources/client.keystore -------------------------------------------------------------------------------- /benchmarks/src/main/resources/client.truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/benchmarks/src/main/resources/client.truststore -------------------------------------------------------------------------------- /benchmarks/src/main/resources/server.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/benchmarks/src/main/resources/server.keystore -------------------------------------------------------------------------------- /benchmarks/src/main/resources/server.truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/benchmarks/src/main/resources/server.truststore -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/attribute/ExchangeAttributeWrapper.java: -------------------------------------------------------------------------------- 1 | package io.undertow.attribute; 2 | 3 | /** 4 | * Interface that can be used to wrap an exchange attribute. 5 | * 6 | * @author Stuart Douglas 7 | */ 8 | public interface ExchangeAttributeWrapper { 9 | 10 | ExchangeAttribute wrap(ExchangeAttribute attribute); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/attribute/ReadOnlyAttributeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.attribute; 20 | 21 | import io.undertow.UndertowMessages; 22 | 23 | /** 24 | * An exception that is thrown when an attribute is read only 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | public class ReadOnlyAttributeException extends Exception { 29 | 30 | public ReadOnlyAttributeException() { 31 | } 32 | 33 | public ReadOnlyAttributeException(final String attributeName, final String newValue) { 34 | super(UndertowMessages.MESSAGES.couldNotSetAttribute(attributeName, newValue)); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/client/ClientCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.client; 20 | 21 | import java.io.IOException; 22 | 23 | /** 24 | * @author Emanuel Muckenhuber 25 | */ 26 | public interface ClientCallback { 27 | 28 | /** 29 | * Invoked when an operation completed. 30 | * 31 | * @param result the operation result 32 | */ 33 | void completed(T result); 34 | 35 | /** 36 | * Invoked when the operation failed. 37 | * 38 | * @param e the exception 39 | */ 40 | void failed(IOException e); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/client/ClientStatistics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.client; 20 | 21 | /** 22 | * Returns statistics about the Undertow client connection 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public interface ClientStatistics { 27 | 28 | long getRequests(); 29 | 30 | long getRead(); 31 | 32 | long getWritten(); 33 | 34 | void reset(); 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/client/ContinueNotification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.client; 20 | 21 | /** 22 | * Callback class that provides a notification of a HTTP 100 Continue response in the client. 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public interface ContinueNotification { 27 | 28 | void handleContinue(ClientExchange exchange); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/client/PushCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.client; 20 | 21 | 22 | /** 23 | * @author Stuart Douglas 24 | */ 25 | public interface PushCallback { 26 | 27 | /** 28 | * Handles a server push. If the push cannot be handled for some reason, this method 29 | * should return false and the underlying 30 | * @param originalRequest The request that initiated the push 31 | * @param pushedRequest The pushed request 32 | * @return false if the server wants the push to be rejected 33 | */ 34 | boolean handlePush(ClientExchange originalRequest, ClientExchange pushedRequest); 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/conduits/ByteActivityCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.conduits; 20 | 21 | /** 22 | * Callback that allows the bytes read from or written to a stream to be tracked 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public interface ByteActivityCallback { 27 | 28 | void activity(long bytes); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/conduits/ConduitListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.conduits; 20 | 21 | import java.util.EventListener; 22 | 23 | import org.xnio.conduits.Conduit; 24 | 25 | /** 26 | * @author Stuart Douglas 27 | */ 28 | public interface ConduitListener extends EventListener { 29 | 30 | /** 31 | * Handle the event on this conduit. 32 | * 33 | * @param channel the channel event 34 | */ 35 | void handleEvent(T channel); 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/connector/PooledByteBuffer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.connector; 20 | 21 | import java.io.Closeable; 22 | import java.nio.ByteBuffer; 23 | 24 | /** 25 | * @author Stuart Douglas 26 | */ 27 | public interface PooledByteBuffer extends AutoCloseable, Closeable { 28 | 29 | ByteBuffer getBuffer(); 30 | 31 | void close(); 32 | 33 | boolean isOpen(); 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/io/BufferWritableOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.io; 20 | 21 | import java.io.IOException; 22 | import java.nio.ByteBuffer; 23 | import java.nio.channels.FileChannel; 24 | 25 | /** 26 | * Represents an output stream that can write byte buffers 27 | * directly. 28 | * 29 | * @author Stuart Douglas 30 | */ 31 | public interface BufferWritableOutputStream { 32 | 33 | void write(ByteBuffer[] buffers) throws IOException; 34 | 35 | void write(ByteBuffer byteBuffer) throws IOException; 36 | 37 | void transferFrom(FileChannel source) throws IOException; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/io/IoCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.io; 20 | 21 | import java.io.IOException; 22 | 23 | import io.undertow.server.HttpServerExchange; 24 | 25 | /** 26 | * @author Stuart Douglas 27 | */ 28 | public interface IoCallback { 29 | 30 | void onComplete(HttpServerExchange exchange, Sender sender); 31 | 32 | void onException(HttpServerExchange exchange, Sender sender, IOException exception); 33 | 34 | /** 35 | * A default callback that simply ends the exchange. 36 | */ 37 | IoCallback END_EXCHANGE = new DefaultIoCallback(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/predicate/FalsePredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.predicate; 20 | 21 | import io.undertow.server.HttpServerExchange; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class FalsePredicate implements Predicate { 27 | 28 | public static final FalsePredicate INSTANCE = new FalsePredicate(); 29 | 30 | public static FalsePredicate instance() { 31 | return INSTANCE; 32 | } 33 | 34 | @Override 35 | public boolean resolve(final HttpServerExchange value) { 36 | return false; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return "false"; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/predicate/NotPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.predicate; 20 | 21 | import io.undertow.server.HttpServerExchange; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class NotPredicate implements Predicate { 27 | 28 | private final Predicate predicate; 29 | 30 | NotPredicate(final Predicate predicate) { 31 | this.predicate = predicate; 32 | } 33 | 34 | @Override 35 | public boolean resolve(final HttpServerExchange value) { 36 | return !predicate.resolve(value); 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return " not " + predicate.toString(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/predicate/TruePredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.predicate; 20 | 21 | import io.undertow.server.HttpServerExchange; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class TruePredicate implements Predicate { 27 | 28 | public static final TruePredicate INSTANCE = new TruePredicate(); 29 | 30 | public static TruePredicate instance() { 31 | return INSTANCE; 32 | } 33 | 34 | @Override 35 | public boolean resolve(final HttpServerExchange value) { 36 | return true; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return "true"; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/protocols/ajp/AbstractAjpClientStreamSinkChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.protocols.ajp; 20 | 21 | import io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class AbstractAjpClientStreamSinkChannel extends AbstractFramedStreamSinkChannel { 27 | protected AbstractAjpClientStreamSinkChannel(AjpClientChannel channel) { 28 | super(channel); 29 | } 30 | 31 | @Override 32 | protected boolean isLastFrame() { 33 | return false; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/protocols/ajp/AbstractAjpClientStreamSourceChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.protocols.ajp; 20 | 21 | import io.undertow.connector.PooledByteBuffer; 22 | 23 | import io.undertow.server.protocol.framed.AbstractFramedStreamSourceChannel; 24 | 25 | /** 26 | * @author Stuart Douglas 27 | */ 28 | public class AbstractAjpClientStreamSourceChannel extends AbstractFramedStreamSourceChannel { 29 | 30 | 31 | public AbstractAjpClientStreamSourceChannel(AjpClientChannel framedChannel, PooledByteBuffer data, long frameDataRemaining) { 32 | super(framedChannel, data, frameDataRemaining); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/protocols/ajp/AjpClientCPingStreamSinkChannel.java: -------------------------------------------------------------------------------- 1 | package io.undertow.protocols.ajp; 2 | 3 | import io.undertow.server.protocol.framed.SendFrameHeader; 4 | import io.undertow.util.ImmediatePooledByteBuffer; 5 | 6 | import java.nio.ByteBuffer; 7 | 8 | /** 9 | * @author Stuart Douglas 10 | */ 11 | public class AjpClientCPingStreamSinkChannel extends AbstractAjpClientStreamSinkChannel { 12 | 13 | 14 | private static final byte[] CPING = {0x12, 0x34, 0, 1, 10}; //CPONG response data 15 | 16 | protected AjpClientCPingStreamSinkChannel(AjpClientChannel channel) { 17 | super(channel); 18 | } 19 | 20 | @Override 21 | protected final SendFrameHeader createFrameHeader() { 22 | return new SendFrameHeader(new ImmediatePooledByteBuffer(ByteBuffer.wrap(CPING))); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/protocols/alpn/DefaultAlpnEngineManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package io.undertow.protocols.alpn; 17 | 18 | import java.util.function.Function; 19 | 20 | import javax.net.ssl.SSLEngine; 21 | 22 | public class DefaultAlpnEngineManager implements ALPNEngineManager { 23 | 24 | @Override 25 | public int getPriority() { 26 | return 0; 27 | } 28 | 29 | @Override 30 | public boolean registerEngine(SSLEngine engine, Function selectedFunction) { 31 | selectedFunction.apply(engine); 32 | return true; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/protocols/http2/AbstractHttp2StreamSinkChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.protocols.http2; 20 | 21 | import io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class AbstractHttp2StreamSinkChannel extends AbstractFramedStreamSinkChannel { 27 | 28 | AbstractHttp2StreamSinkChannel(Http2Channel channel) { 29 | super(channel); 30 | } 31 | 32 | @Override 33 | protected boolean isLastFrame() { 34 | return false; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/protocols/http2/Http2HeadersStreamSinkChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.protocols.http2; 20 | 21 | import io.undertow.util.HeaderMap; 22 | 23 | /** 24 | * Headers channel 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | public class Http2HeadersStreamSinkChannel extends Http2DataStreamSinkChannel { 29 | 30 | 31 | public Http2HeadersStreamSinkChannel(Http2Channel channel, int streamId) { 32 | super(channel, streamId, Http2Channel.FRAME_TYPE_HEADERS); 33 | } 34 | 35 | public Http2HeadersStreamSinkChannel(Http2Channel channel, int streamId, HeaderMap headers) { 36 | super(channel, streamId, headers, Http2Channel.FRAME_TYPE_HEADERS); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/protocols/http2/Http2Stream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.protocols.http2; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public interface Http2Stream { 25 | 26 | int getStreamId(); 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/protocols/http2/StreamErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.protocols.http2; 20 | 21 | import java.io.IOException; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class StreamErrorException extends IOException { 27 | 28 | private final int errorId; 29 | 30 | public StreamErrorException(int errorId) { 31 | this.errorId = errorId; 32 | } 33 | 34 | public int getErrorId() { 35 | return errorId; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/protocols/ssl/SNISSLContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package io.undertow.protocols.ssl; 17 | 18 | import javax.net.ssl.SSLContext; 19 | 20 | public class SNISSLContext extends SSLContext { 21 | 22 | public SNISSLContext(SNIContextMatcher matcher) { 23 | super(new SNISSLContextSpi(matcher), matcher.getDefaultContext().getProvider(), matcher.getDefaultContext().getProtocol()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/security/idm/Credential.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.security.idm; 19 | 20 | /** 21 | * Representation of a users Credential. 22 | * 23 | * @author Darran Lofthouse 24 | */ 25 | public interface Credential { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/security/idm/ExternalCredential.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.security.idm; 20 | 21 | import java.io.Serializable; 22 | 23 | /** 24 | * Representation of an external credential. This basically represents a trusted 25 | * 3rd party, e.g. a front end server that has performed authentication. 26 | * 27 | * @author Stuart Douglas 28 | */ 29 | public class ExternalCredential implements Serializable, Credential { 30 | 31 | public static final ExternalCredential INSTANCE = new ExternalCredential(); 32 | 33 | private ExternalCredential() { 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/security/idm/GSSContextCredential.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.security.idm; 19 | 20 | import org.ietf.jgss.GSSContext; 21 | 22 | /** 23 | * A {@link Credential} to wrap an established GSSContext. 24 | * 25 | * @author Darran Lofthouse 26 | */ 27 | public class GSSContextCredential implements Credential { 28 | 29 | private final GSSContext gssContext; 30 | 31 | public GSSContextCredential(final GSSContext gssContext) { 32 | this.gssContext = gssContext; 33 | } 34 | 35 | public GSSContext getGssContext() { 36 | return gssContext; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/security/idm/PasswordCredential.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.security.idm; 19 | 20 | /** 21 | * A Credential representing the password of an Account. 22 | * 23 | * @author Darran Lofthouse 24 | */ 25 | public final class PasswordCredential implements Credential { 26 | 27 | private final char[] password; 28 | 29 | public PasswordCredential(final char[] password) { 30 | this.password = password; 31 | } 32 | 33 | public char[] getPassword() { 34 | return password; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/security/idm/X509CertificateCredential.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.security.idm; 19 | 20 | import java.security.cert.X509Certificate; 21 | 22 | /** 23 | * A {@link Credential} implementation which wraps an X.509 certificate. 24 | * 25 | * @author Darran Lofthouse 26 | */ 27 | public final class X509CertificateCredential implements Credential { 28 | 29 | private final X509Certificate certificate; 30 | 31 | public X509CertificateCredential(final X509Certificate certificate) { 32 | this.certificate = certificate; 33 | } 34 | 35 | public X509Certificate getCertificate() { 36 | return certificate; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/security/impl/SingleSignOnManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.security.impl; 20 | 21 | import io.undertow.security.idm.Account; 22 | 23 | /** 24 | * @author Paul Ferraro 25 | */ 26 | public interface SingleSignOnManager { 27 | SingleSignOn createSingleSignOn(Account account, String mechanism); 28 | 29 | SingleSignOn findSingleSignOn(String ssoId); 30 | 31 | void removeSingleSignOn(SingleSignOn sso); 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/DelegateOpenListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server; 20 | 21 | import io.undertow.connector.PooledByteBuffer; 22 | import org.xnio.StreamConnection; 23 | 24 | /** 25 | * An open listener that handles being delegated to, e.g. by NPN or ALPN 26 | * 27 | * @author Stuart Douglas 28 | */ 29 | public interface DelegateOpenListener extends OpenListener { 30 | 31 | /** 32 | * 33 | * @param channel The channel 34 | * @param additionalData Any additional data that was read from the stream as part of the handshake process 35 | */ 36 | void handleEvent(StreamConnection channel, PooledByteBuffer additionalData); 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/DelegatingIterable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2020 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.server; 19 | 20 | import java.util.Iterator; 21 | 22 | /** 23 | * @author Richard Opalka 24 | */ 25 | final class DelegatingIterable implements Iterable { 26 | 27 | private final Iterable delegate; 28 | 29 | DelegatingIterable(final Iterable delegate) { 30 | this.delegate = delegate; 31 | } 32 | 33 | Iterable getDelegate() { 34 | return delegate; 35 | } 36 | 37 | @Override 38 | public Iterator iterator() { 39 | return new ReadOnlyIterator(delegate.iterator()); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/HandlerWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server; 20 | 21 | /** 22 | * Interface that can be used to wrap the handler chains, adding additional handlers. 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public interface HandlerWrapper { 27 | 28 | HttpHandler wrap(HttpHandler handler); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/HttpHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server; 20 | 21 | /** 22 | * A handler for an HTTP request. The request handler must eventually either call another handler or end the exchange. 23 | * 24 | * 25 | * @author David M. Lloyd 26 | */ 27 | public interface HttpHandler { 28 | 29 | /** 30 | * Handle the request. 31 | * 32 | * @param exchange the HTTP request/response exchange 33 | * 34 | */ 35 | void handleRequest(HttpServerExchange exchange) throws Exception; 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/HttpUpgradeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server; 20 | 21 | import org.xnio.StreamConnection; 22 | 23 | /** 24 | * Listener that is used to perform a HTTP upgrade. 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | public interface HttpUpgradeListener { 29 | 30 | /** 31 | * Method that is called once the upgrade is complete. 32 | * 33 | * @param streamConnection The connection that can be used to send or receive data 34 | * @param exchange 35 | */ 36 | void handleUpgrade(StreamConnection streamConnection, HttpServerExchange exchange); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/OverridableTreeSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2020 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.server; 19 | 20 | import java.util.TreeSet; 21 | 22 | /** 23 | * @author Richard Opalka 24 | */ 25 | final class OverridableTreeSet extends TreeSet { 26 | @Override 27 | public boolean add(final T o) { 28 | // always override previous value 29 | super.remove(o); 30 | super.add(o); 31 | return true; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/RequestTooBigException.java: -------------------------------------------------------------------------------- 1 | package io.undertow.server; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * @author Stuart Douglas 7 | */ 8 | public class RequestTooBigException extends IOException { 9 | 10 | public RequestTooBigException() { 11 | super(); 12 | } 13 | 14 | public RequestTooBigException(String message) { 15 | super(message); 16 | } 17 | 18 | public RequestTooBigException(String message, Throwable cause) { 19 | super(message, cause); 20 | } 21 | 22 | public RequestTooBigException(Throwable cause) { 23 | super(cause); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/ResponseCommitListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server; 20 | 21 | /** 22 | * Callback that is invoked just before the response is commit 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public interface ResponseCommitListener { 27 | 28 | /** 29 | * Invoked before the first bytes of the response are sent to the client 30 | * @param exchange The server exchange 31 | */ 32 | void beforeCommit(HttpServerExchange exchange); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/accesslog/AccessLogReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.accesslog; 20 | 21 | /** 22 | * Interface that is used by the access log handler to send data to the log file manager. 23 | * 24 | * Implementations of this interface must be thread safe. 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | public interface AccessLogReceiver { 29 | 30 | void logMessage(String message); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/accesslog/LogFileHeaderGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.accesslog; 20 | 21 | /** 22 | * Interface that generates the header for an access log. This is called 23 | * every time a new log file is started. 24 | * 25 | * @author Stuart Douglas 26 | */ 27 | public interface LogFileHeaderGenerator { 28 | 29 | String generateHeader(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/proxy/ConnectionPoolManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.proxy; 20 | 21 | /** 22 | * Manager that controls the behaviour of a {@link ProxyConnectionPool} 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public interface ConnectionPoolManager extends ProxyConnectionPoolConfig, ConnectionPoolErrorHandler { 27 | 28 | /** 29 | * 30 | * @return The amount of time that we should wait before re-testing a problem server 31 | */ 32 | int getProblemServerRetry(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/proxy/ExclusivityChecker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.proxy; 20 | 21 | import io.undertow.server.HttpServerExchange; 22 | 23 | /** 24 | * Interface that is used to determine if a connection should be exclusive. 25 | * 26 | * If a connection is exclusive then it is removed from the connection pool, and a one 27 | * to one mapping will be maintained between the front and back end servers. 28 | * 29 | * @author Stuart Douglas 30 | */ 31 | public interface ExclusivityChecker { 32 | 33 | boolean isExclusivityRequired(HttpServerExchange exchange); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/proxy/RouteParsingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2019 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.proxy; 20 | 21 | /** 22 | * Enumeration of supported route parsing strategies. 23 | * 24 | * @author Radoslav Husar 25 | */ 26 | public enum RouteParsingStrategy { 27 | /** 28 | * Ignores encoded route/affinity information altogether, essentially disabling session stickiness on the load balancer. 29 | */ 30 | NONE, 31 | /** 32 | * Default behavior. 33 | */ 34 | SINGLE, 35 | /** 36 | * Enables ranked affinity support. 37 | */ 38 | RANKED, 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/ModClusterController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.proxy.mod_cluster; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public interface ModClusterController { 25 | 26 | ModClusterStatus getStatus(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodeStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.proxy.mod_cluster; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public enum NodeStatus { 25 | /** 26 | * The node is up 27 | */ 28 | NODE_UP, 29 | /** 30 | * The node is down 31 | */ 32 | NODE_DOWN, 33 | /** 34 | * The node is paused 35 | */ 36 | NODE_HOT_STANDBY; 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/resource/FileResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.resource; 20 | 21 | import java.io.File; 22 | 23 | /** 24 | * A file resource 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | public class FileResource extends PathResource { 29 | 30 | public FileResource(final File file, final FileResourceManager manager, String path) { 31 | super(file.toPath(), manager, path); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/resource/ResourceChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.resource; 20 | 21 | import java.util.Collection; 22 | 23 | /** 24 | * Listener that is invoked when a resource changes. 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | public interface ResourceChangeListener { 29 | 30 | /** 31 | * callback that is invoked when resources change. 32 | * @param changes The collection of changes 33 | */ 34 | void handleChanges(Collection changes); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/handlers/sse/ServerSentEventConnectionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.sse; 20 | 21 | /** 22 | * Callback handler that is invoked when a client connects to a SSE endpoint 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public interface ServerSentEventConnectionCallback { 27 | 28 | void connected(ServerSentEventConnection connection, String lastEventId); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/protocol/framed/FrameHeaderData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.protocol.framed; 20 | 21 | /** 22 | * Frame header data for frames that are received 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public interface FrameHeaderData { 27 | 28 | long getFrameLength(); 29 | 30 | AbstractFramedStreamSourceChannel getExistingChannel(); 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/protocol/proxy/ProxyProtocolOpenListener.java: -------------------------------------------------------------------------------- 1 | package io.undertow.server.protocol.proxy; 2 | 3 | import io.undertow.connector.ByteBufferPool; 4 | import io.undertow.protocols.ssl.UndertowXnioSsl; 5 | import io.undertow.server.OpenListener; 6 | import org.xnio.ChannelListener; 7 | import org.xnio.OptionMap; 8 | import org.xnio.StreamConnection; 9 | 10 | /** 11 | * Open listener for proxied connections 12 | * 13 | * @author Stuart Douglas 14 | */ 15 | public class ProxyProtocolOpenListener implements ChannelListener { 16 | private final OpenListener openListener; 17 | private final UndertowXnioSsl ssl; 18 | private final ByteBufferPool bufferPool; 19 | private final OptionMap sslOptionMap; 20 | 21 | public ProxyProtocolOpenListener(OpenListener openListener, UndertowXnioSsl ssl, ByteBufferPool bufferPool, OptionMap sslOptionMap) { 22 | this.openListener = openListener; 23 | this.ssl = ssl; 24 | this.bufferPool = bufferPool; 25 | this.sslOptionMap = sslOptionMap; 26 | } 27 | 28 | @Override 29 | public void handleEvent(StreamConnection streamConnection) { 30 | streamConnection.getSourceChannel().setReadListener(new ProxyProtocolReadListener(streamConnection, openListener, ssl, bufferPool, sslOptionMap)); 31 | streamConnection.getSourceChannel().wakeupReads(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/server/session/SessionIdGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.session; 20 | 21 | /** 22 | * 23 | * Strategy for generating session ID's. 24 | * 25 | * The session manager is not required to support pluggable session 26 | * id generation, it is an optional feature. 27 | * 28 | * @author Stuart Douglas 29 | */ 30 | public interface SessionIdGenerator { 31 | 32 | String createSessionId(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/util/BadRequestException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | /** 22 | * Exception that is thrown when bad request is detected 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public class BadRequestException extends Exception { 27 | 28 | public BadRequestException() { 29 | } 30 | 31 | public BadRequestException(String message) { 32 | super(message); 33 | } 34 | 35 | public BadRequestException(Throwable cause) { 36 | super(cause); 37 | } 38 | 39 | public BadRequestException(String message, Throwable cause) { 40 | super(message, cause); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/util/ConduitFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | import org.xnio.conduits.Conduit; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public interface ConduitFactory { 27 | 28 | /** 29 | * Create the channel instance. 30 | * 31 | * @return the channel instance 32 | */ 33 | C create(); 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/util/ImmediateConduitFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | import org.xnio.conduits.Conduit; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class ImmediateConduitFactory implements ConduitFactory { 27 | 28 | private final T value; 29 | 30 | public ImmediateConduitFactory(final T value) { 31 | this.value = value; 32 | } 33 | 34 | @Override 35 | public T create() { 36 | return value; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/util/MalformedMessageException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | import java.io.IOException; 22 | 23 | /** 24 | * Exception that is thrown when multipart parsing cannot parse a request 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | public class MalformedMessageException extends IOException { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/util/ObjectPool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | /** 22 | * A pool of objects. 23 | * 24 | * @author ckozak 25 | * @author Stuart Douglas 26 | */ 27 | public interface ObjectPool { 28 | 29 | PooledObject allocate(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/util/ParameterLimitException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | /** 22 | * Exception that is thrown if the max query or path parameter limit is exceeded 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public class ParameterLimitException extends Exception { 27 | 28 | public ParameterLimitException(String message) { 29 | super(message); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/util/PooledObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | import java.io.Closeable; 22 | 23 | /** 24 | * Represents a generic pooled object 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | public interface PooledObject extends Closeable, AutoCloseable { 29 | 30 | T getObject(); 31 | 32 | void close(); 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/util/SameThreadExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | import java.util.concurrent.Executor; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class SameThreadExecutor implements Executor { 27 | 28 | public static final Executor INSTANCE = new SameThreadExecutor(); 29 | 30 | private SameThreadExecutor() { 31 | } 32 | 33 | @Override 34 | public void execute(final Runnable command) { 35 | command.run(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/util/UrlDecodeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2019 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | /** 22 | * Created by Marek Marusic on 7/25/19. 23 | */ 24 | public class UrlDecodeException extends IllegalArgumentException { 25 | 26 | public UrlDecodeException(String message, Throwable cause) { 27 | super(message, cause); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/websockets/WebSocketConnectionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets; 20 | 21 | import io.undertow.websockets.core.WebSocketChannel; 22 | import io.undertow.websockets.spi.WebSocketHttpExchange; 23 | 24 | /** 25 | * Interface that is used on the client side to accept web socket connections 26 | * 27 | * @author Stuart Douglas 28 | */ 29 | public interface WebSocketConnectionCallback { 30 | 31 | /** 32 | * Is called once the WebSocket connection is established, which means the handshake was successful. 33 | * 34 | */ 35 | void onConnect(WebSocketHttpExchange exchange, WebSocketChannel channel); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/websockets/core/InvalidOpCodeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.core; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public class InvalidOpCodeException extends WebSocketException { 25 | 26 | public InvalidOpCodeException() { 27 | } 28 | 29 | public InvalidOpCodeException(String msg, Throwable cause) { 30 | super(msg, cause); 31 | } 32 | 33 | public InvalidOpCodeException(String msg) { 34 | super(msg); 35 | } 36 | 37 | public InvalidOpCodeException(Throwable cause) { 38 | super(cause); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/websockets/core/SendChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.websockets.core; 19 | 20 | /** 21 | * Marker interface for channels that send frames. 22 | * 23 | * @author Norman Maurer 24 | */ 25 | interface SendChannel { 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/websockets/core/WebSocketCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.core; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public interface WebSocketCallback { 25 | 26 | void complete(WebSocketChannel channel, T context); 27 | 28 | void onError(WebSocketChannel channel, T context, Throwable throwable); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/websockets/core/WebSocketFrame.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.core; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public interface WebSocketFrame extends WebSocketChannel.PartialFrame { 25 | 26 | boolean isFinalFragment(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/websockets/core/protocol/version07/WebSocket07CloseFrameSinkChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.websockets.core.protocol.version07; 19 | 20 | import io.undertow.websockets.core.WebSocketFrameType; 21 | 22 | /** 23 | * @author Norman Maurer 24 | */ 25 | class WebSocket07CloseFrameSinkChannel extends WebSocket07FrameSinkChannel { 26 | WebSocket07CloseFrameSinkChannel(WebSocket07Channel wsChannel) { 27 | super(wsChannel, WebSocketFrameType.CLOSE); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/websockets/core/protocol/version07/WebSocket07PingFrameSinkChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.websockets.core.protocol.version07; 19 | 20 | import io.undertow.websockets.core.WebSocketFrameType; 21 | 22 | /** 23 | * @author Norman Maurer 24 | */ 25 | class WebSocket07PingFrameSinkChannel extends WebSocket07FrameSinkChannel { 26 | WebSocket07PingFrameSinkChannel(WebSocket07Channel wsChannel) { 27 | super(wsChannel, WebSocketFrameType.PING); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/websockets/core/protocol/version07/WebSocket07PongFrameSinkChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.websockets.core.protocol.version07; 19 | 20 | import io.undertow.websockets.core.WebSocketFrameType; 21 | 22 | /** 23 | * @author Norman Maurer 24 | */ 25 | class WebSocket07PongFrameSinkChannel extends WebSocket07FrameSinkChannel { 26 | WebSocket07PongFrameSinkChannel(WebSocket07Channel wsChannel) { 27 | super(wsChannel, WebSocketFrameType.PONG); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/java/io/undertow/websockets/extensions/NoopExtensionFunction.java: -------------------------------------------------------------------------------- 1 | package io.undertow.websockets.extensions; 2 | 3 | import io.undertow.connector.PooledByteBuffer; 4 | import io.undertow.websockets.core.StreamSinkFrameChannel; 5 | import io.undertow.websockets.core.StreamSourceFrameChannel; 6 | 7 | import java.io.IOException; 8 | 9 | public class NoopExtensionFunction implements ExtensionFunction { 10 | public static final ExtensionFunction INSTANCE = new NoopExtensionFunction(); 11 | 12 | @Override 13 | public boolean hasExtensionOpCode() { 14 | return false; 15 | } 16 | 17 | @Override 18 | public int writeRsv(int rsv) { 19 | return 0; 20 | } 21 | 22 | @Override 23 | public PooledByteBuffer transformForWrite(PooledByteBuffer pooledBuffer, StreamSinkFrameChannel channel, boolean lastFrame) throws IOException { 24 | return pooledBuffer; 25 | } 26 | 27 | @Override 28 | public PooledByteBuffer transformForRead(PooledByteBuffer pooledBuffer, StreamSourceFrameChannel channel, boolean lastFragmentOfFrame) throws IOException { 29 | return pooledBuffer; 30 | } 31 | 32 | @Override 33 | public void dispose() { 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/services/io.undertow.client.ClientProvider: -------------------------------------------------------------------------------- 1 | io.undertow.client.http.HttpClientProvider 2 | io.undertow.client.ajp.AjpClientProvider 3 | io.undertow.client.http2.Http2ClientProvider 4 | io.undertow.client.http2.Http2ClearClientProvider 5 | io.undertow.client.http2.Http2PriorKnowledgeClientProvider 6 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/services/io.undertow.predicate.PredicateBuilder: -------------------------------------------------------------------------------- 1 | io.undertow.predicate.PathMatchPredicate$Builder 2 | io.undertow.predicate.PathPrefixPredicate$Builder 3 | io.undertow.predicate.ContainsPredicate$Builder 4 | io.undertow.predicate.ExistsPredicate$Builder 5 | io.undertow.predicate.RegularExpressionPredicate$Builder 6 | io.undertow.predicate.PathSuffixPredicate$Builder 7 | io.undertow.predicate.EqualsPredicate$Builder 8 | io.undertow.predicate.PathTemplatePredicate$Builder 9 | io.undertow.predicate.MethodPredicate$Builder 10 | io.undertow.predicate.AuthenticationRequiredPredicate$Builder 11 | io.undertow.predicate.MaxContentSizePredicate$Builder 12 | io.undertow.predicate.MinContentSizePredicate$Builder 13 | io.undertow.predicate.SecurePredicate$Builder 14 | io.undertow.predicate.IdempotentPredicate$Builder 15 | io.undertow.predicate.RequestLargerThanPredicate$Builder 16 | io.undertow.predicate.RequestSmallerThanPredicate$Builder 17 | io.undertow.predicate.ip.IPMatchPredicate$Builder -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/services/io.undertow.protocols.alpn.ALPNEngineManager: -------------------------------------------------------------------------------- 1 | # 2 | # JBoss, Home of Professional Open Source. 3 | # Copyright 2018 Red Hat, Inc., and individual contributors 4 | # as indicated by the @author tags. 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | io.undertow.protocols.ssl.SNIAlpnEngineManager 16 | io.undertow.protocols.alpn.DefaultAlpnEngineManager -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/services/io.undertow.protocols.alpn.ALPNProvider: -------------------------------------------------------------------------------- 1 | # 2 | # JBoss, Home of Professional Open Source. 3 | # Copyright 2014 Red Hat, Inc., and individual contributors 4 | # as indicated by the @author tags. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | io.undertow.protocols.alpn.ModularJdkAlpnProvider 20 | io.undertow.protocols.alpn.OpenSSLAlpnProvider 21 | -------------------------------------------------------------------------------- /core/src/main/resources/io/undertow/version.properties: -------------------------------------------------------------------------------- 1 | undertow.version=${project.version} -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/StopTestCase.java: -------------------------------------------------------------------------------- 1 | package io.undertow.server; 2 | 3 | import org.junit.After; 4 | import org.junit.Test; 5 | import org.xnio.Options; 6 | 7 | import io.undertow.Undertow; 8 | 9 | public class StopTestCase { 10 | 11 | @After 12 | public void waitServerStopCompletely() { 13 | // sleep 1 s to prevent BindException (Address already in use) when running the tests 14 | try { 15 | Thread.sleep(1000); 16 | } catch (InterruptedException ignore) {} 17 | } 18 | 19 | @Test 20 | public void testStopUndertowNotStarted() { 21 | Undertow.builder().build().stop(); 22 | } 23 | 24 | @Test 25 | public void testStopUndertowAfterExceptionDuringStart() { 26 | // Making the NioXnioWorker constructor throw an exception, resulting in the Undertow.worker field not getting set. 27 | Undertow undertow = Undertow.builder().setWorkerOption(Options.WORKER_IO_THREADS, -1).build(); 28 | try { 29 | undertow.start(); 30 | } catch (RuntimeException ignore) { 31 | } 32 | undertow.stop(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/handlers/error/errorpage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Error Page 4 | 5 | 6 | Custom Error Page 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/handlers/file/data1.json: -------------------------------------------------------------------------------- 1 | { 2 | "undertow": { 3 | "title": "compressed resource", 4 | "subtype": { 5 | "method": "test json compressed resource", 6 | "listInfo": { 7 | "test": { 8 | "json": "js", 9 | "compressed": "c", 10 | "resource": "this file", 11 | "type": "data", 12 | "def": { 13 | "thisFile": "Test purposes", 14 | "seeAlso": ["data2", "json"] 15 | }, 16 | "See": "compression" 17 | } 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/handlers/file/data2.json: -------------------------------------------------------------------------------- 1 | { 2 | "undertow": { 3 | "title": "compressed resource", 4 | "subtype": { 5 | "method": "test json compressed resource", 6 | "listInfo": { 7 | "test": { 8 | "json": "js", 9 | "compressed": "c", 10 | "resource": "this file", 11 | "type": "data", 12 | "def": { 13 | "thisFile": "Test purposes", 14 | "seeAlso": ["data1", "json"] 15 | }, 16 | "See": "compression" 17 | } 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/handlers/file/page.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | Page 22 | 23 | 24 | A web page 25 | 26 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/handlers/file/subdir/a.txt: -------------------------------------------------------------------------------- 1 | a file 2 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/handlers/form/uploadfile.txt: -------------------------------------------------------------------------------- 1 | file contents 2 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/handlers/largerange.txt: -------------------------------------------------------------------------------- 1 | 1:0123456789#2:0123456789#3:0123456789#4:0123456789#5:0123456789#6:0123456789#7:0123456789#8:0123456789#9:0123456789#10:0123456789#11:0123456789#12:0123456789#13:0123456789#14:0123456789#15:0123456789#16:0123456789#17:0123456789#18:0123456789#19:0123456789#20:0123456789#21:0123456789#22:0123456789#23:0123456789#24:0123456789#25:0123456789#26:0123456789#27:0123456789#28:0123456789#29:0123456789#30:0123456789#31:0123456789#32:0123456789#33:0123456789#34:0123456789#35:0123456789#36:0123456789#37:0123456789#38:0123456789#39:0123456789#40:0123456789#41:0123456789#42:0123456789#43:0123456789#44:0123456789#45:0123456789#46:0123456789#47:0123456789#48:0123456789#49:0123456789#50:0123456789#51:0123456789#52:0123456789#53:0123456789#54:0123456789#55:0123456789#56:0123456789#57:0123456789#58:0123456789#59:0123456789#60:0123456789#61:0123456789#62:0123456789#63:0123456789#64:0123456789#65:0123456789#66:0123456789#67:0123456789#68:0123456789#69:0123456789#70:0123456789#71:0123456789#72:0123456789#73:0123456789#74:0123456789abcdefg# -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/handlers/proxy/mod_cluster/NodeTestHandlers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.server.handlers.proxy.mod_cluster; 20 | 21 | import io.undertow.server.handlers.PathHandler; 22 | 23 | /** 24 | * @author Emanuel Muckenhuber 25 | */ 26 | interface NodeTestHandlers { 27 | 28 | void setup(PathHandler handler, NodeTestConfig config); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/handlers/range.txt: -------------------------------------------------------------------------------- 1 | 0123456789 -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/server/protocol/ajp/sample-ajp-request: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/core/src/test/java/io/undertow/server/protocol/ajp/sample-ajp-request -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/testutils/AjpIgnore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.testutils; 20 | 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | /** 26 | * @author Stuart Douglas 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Inherited 30 | public @interface AjpIgnore { 31 | boolean apacheOnly() default false; 32 | 33 | String value() default ""; 34 | } 35 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/testutils/HttpOneOnly.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.testutils; 20 | 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | /** 26 | * Marks a test as only applicable to HTTP 1, so it will be ignored for other transports 27 | * 28 | * @author Stuart Douglas 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Inherited 32 | public @interface HttpOneOnly { 33 | 34 | String value() default ""; 35 | } 36 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/testutils/HttpsIgnore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.testutils; 20 | 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | /** 26 | * @author Stuart Douglas 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Inherited 30 | public @interface HttpsIgnore { 31 | 32 | String value() default ""; 33 | } 34 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/testutils/IPv6Ignore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2021 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.testutils; 20 | 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | 24 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 25 | 26 | @Retention(RUNTIME) 27 | @Inherited 28 | public @interface IPv6Ignore { 29 | 30 | String value() default ""; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/testutils/IPv6Only.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2021 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.testutils; 20 | 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | 24 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 25 | 26 | @Retention(RUNTIME) 27 | @Inherited 28 | public @interface IPv6Only { 29 | 30 | String value() default ""; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/testutils/ProxyIgnore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.testutils; 20 | 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | 24 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 25 | 26 | /** 27 | * 28 | * @author Stuart Douglas 29 | */ 30 | @Retention(RUNTIME) 31 | @Inherited 32 | public @interface ProxyIgnore { 33 | 34 | String value() default ""; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/testutils/category/FunctionalTest.java: -------------------------------------------------------------------------------- 1 | package io.undertow.testutils.category; 2 | 3 | /** 4 | * Marker class used by JUnit categories representing unit tests 5 | */ 6 | public interface FunctionalTest { 7 | } 8 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/testutils/category/UnitTest.java: -------------------------------------------------------------------------------- 1 | package io.undertow.testutils.category; 2 | 3 | /** 4 | * Marker class used by JUnit categories representing unit tests 5 | */ 6 | public interface UnitTest { 7 | } 8 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/util/HeadersUtilsTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.util; 20 | 21 | import io.undertow.testutils.category.UnitTest; 22 | import org.junit.Assert; 23 | import org.junit.Test; 24 | import org.junit.experimental.categories.Category; 25 | 26 | /** 27 | * Tests param extraction of a header 28 | * 29 | * @author Tim Terlegård 30 | */ 31 | @Category(UnitTest.class) 32 | public class HeadersUtilsTestCase { 33 | 34 | @Test 35 | public void testTokenExtraction() { 36 | 37 | Assert.assertEquals("--xyz", Headers.extractTokenFromHeader("multipart/form-data; boundary=--xyz; param=abc", "boundary")); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/util/LocaleUtilsTestCase.java: -------------------------------------------------------------------------------- 1 | package io.undertow.util; 2 | 3 | import io.undertow.testutils.category.UnitTest; 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | import org.junit.experimental.categories.Category; 7 | 8 | import java.util.Locale; 9 | 10 | @Category(UnitTest.class) 11 | public class LocaleUtilsTestCase { 12 | 13 | @Test 14 | public void testGetLocaleFromInvalidString() throws Exception { 15 | Assert.assertEquals(LocaleUtils.getLocaleFromString("-"), new Locale("")); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/util/mime-multiline.txt: -------------------------------------------------------------------------------- 1 | --unique-boundary-1 2 | Content-type: text/plain; 3 | charset="ascii" 4 | 5 | Here is some text. 6 | --unique-boundary-1 7 | 8 | Here is some more text. 9 | --unique-boundary-1-- 10 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/util/mime-utf8.txt: -------------------------------------------------------------------------------- 1 | This is a preamble 2 | --unique-boundary-1 3 | Content-type: text/plain 4 | Content-Disposition: attachment; filename=个专为语文教学而设计的电脑软件.txt 5 | 6 | Just some chinese characters I copied from the internet, no idea what it says. 7 | --unique-boundary-1-- 8 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/util/mime1.txt: -------------------------------------------------------------------------------- 1 | This is a preamble 2 | --unique-boundary-1 3 | Content-type: text/plain 4 | 5 | Here is some text. 6 | --unique-boundary-1 7 | 8 | Here is some more text. 9 | --unique-boundary-1-- 10 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/util/mime2.txt: -------------------------------------------------------------------------------- 1 | --unique-boundary-1 2 | Content-type: text/plain 3 | 4 | Here is some text. 5 | --unique-boundary-1 6 | 7 | Here is some more text. 8 | --unique-boundary-1-- 9 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/util/mime3.txt: -------------------------------------------------------------------------------- 1 | --unique-boundary-1 2 | Content-type: text/plain 3 | Content-Transfer-encoding: base64 4 | 5 | VGhpcyBpcyBzb21lIGJhc2U2NCB0ZXh0Lg== 6 | --unique-boundary-1 7 | Content-Transfer-encoding: base64 8 | 9 | VGhpcyBpcyBzb21lIG1vcmUgYmFzZTY0IHRleHQu 10 | --unique-boundary-1-- 11 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/util/mime4.txt: -------------------------------------------------------------------------------- 1 | --someboundarytext 2 | Content-type: text/plain 3 | Content-Transfer-encoding: quoted-printable 4 | 5 | time=3Dmoney. 6 | --someboundarytext-- 7 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/websockets/core/protocol/WebSocket08ServerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.websockets.core.protocol; 19 | 20 | import io.netty.handler.codec.http.websocketx.WebSocketVersion; 21 | 22 | /** 23 | * @author Norman Maurer 24 | */ 25 | public class WebSocket08ServerTest extends WebSocket07ServerTest { 26 | @Override 27 | protected WebSocketVersion getVersion() { 28 | return WebSocketVersion.V08; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /core/src/test/java/io/undertow/websockets/core/protocol/WebSocket13ServerTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.websockets.core.protocol; 19 | 20 | import io.netty.handler.codec.http.websocketx.WebSocketVersion; 21 | 22 | /** 23 | * @author Norman Maurer 24 | */ 25 | public class WebSocket13ServerTestCase extends WebSocket08ServerTest { 26 | 27 | @Override 28 | protected WebSocketVersion getVersion() { 29 | return WebSocketVersion.V13; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /core/src/test/resources/ajp-apache-site: -------------------------------------------------------------------------------- 1 | Listen 9080 2 | NameVirtualHost *:9080 3 | 4 | ProxyPass / ajp://localhost:8888/ 5 | ProxyPassReverse / ajp://localhost:8888/ 6 | 7 | Listen 9443 8 | NameVirtualHost *:9443 9 | 10 | SSLEngine on 11 | SSLCertificateFile /etc/apache2/ssl/server.pem 12 | SSLCACertificateFile /etc/apache2/ssl/ca.crt 13 | 14 | SSLVerifyClient optional 15 | SSLVerifyDepth 2 16 | SSLOptions +ExportCertData +StdEnvVars 17 | 18 | ProxyPass / ajp://localhost:8888/ 19 | ProxyPassReverse / ajp://localhost:8888/ 20 | 21 | -------------------------------------------------------------------------------- /core/src/test/resources/byteman-netwok.btm: -------------------------------------------------------------------------------- 1 | 2 | RULE handling NEED_WRAP 3 | CLASS org.xnio.ssl.JsseConnectedSslStreamChannel 4 | METHOD handleHandshake 5 | #AT INVOKE org.xnio.ssl.JsseConnectedSslStreamChannel.handleWrapResult 6 | AFTER INVOKE org.xnio.Pooled.getResource 1 7 | IF TRUE 8 | DO 9 | debug("Read is trying to wrap as a result of NEED_WRAP... wait for the channel to be closed"), 10 | signalWake("handleHandshake at invoke handleWrapResult", true), 11 | waitFor("channel closed"), 12 | debug("Proceeding with handleWrapResult") 13 | ENDRULE 14 | 15 | RULE before close channel 16 | CLASS org.xnio.ssl.JsseConnectedSslStreamChannel 17 | METHOD closeAction 18 | AT ENTRY 19 | IF TRUE 20 | DO 21 | debug("Channel is closing... waiting for handleHandshake first"), 22 | waitFor("handleHandshake at invoke handleWrapResult"), 23 | debug("Proceeding with closeAction") 24 | ENDRULE 25 | 26 | 27 | RULE after close channel 28 | CLASS org.xnio.ssl.JsseConnectedSslStreamChannel 29 | METHOD closeAction 30 | AT EXIT 31 | IF TRUE 32 | DO 33 | debug("Channel is closed... waking read"), 34 | signalWake("channel closed", true) 35 | ENDRULE 36 | -------------------------------------------------------------------------------- /core/src/test/resources/ca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDNjCCAh6gAwIBAgIEUPqtwDANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJHQjEOMAwGA1UE 3 | CBMFU3RhdGUxDTALBgNVBAcTBENpdHkxDDAKBgNVBAoTA09yZzELMAkGA1UECxMCT1UxFDASBgNV 4 | BAMTC1Rlc3QgQ2xpZW50MB4XDTEzMDExOTE0MjkyMFoXDTIzMDExNzE0MjkyMFowXTELMAkGA1UE 5 | BhMCR0IxDjAMBgNVBAgTBVN0YXRlMQ0wCwYDVQQHEwRDaXR5MQwwCgYDVQQKEwNPcmcxCzAJBgNV 6 | BAsTAk9VMRQwEgYDVQQDEwtUZXN0IENsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 7 | ggEBAIFcxcn1M4hmgoH33g3pSu0kHyD345Xs3Jk23xA8YvxJxUeYReZo94Pcfi6nky2mhR4+wGo8 8 | +CZAMO3/kqxfBcBY/NIbLZtEKQ+sABZc/2Sqc1w1r2V4TsxibRLDpexbD9+S7aLAhTTpOwBFJIv3 9 | eQU2jz+X4RVXM73zPRA1aofqxl5eU/P8Fj+p0JUzNBQvxd+FizrzPYUkRJSMIZPCBax1uRgJ8u0L 10 | 5DQ6AxXe+OgTCJ/ghDys9ZwLhBHZNeav8/ih2twwd45RokAw1h511+KKKcJyBpEfHyrFelYDecUk 11 | C0YphlPV7zTWrnBxJEtrLKyeKO+oH+rvUTCexO07DM0CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEA 12 | XJEQri5VU0Ly/fTwhOG4OvQYtihwCVAwgev+GK6/ob/DWR3s0xYVpmAs+nzaFjqiHL8YDM2u4Gns 13 | 5u7eY0+eyfq+jSwvEjhfmWG3cYDTNvbOOuG4TrXOb6AUrqSLxm6A7K6PhjBoipNUFLOyiWNCfrRi 14 | FMBgJHvLZcyv0IZQXLzimfgo6rZRpmXR85dq50UYaFOLxw2kqkncU8UCo04M4rL1f2T4XHaXdttm 15 | df3EZ5pobrANKUMXV79ihF9LYH+yrc602pVLsBsRLWvVRagymP8w6hGgMnyTAgVmBIUC7FNiEKyI 16 | w9/tpVofINLO+Khr0kVDtGZe9xHWSS4DdNcdUA== 17 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /core/src/test/resources/client.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/core/src/test/resources/client.keystore -------------------------------------------------------------------------------- /core/src/test/resources/client.truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/core/src/test/resources/client.truststore -------------------------------------------------------------------------------- /core/src/test/resources/krb5.conf: -------------------------------------------------------------------------------- 1 | [libdefaults] 2 | default_realm = UNDERTOW.IO 3 | default_tgs_enctypes = aes128-cts-hmac-sha1-96,des-cbc-md5,des3-cbc-sha1-kd 4 | default_tkt_enctypes = aes128-cts-hmac-sha1-96,des-cbc-md5,des3-cbc-sha1-kd 5 | kdc_timeout = 5000 6 | dns_lookup_realm = false 7 | dns_lookup_kdc = false 8 | allow_weak_crypto = yes 9 | forwardable = true 10 | 11 | [realms] 12 | UNDERTOW.IO = { 13 | kdc = localhost:6088 14 | } 15 | 16 | [login] 17 | krb4_convert = true 18 | krb4_get_tickets = false 19 | -------------------------------------------------------------------------------- /core/src/test/resources/ldif/krbtgt.ldif: -------------------------------------------------------------------------------- 1 | dn: uid=krbtgt,ou=users,dc=undertow,dc=io 2 | objectClass: top 3 | objectClass: person 4 | objectClass: inetOrgPerson 5 | objectClass: krb5principal 6 | objectClass: krb5kdcentry 7 | cn: KDC Service 8 | sn: Service 9 | uid: krbtgt 10 | userPassword: secret 11 | krb5PrincipalName: krbtgt/UNDERTOW.IO@UNDERTOW.IO 12 | krb5KeyVersionNumber: 0 -------------------------------------------------------------------------------- /core/src/test/resources/ldif/partition.ldif: -------------------------------------------------------------------------------- 1 | dn: ou=users,dc=undertow,dc=io 2 | objectClass: organizationalUnit 3 | objectClass: top 4 | ou: users -------------------------------------------------------------------------------- /core/src/test/resources/ldif/server.ldif: -------------------------------------------------------------------------------- 1 | dn: uid=Server,ou=users,dc=undertow,dc=io 2 | objectClass: top 3 | objectClass: person 4 | objectClass: inetOrgPerson 5 | objectClass: krb5principal 6 | objectClass: krb5kdcentry 7 | cn: Server 8 | sn: Service 9 | uid: Server 10 | userPassword: servicepwd 11 | krb5PrincipalName: HTTP/${hostname}@UNDERTOW.IO 12 | krb5KeyVersionNumber: 0 -------------------------------------------------------------------------------- /core/src/test/resources/ldif/user.ldif: -------------------------------------------------------------------------------- 1 | dn: uid=jduke,ou=users,dc=undertow,dc=io 2 | objectClass: top 3 | objectClass: person 4 | objectClass: inetOrgPerson 5 | objectClass: krb5principal 6 | objectClass: krb5kdcentry 7 | cn: Java Duke 8 | sn: duke 9 | uid: jduke 10 | userPassword: theduke 11 | krb5PrincipalName: jduke@UNDERTOW.IO 12 | krb5KeyVersionNumber: 0 13 | -------------------------------------------------------------------------------- /core/src/test/resources/server.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/core/src/test/resources/server.keystore -------------------------------------------------------------------------------- /core/src/test/resources/server.truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/core/src/test/resources/server.truststore -------------------------------------------------------------------------------- /examples/README: -------------------------------------------------------------------------------- 1 | Undertow Examples 2 | 3 | These provide some simple examples of how to run an embedded Undertow server. 4 | 5 | To run the examples simply run 6 | 7 | java -jar target/undertow-examples.jar 8 | 9 | or alternatively: 10 | 11 | mvn exec:exec 12 | 13 | And select the example you wish to run from the menu -------------------------------------------------------------------------------- /examples/conf/nodes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | localhost 5 | 8080 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/src/main/java/io/undertow/examples/UndertowExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.examples; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * @author Stuart Douglas 28 | */ 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Target(ElementType.TYPE) 31 | public @interface UndertowExample { 32 | String value(); 33 | String location() default "http://localhost:8080"; 34 | } 35 | -------------------------------------------------------------------------------- /examples/src/main/java/io/undertow/examples/http2/client.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/examples/src/main/java/io/undertow/examples/http2/client.keystore -------------------------------------------------------------------------------- /examples/src/main/java/io/undertow/examples/http2/client.truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/examples/src/main/java/io/undertow/examples/http2/client.truststore -------------------------------------------------------------------------------- /examples/src/main/java/io/undertow/examples/http2/server.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/examples/src/main/java/io/undertow/examples/http2/server.keystore -------------------------------------------------------------------------------- /examples/src/main/java/io/undertow/examples/http2/server.truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/examples/src/main/java/io/undertow/examples/http2/server.truststore -------------------------------------------------------------------------------- /examples/src/main/java/io/undertow/examples/jsrwebsockets/JsrChatWebSocketEndpoint.java: -------------------------------------------------------------------------------- 1 | package io.undertow.examples.jsrwebsockets; 2 | 3 | import jakarta.websocket.OnMessage; 4 | import jakarta.websocket.Session; 5 | import jakarta.websocket.server.ServerEndpoint; 6 | 7 | /** 8 | * @author Stuart Douglas 9 | */ 10 | @ServerEndpoint("/myapp") 11 | public class JsrChatWebSocketEndpoint { 12 | 13 | @OnMessage 14 | public void message(String message, Session session) { 15 | for (Session s : session.getOpenSessions()) { 16 | s.getAsyncRemote().sendText(message); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /parser-generator/src/main/java/io/undertow/annotationprocessor/HttpParserConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.annotationprocessor; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * 28 | * If this annotation is applied to a class it will be replaced with a generated HTTP parser. 29 | * 30 | * @author Stuart Douglas 31 | */ 32 | @Retention(RetentionPolicy.SOURCE) 33 | @Target(ElementType.TYPE) 34 | public @interface HttpParserConfig { 35 | String[] methods(); 36 | String[] protocols(); 37 | String[] headers(); 38 | } 39 | -------------------------------------------------------------------------------- /parser-generator/src/main/java/io/undertow/annotationprocessor/HttpResponseParserConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.annotationprocessor; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * 28 | * If this annotation is applied to a class it will be replaced with a generated HTTP parser. 29 | * 30 | * @author Stuart Douglas 31 | * @author Emanuel Muckenhuber 32 | */ 33 | @Retention(RetentionPolicy.SOURCE) 34 | @Target(ElementType.TYPE) 35 | public @interface HttpResponseParserConfig { 36 | String[] protocols(); 37 | String[] headers(); 38 | } 39 | -------------------------------------------------------------------------------- /parser-generator/src/main/resources/META-INF/services/javax.annotation.processing.Processor: -------------------------------------------------------------------------------- 1 | io.undertow.annotationprocessor.HttpParserAnnotationProcessor -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/ExceptionLog.java: -------------------------------------------------------------------------------- 1 | package io.undertow.servlet; 2 | 3 | import org.jboss.logging.Logger; 4 | 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Inherited; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | /** 12 | * Annotation that can be applied to exceptions to control how they are logged by Undertow. 13 | * 14 | * Note that this will only take effect if the deployments error handler has not been changed. 15 | * 16 | * @author Stuart Douglas 17 | */ 18 | @Retention(RetentionPolicy.RUNTIME) 19 | @Target(ElementType.TYPE) 20 | @Inherited 21 | public @interface ExceptionLog { 22 | /** 23 | * The default log level for this exception. 24 | */ 25 | Logger.Level value() default Logger.Level.ERROR; 26 | 27 | /** 28 | * The level at which to log stack traces. If this is a higher level 29 | * than the default then they will be logged by default at the default level. 30 | */ 31 | Logger.Level stackTraceLevel() default Logger.Level.FATAL; 32 | 33 | /** 34 | * The category to log this exception under 35 | */ 36 | String category(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/ClassIntrospecter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | /** 22 | * 23 | * Interface that is provided by the container to create a servlet / filter / listener 24 | * definition from a given class, based on the annotations present on the class. 25 | * 26 | * This is needed to allow for annotations to be taken into account when servlets etc are 27 | * added programatically. 28 | * 29 | * @author Stuart Douglas 30 | */ 31 | public interface ClassIntrospecter { 32 | 33 | InstanceFactory createInstanceFactory(Class clazz) throws NoSuchMethodException; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/InstanceFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | /** 22 | * Factory that creates fully injected component instances. 23 | * 24 | * @author Stuart Douglas 25 | */ 26 | public interface InstanceFactory { 27 | 28 | /** 29 | * Factory that creates a fully injected instance. 30 | * 31 | * @return The fully injected instance 32 | */ 33 | InstanceHandle createInstance() throws InstantiationException; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/InstanceHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | /** 22 | * A handle for a container managed instance. When the servlet container is 23 | * done with it it should call the {@link #release()} method 24 | * 25 | * @author Stuart Douglas 26 | */ 27 | public interface InstanceHandle { 28 | 29 | /** 30 | * @return The managed instance 31 | * 32 | */ 33 | T getInstance(); 34 | 35 | /** 36 | * releases the instance, uninjecting and calling an pre-destroy methods as appropriate 37 | */ 38 | void release(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/LifecycleInterceptor.java: -------------------------------------------------------------------------------- 1 | package io.undertow.servlet.api; 2 | 3 | import jakarta.servlet.Filter; 4 | import jakarta.servlet.Servlet; 5 | import jakarta.servlet.ServletException; 6 | 7 | /** 8 | * Class that is run around invocations of servlet and filter lifecycle methods (init and destroy). 9 | * 10 | * Note that this only deals with lifecycle methods that are defined by the servlet spec. @POstConstruct, 11 | * PreDestroy and Inject methods are not handled. 12 | * 13 | * @author Stuart Douglas 14 | */ 15 | public interface LifecycleInterceptor { 16 | 17 | void init(ServletInfo servletInfo, Servlet servlet, LifecycleContext context) throws ServletException; 18 | 19 | void init(FilterInfo filterInfo, Filter filter, LifecycleContext context) throws ServletException; 20 | 21 | void destroy(ServletInfo servletInfo, Servlet servlet, LifecycleContext context) throws ServletException; 22 | 23 | void destroy(FilterInfo filterInfo, Filter filter, LifecycleContext context) throws ServletException; 24 | 25 | interface LifecycleContext { 26 | void proceed() throws ServletException; 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/MetricsCollector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | import io.undertow.server.handlers.MetricsHandler; 22 | 23 | /** 24 | * An interface that can be used to collect Servlet metrics 25 | * 26 | * @author Tomaz Cerar (c) 2014 Red Hat Inc. 27 | */ 28 | public interface MetricsCollector { 29 | 30 | void registerMetric(String servletName, MetricsHandler handler); 31 | } 32 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/MimeMapping.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public class MimeMapping { 25 | private final String extension; 26 | private final String mimeType; 27 | 28 | public MimeMapping(final String extension, final String mimeType) { 29 | this.extension = extension; 30 | this.mimeType = mimeType; 31 | } 32 | 33 | public String getExtension() { 34 | return extension; 35 | } 36 | 37 | public String getMimeType() { 38 | return mimeType; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/ServletStackTraces.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public enum ServletStackTraces { 25 | 26 | NONE("none"), 27 | LOCAL_ONLY("local-only"), 28 | ALL("all"); 29 | 30 | private final String value; 31 | 32 | ServletStackTraces(String value) { 33 | this.value = value; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return value; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/SessionConfigWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | import io.undertow.server.session.SessionConfig; 22 | 23 | /** 24 | * A class that allows the SessionConfig to be wrapped. 25 | * 26 | * This is generally used to append JVM route information to the session ID in clustered environments. 27 | * 28 | * @author Stuart Douglas 29 | */ 30 | public interface SessionConfigWrapper { 31 | 32 | SessionConfig wrap(SessionConfig sessionConfig, Deployment deployment); 33 | } 34 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/SessionManagerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | import io.undertow.server.session.SessionManager; 22 | 23 | /** 24 | * Factory class used to create a session manager 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | public interface SessionManagerFactory { 29 | 30 | SessionManager createSessionManager(Deployment deployment); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/ThreadSetupHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | import io.undertow.server.HttpServerExchange; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public interface ThreadSetupHandler { 27 | 28 | Action create(Action action); 29 | 30 | interface Action { 31 | T call(HttpServerExchange exchange, C context) throws Exception; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/api/TransportGuaranteeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.api; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public enum TransportGuaranteeType { 25 | NONE, 26 | INTEGRAL, 27 | CONFIDENTIAL, 28 | REJECTED; 29 | } 30 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/compat/rewrite/Resolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.compat.rewrite; 20 | 21 | /** 22 | * Resolver abstract class. 23 | * 24 | * @author Remy Maucherat 25 | */ 26 | public abstract class Resolver { 27 | 28 | public abstract String resolve(String key); 29 | 30 | public String resolveEnv(String key) { 31 | return System.getProperty(key); 32 | } 33 | 34 | public abstract String resolveSsl(String key); 35 | 36 | public abstract String resolveHttp(String key); 37 | 38 | public abstract boolean resolveResource(int type, String name); 39 | 40 | } -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/compat/rewrite/RewriteMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.compat.rewrite; 20 | 21 | /** 22 | * @author Remy Maucherat 23 | */ 24 | public interface RewriteMap { 25 | 26 | String setParameters(String params); 27 | 28 | String lookup(String key); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/core/Lifecycle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.core; 20 | 21 | import jakarta.servlet.ServletException; 22 | 23 | /** 24 | * 25 | * An object that can be started or stopped. 26 | * 27 | * @author Stuart Douglas 28 | */ 29 | public interface Lifecycle { 30 | 31 | void start() throws ServletException; 32 | 33 | void stop() throws ServletException; 34 | 35 | boolean isStarted(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/handlers/security/ServletSingleSignOnAuthenticationMechainism.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.handlers.security; 20 | 21 | import io.undertow.security.impl.SingleSignOnManager; 22 | 23 | /** 24 | * This class name has a type, kept for backwards compatibility reasons 25 | * 26 | * @author Stuart Douglas 27 | */ 28 | @Deprecated 29 | public class ServletSingleSignOnAuthenticationMechainism extends ServletSingleSignOnAuthenticationMechanism { 30 | public ServletSingleSignOnAuthenticationMechainism(SingleSignOnManager storage) { 31 | super(storage); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/util/ImmediateInstanceFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.util; 20 | 21 | import io.undertow.servlet.api.InstanceFactory; 22 | import io.undertow.servlet.api.InstanceHandle; 23 | 24 | /** 25 | * @author Stuart Douglas 26 | */ 27 | public class ImmediateInstanceFactory implements InstanceFactory { 28 | 29 | private final T instance; 30 | 31 | public ImmediateInstanceFactory(final T instance) { 32 | this.instance = instance; 33 | } 34 | 35 | @Override 36 | public InstanceHandle createInstance() throws InstantiationException { 37 | return new ImmediateInstanceHandle<>(instance); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /servlet/src/main/java/io/undertow/servlet/util/ImmediateInstanceHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.util; 20 | 21 | import io.undertow.servlet.api.InstanceHandle; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class ImmediateInstanceHandle implements InstanceHandle { 27 | 28 | private final T instance; 29 | 30 | public ImmediateInstanceHandle(final T instance) { 31 | this.instance = instance; 32 | } 33 | 34 | @Override 35 | public T getInstance() { 36 | return instance; 37 | } 38 | 39 | @Override 40 | public void release() { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /servlet/src/main/resources/META-INF/services/io.undertow.attribute.ExchangeAttributeBuilder: -------------------------------------------------------------------------------- 1 | io.undertow.servlet.attribute.ServletRequestAttribute$Builder 2 | io.undertow.servlet.attribute.ServletSessionAttribute$Builder 3 | io.undertow.servlet.attribute.ServletSessionIdAttribute$Builder 4 | io.undertow.servlet.attribute.ServletRequestURLAttribute$Builder 5 | io.undertow.servlet.attribute.ServletRequestLineAttribute$Builder 6 | io.undertow.servlet.attribute.ServletRelativePathAttribute$Builder 7 | io.undertow.servlet.attribute.ServletRequestedSessionIdAttribute$Builder 8 | io.undertow.servlet.attribute.ServletRequestedSessionIdFromCookieAttribute$Builder 9 | io.undertow.servlet.attribute.ServletRequestedSessionIdValidAttribute$Builder 10 | io.undertow.servlet.attribute.ServletRequestLocaleAttribute$Builder 11 | io.undertow.servlet.attribute.ServletRequestCharacterEncodingAttribute$Builder 12 | io.undertow.servlet.attribute.ServletContextAttribute$Builder 13 | io.undertow.servlet.attribute.ServletRequestParameterAttribute$Builder 14 | io.undertow.servlet.attribute.ServletNameAttribute$Builder 15 | -------------------------------------------------------------------------------- /servlet/src/main/resources/META-INF/services/io.undertow.predicate.PredicateBuilder: -------------------------------------------------------------------------------- 1 | io.undertow.servlet.predicate.DispatcherTypePredicate$Builder 2 | io.undertow.servlet.predicate.DirectoryPredicate$Builder 3 | io.undertow.servlet.predicate.FilePredicate$Builder -------------------------------------------------------------------------------- /servlet/src/main/resources/META-INF/services/io.undertow.server.handlers.builder.HandlerBuilder: -------------------------------------------------------------------------------- 1 | io.undertow.servlet.handlers.MarkSecureHandler$Builder 2 | -------------------------------------------------------------------------------- /servlet/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer: -------------------------------------------------------------------------------- 1 | io.undertow.servlet.sse.ServerSentEventSCI -------------------------------------------------------------------------------- /servlet/src/main/resources/io/undertow/servlet/core/charset.mapping: -------------------------------------------------------------------------------- 1 | ar=ISO-8859-6 2 | be=ISO-8859-5 3 | bg=ISO-8859-5 4 | ca=ISO-8859-1 5 | cs=ISO-8859-2 6 | da=ISO-8859-1 7 | de=ISO-8859-1 8 | el=ISO-8859-7 9 | en=ISO-8859-1 10 | es=ISO-8859-1 11 | et=ISO-8859-1 12 | fi=ISO-8859-1 13 | fr=ISO-8859-1 14 | hr=ISO-8859-2 15 | hu=ISO-8859-2 16 | is=ISO-8859-1 17 | it=ISO-8859-1 18 | iw=ISO-8859-8 19 | ja=Shift_JIS 20 | ko=EUC-KR 21 | lt=ISO-8859-2 22 | lv=ISO-8859-2 23 | mk=ISO-8859-5 24 | nl=ISO-8859-1 25 | no=ISO-8859-1 26 | pl=ISO-8859-2 27 | pt=ISO-8859-1 28 | ro=ISO-8859-2 29 | ru=ISO-8859-5 30 | sh=ISO-8859-5 31 | sk=ISO-8859-2 32 | sl=ISO-8859-2 33 | sq=ISO-8859-2 34 | sr=ISO-8859-5 35 | sv=ISO-8859-1 36 | tr=ISO-8859-9 37 | uk=ISO-8859-5 38 | zh=GB2312 39 | zh_HK=Big5 40 | zh_TW=Big5 41 | 42 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/async/AsyncErrorServlet.java: -------------------------------------------------------------------------------- 1 | package io.undertow.servlet.test.async; 2 | 3 | import io.undertow.util.StatusCodes; 4 | 5 | import jakarta.servlet.ServletException; 6 | import jakarta.servlet.http.HttpServlet; 7 | import jakarta.servlet.http.HttpServletRequest; 8 | import jakarta.servlet.http.HttpServletResponse; 9 | import java.io.IOException; 10 | 11 | /** 12 | * @author Stuart Douglas 13 | */ 14 | public class AsyncErrorServlet extends HttpServlet { 15 | 16 | @Override 17 | protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { 18 | req.startAsync(); 19 | Thread t = new Thread(new Runnable() { 20 | @Override 21 | public void run() { 22 | try { 23 | Thread.sleep(100); 24 | resp.sendError(StatusCodes.INTERNAL_SERVER_ERROR); 25 | } catch (Exception e) { 26 | throw new RuntimeException(e); 27 | } 28 | } 29 | }); 30 | t.start(); 31 | } 32 | 33 | @Override 34 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 35 | doGet(req, resp); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/async/TestAsyncRespWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.test.async; 20 | 21 | import java.io.IOException; 22 | import java.io.PrintWriter; 23 | 24 | import jakarta.servlet.http.HttpServletResponse; 25 | import jakarta.servlet.http.HttpServletResponseWrapper; 26 | 27 | class TestAsyncRespWrapper extends HttpServletResponseWrapper { 28 | TestAsyncRespWrapper(HttpServletResponse resp) { 29 | super(resp); 30 | } 31 | 32 | @Override 33 | public PrintWriter getWriter() throws IOException { 34 | PrintWriter writer = super.getWriter(); 35 | writer.write("wrapped: "); 36 | return writer; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/constant/GenericServletConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2021 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.constant; 19 | 20 | /** 21 | * @author Moulali Shikalwadi 22 | */ 23 | 24 | public class GenericServletConstants { 25 | public static final String LOCAL_ADDR = "localAddr"; 26 | public static final String LOCAL_NAME = "localName"; 27 | public static final String LOCAL_PORT = "localPort"; 28 | public static final String SERVER_NAME = "serverName"; 29 | public static final String SERVER_PORT = "serverPort"; 30 | public static final String REMOTE_ADDR = "remoteAddr"; 31 | public static final String REMOTE_PORT = "remotePort"; 32 | } 33 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/defaultservlet/disallowed.sh: -------------------------------------------------------------------------------- 1 | This is not a real shell script, but the default servlet will not serve it by default. -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/defaultservlet/filterpath/filtered.txt: -------------------------------------------------------------------------------- 1 | Stuart -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/defaultservlet/foo/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/servlet/src/test/java/io/undertow/servlet/test/defaultservlet/foo/.gitkeep -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/defaultservlet/foo/meta-inf/notsecret: -------------------------------------------------------------------------------- 1 | not confidential 2 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/defaultservlet/foo/web-inf/notsecret: -------------------------------------------------------------------------------- 1 | not confidential 2 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/defaultservlet/index.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | a page 21 | 22 | 23 | Redirected home page 24 | 25 | 26 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/defaultservlet/meta-inf/secret: -------------------------------------------------------------------------------- 1 | confidential 2 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/defaultservlet/path/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/servlet/src/test/java/io/undertow/servlet/test/defaultservlet/path/.gitkeep -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/defaultservlet/range.txt: -------------------------------------------------------------------------------- 1 | 0123456789 -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/dispatcher/DispatcherForwardServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2023 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.dispatcher; 19 | 20 | import jakarta.servlet.ServletException; 21 | import jakarta.servlet.http.HttpServlet; 22 | import jakarta.servlet.http.HttpServletRequest; 23 | import jakarta.servlet.http.HttpServletResponse; 24 | 25 | import java.io.IOException; 26 | /** 27 | * @author Moulali Shikalwadi 28 | */ 29 | public class DispatcherForwardServlet extends HttpServlet { 30 | @Override 31 | public void doGet(HttpServletRequest req, HttpServletResponse resp) 32 | throws IOException, ServletException { 33 | req.getRequestDispatcher("/next").forward(req, resp); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/dispatcher/DispatcherIncludeServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2023 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.dispatcher; 19 | 20 | import jakarta.servlet.ServletException; 21 | import jakarta.servlet.http.HttpServlet; 22 | import jakarta.servlet.http.HttpServletRequest; 23 | import jakarta.servlet.http.HttpServletResponse; 24 | 25 | import java.io.IOException; 26 | /** 27 | * @author Moulali Shikalwadi 28 | */ 29 | public class DispatcherIncludeServlet extends HttpServlet { 30 | @Override 31 | public void doGet(HttpServletRequest req, HttpServletResponse resp) 32 | throws IOException, ServletException { 33 | req.getRequestDispatcher("/next").include(req, resp); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/dispatcher/snippet.html: -------------------------------------------------------------------------------- 1 | SnippetText -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/dispatcher/util/DispatcherUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2023 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.dispatcher.util; 19 | 20 | import java.util.regex.Matcher; 21 | import java.util.regex.Pattern; 22 | 23 | /** 24 | * @author Moulali Shikalwadi 25 | */ 26 | public class DispatcherUtil { 27 | 28 | /** 29 | * Utility method to check if it contains a word 30 | * 31 | * @param fullString and partString 32 | * 33 | */ 34 | public static boolean containsWord(String fullString, String partString){ 35 | String pattern = "\\b"+partString+"\\b"; 36 | Pattern p= Pattern.compile(pattern); 37 | Matcher m=p.matcher(fullString); 38 | return m.find(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/errorpage/ChildException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.test.errorpage; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public class ChildException extends ParentException { 25 | } 26 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/errorpage/ParentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.test.errorpage; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public class ParentException extends Exception { 25 | } 26 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/errorpage/SecureServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.test.errorpage; 20 | 21 | import jakarta.servlet.http.HttpServlet; 22 | 23 | /** 24 | * @author Stuart Douglas 25 | */ 26 | public class SecureServlet extends HttpServlet { 27 | } 28 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/handlers/HttpContinueServletTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.test.handlers; 20 | 21 | import org.junit.runner.RunWith; 22 | import io.undertow.testutils.DefaultServer; 23 | import io.undertow.testutils.TestHttpClient; 24 | 25 | /** 26 | * @author Stuart Douglas 27 | */ 28 | @RunWith(DefaultServer.class) 29 | public class HttpContinueServletTestCase extends AbstractHttpContinueServletTestCase { 30 | 31 | protected String getServerAddress() { 32 | return DefaultServer.getDefaultServerURL(); 33 | } 34 | 35 | protected TestHttpClient getClient() { 36 | return new TestHttpClient(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/listener/ordering/FirstListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.listener.ordering; 19 | 20 | import io.undertow.servlet.test.util.Tracker; 21 | 22 | import jakarta.servlet.ServletRequestEvent; 23 | import jakarta.servlet.ServletRequestListener; 24 | 25 | public class FirstListener implements ServletRequestListener { 26 | 27 | @Override 28 | public void requestInitialized(ServletRequestEvent sre) { 29 | Tracker.addAction(FirstListener.class.getSimpleName()); 30 | } 31 | 32 | @Override 33 | public void requestDestroyed(ServletRequestEvent sre) { 34 | Tracker.addAction(FirstListener.class.getSimpleName()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/listener/ordering/SecondListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.listener.ordering; 19 | 20 | import io.undertow.servlet.test.util.Tracker; 21 | 22 | import jakarta.servlet.ServletRequestEvent; 23 | import jakarta.servlet.ServletRequestListener; 24 | 25 | public class SecondListener implements ServletRequestListener { 26 | 27 | @Override 28 | public void requestInitialized(ServletRequestEvent sre) { 29 | Tracker.addAction(SecondListener.class.getSimpleName()); 30 | } 31 | 32 | @Override 33 | public void requestDestroyed(ServletRequestEvent sre) { 34 | Tracker.addAction(SecondListener.class.getSimpleName()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/listener/request/async/onError/AsyncServlet4.java: -------------------------------------------------------------------------------- 1 | package io.undertow.servlet.test.listener.request.async.onError; 2 | 3 | import java.io.IOException; 4 | 5 | import jakarta.servlet.AsyncContext; 6 | import jakarta.servlet.ServletException; 7 | import jakarta.servlet.http.HttpServlet; 8 | import jakarta.servlet.http.HttpServletRequest; 9 | import jakarta.servlet.http.HttpServletResponse; 10 | 11 | /** 12 | * Exception occurs during its processing. No in delegated dispatch part. 13 | * 14 | */ 15 | public class AsyncServlet4 extends HttpServlet { 16 | 17 | @Override 18 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 19 | AsyncContext ctx = req.startAsync(); 20 | ctx.addListener(new AsyncEventListener()); 21 | ctx.addListener(new SimpleAsyncListener(ctx)); 22 | throw new NullPointerException(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/listener/request/async/onError/AsyncTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.listener.request.async.onError; 19 | 20 | import jakarta.servlet.AsyncContext; 21 | 22 | public class AsyncTask implements Runnable { 23 | 24 | private final AsyncContext ctx; 25 | 26 | public AsyncTask(AsyncContext ctx) { 27 | this.ctx = ctx; 28 | } 29 | 30 | @Override 31 | public void run() { 32 | ctx.dispatch("/faulty"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/listener/request/async/onError/FaultyServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.listener.request.async.onError; 19 | 20 | import java.io.IOException; 21 | 22 | import jakarta.servlet.ServletException; 23 | import jakarta.servlet.http.HttpServlet; 24 | import jakarta.servlet.http.HttpServletRequest; 25 | import jakarta.servlet.http.HttpServletResponse; 26 | 27 | public class FaultyServlet extends HttpServlet { 28 | 29 | @Override 30 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 31 | throw new IllegalStateException(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/listener/servletcontext/DeclareRolesServletContextListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2021 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.listener.servletcontext; 19 | 20 | import jakarta.servlet.ServletContextEvent; 21 | import jakarta.servlet.ServletContextListener; 22 | /** 23 | * 24 | * @author baranowb 25 | * 26 | */ 27 | public class DeclareRolesServletContextListener implements ServletContextListener{ 28 | 29 | public static final String[] ROLES = new String[] {"dobby","was","here"}; 30 | @Override 31 | public void contextInitialized(ServletContextEvent sce) { 32 | System.err.println(sce.getServletContext()); 33 | sce.getServletContext().declareRoles(ROLES); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/listener/session/SimpleSessionListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.servlet.test.listener.session; 19 | 20 | import jakarta.servlet.http.HttpSessionEvent; 21 | import jakarta.servlet.http.HttpSessionListener; 22 | 23 | import org.junit.Assert; 24 | 25 | 26 | public class SimpleSessionListener implements HttpSessionListener { 27 | 28 | @Override 29 | public void sessionCreated(HttpSessionEvent arg0) { 30 | } 31 | 32 | @Override 33 | public void sessionDestroyed(HttpSessionEvent event) { 34 | Assert.assertEquals("BAR", event.getSession().getAttribute("FOO")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/multipart/AddMultipartServetListener.java: -------------------------------------------------------------------------------- 1 | package io.undertow.servlet.test.multipart; 2 | 3 | import jakarta.servlet.MultipartConfigElement; 4 | import jakarta.servlet.ServletContextEvent; 5 | import jakarta.servlet.ServletContextListener; 6 | import jakarta.servlet.ServletRegistration; 7 | 8 | /** 9 | * @author Stuart Douglas 10 | */ 11 | public class AddMultipartServetListener implements ServletContextListener { 12 | @Override 13 | public void contextInitialized(ServletContextEvent sce) { 14 | ServletRegistration.Dynamic reg = sce.getServletContext().addServlet("added", new MultiPartServlet()); 15 | reg.addMapping("/added"); 16 | reg.setMultipartConfig(new MultipartConfigElement(System.getProperty("java.io.tmpdir"))); 17 | 18 | reg = sce.getServletContext().addServlet("getParam", new MultiPartServlet(true)); 19 | reg.addMapping("/getParam"); 20 | reg.setMultipartConfig(new MultipartConfigElement(System.getProperty("java.io.tmpdir"))); 21 | } 22 | 23 | @Override 24 | public void contextDestroyed(ServletContextEvent sce) { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/multipart/uploadfile.txt: -------------------------------------------------------------------------------- 1 | file contents -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/path/file.txt: -------------------------------------------------------------------------------- 1 | some file content -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/proprietry/IgnoresRequestAndSetsAttributeServlet.java: -------------------------------------------------------------------------------- 1 | package io.undertow.servlet.test.proprietry; 2 | 3 | import jakarta.servlet.ServletConfig; 4 | import jakarta.servlet.ServletException; 5 | import jakarta.servlet.http.HttpServlet; 6 | import jakarta.servlet.http.HttpServletRequest; 7 | import jakarta.servlet.http.HttpServletResponse; 8 | import java.io.IOException; 9 | 10 | public class IgnoresRequestAndSetsAttributeServlet extends HttpServlet { 11 | 12 | public static final String ATTRIBUTE_KEY = "attributeKey"; 13 | public static final String ATTRIBUTE_VALUE = "attributeValue"; 14 | 15 | private String attributeKey; 16 | private String attributeValue; 17 | 18 | @Override 19 | public void init(final ServletConfig config) throws ServletException { 20 | super.init(config); 21 | attributeKey = config.getInitParameter(ATTRIBUTE_KEY); 22 | attributeValue = config.getInitParameter(ATTRIBUTE_VALUE); 23 | } 24 | 25 | @Override 26 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 27 | req.setAttribute(attributeKey, attributeValue); 28 | } 29 | 30 | @Override 31 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 32 | doGet(req, resp); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/request/RaceyAddServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.test.request; 20 | 21 | import java.io.IOException; 22 | 23 | import jakarta.servlet.ServletException; 24 | import jakarta.servlet.http.HttpServlet; 25 | import jakarta.servlet.http.HttpServletRequest; 26 | import jakarta.servlet.http.HttpServletResponse; 27 | 28 | /** 29 | * @author Stuart Douglas 30 | */ 31 | public class RaceyAddServlet extends HttpServlet { 32 | 33 | volatile int value; 34 | 35 | @Override 36 | protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { 37 | resp.getWriter().write("" + (value++)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/request/RedirectServlet.java: -------------------------------------------------------------------------------- 1 | package io.undertow.servlet.test.request; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.http.HttpServlet; 5 | import jakarta.servlet.http.HttpServletRequest; 6 | import jakarta.servlet.http.HttpServletResponse; 7 | import java.io.IOException; 8 | 9 | /** 10 | * @author Stuart Douglas 11 | */ 12 | public class RedirectServlet extends HttpServlet { 13 | 14 | @Override 15 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 16 | resp.sendRedirect(req.getParameter("redirect")); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/response/contenttype/webstart.jnlp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Launch applet with Web Start 5 | Foo Bar Inc. 6 | 7 | 8 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/security/form/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | error page 4 | 5 | 6 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/servletcontext/1#2.txt: -------------------------------------------------------------------------------- 1 | Hello! -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/servletcontext/file.txt: -------------------------------------------------------------------------------- 1 | File Contents -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/session/ChangeSessionIdListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.test.session; 20 | 21 | import jakarta.servlet.http.HttpSessionEvent; 22 | import jakarta.servlet.http.HttpSessionIdListener; 23 | 24 | /** 25 | * @author Stuart Douglas 26 | */ 27 | public class ChangeSessionIdListener implements HttpSessionIdListener { 28 | 29 | public static volatile String oldId; 30 | public static volatile String newId; 31 | 32 | @Override 33 | public void sessionIdChanged(final HttpSessionEvent event, final String oldSessionId) { 34 | this.oldId = oldSessionId; 35 | this.newId = event.getSession().getId(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/spec/UnavailableServlet.java: -------------------------------------------------------------------------------- 1 | package io.undertow.servlet.test.spec; 2 | 3 | import jakarta.servlet.Servlet; 4 | import jakarta.servlet.ServletConfig; 5 | import jakarta.servlet.ServletException; 6 | import jakarta.servlet.ServletRequest; 7 | import jakarta.servlet.ServletResponse; 8 | import jakarta.servlet.UnavailableException; 9 | import java.io.IOException; 10 | 11 | /** 12 | * @author Stuart Douglas 13 | */ 14 | public class UnavailableServlet implements Servlet { 15 | 16 | static final String PERMANENT = "permanent"; 17 | static boolean first = true; 18 | 19 | @Override 20 | public void init(ServletConfig config) throws ServletException { 21 | if(config.getInitParameter(PERMANENT) != null) { 22 | throw new UnavailableException("msg"); 23 | } else if(first){ 24 | first = false; 25 | throw new UnavailableException("msg", 1); 26 | } 27 | } 28 | 29 | @Override 30 | public ServletConfig getServletConfig() { 31 | return null; 32 | } 33 | 34 | @Override 35 | public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { 36 | 37 | } 38 | 39 | @Override 40 | public String getServletInfo() { 41 | return null; 42 | } 43 | 44 | @Override 45 | public void destroy() { 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/spec/ValidCookieEchoServlet.java: -------------------------------------------------------------------------------- 1 | package io.undertow.servlet.test.spec; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.http.Cookie; 5 | import jakarta.servlet.http.HttpServlet; 6 | import jakarta.servlet.http.HttpServletRequest; 7 | import jakarta.servlet.http.HttpServletResponse; 8 | import java.io.IOException; 9 | import java.io.PrintWriter; 10 | 11 | /** 12 | * A servlet that echoes name and value pairs for received valid cookies only. 13 | * 14 | * @author Gael Marziou 15 | */ 16 | public class ValidCookieEchoServlet extends HttpServlet { 17 | 18 | @Override 19 | protected void doGet(final HttpServletRequest req, 20 | final HttpServletResponse resp) throws ServletException, IOException { 21 | 22 | Cookie[] cookies = req.getCookies(); 23 | 24 | PrintWriter out = resp.getWriter(); 25 | for (Cookie cookie : cookies) { 26 | out.print("name='" + cookie.getName() + "'"); 27 | out.print("value='" + cookie.getValue() + "'"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/wrapper/StandardRequestWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.test.wrapper; 20 | 21 | import jakarta.servlet.http.HttpServletRequest; 22 | import jakarta.servlet.http.HttpServletRequestWrapper; 23 | 24 | /** 25 | * @author Stuart Douglas 26 | */ 27 | public class StandardRequestWrapper extends HttpServletRequestWrapper { 28 | /** 29 | * Constructs a request object wrapping the given request. 30 | * 31 | * @throws IllegalArgumentException 32 | * if the request is null 33 | */ 34 | public StandardRequestWrapper(final HttpServletRequest request) { 35 | super(request); 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /servlet/src/test/java/io/undertow/servlet/test/wrapper/StandardResponseWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.servlet.test.wrapper; 20 | 21 | import jakarta.servlet.http.HttpServletResponse; 22 | import jakarta.servlet.http.HttpServletResponseWrapper; 23 | 24 | /** 25 | * @author Stuart Douglas 26 | */ 27 | public class StandardResponseWrapper extends HttpServletResponseWrapper { 28 | 29 | /** 30 | * Constructs a response adaptor wrapping the given response. 31 | * 32 | * @throws IllegalArgumentException if the response is null 33 | */ 34 | public StandardResponseWrapper(final HttpServletResponse response) { 35 | super(response); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /servlet/src/test/resources/dummy.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/undertow-io/undertow/bcd28cd16da7281f0c996c397611286224286f9e/servlet/src/test/resources/dummy.keystore -------------------------------------------------------------------------------- /websockets-jsr/src/main/java/io/undertow/websockets/jsr/annotated/BoundParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.jsr.annotated; 20 | 21 | import java.util.Map; 22 | import java.util.Set; 23 | 24 | import jakarta.websocket.DecodeException; 25 | 26 | /** 27 | * @author Stuart Douglas 28 | */ 29 | public interface BoundParameter { 30 | Set positions(); 31 | 32 | void populate(Object[] params, Map, Object> value) throws DecodeException; 33 | 34 | Class getType(); 35 | } 36 | -------------------------------------------------------------------------------- /websockets-jsr/src/main/resources/META-INF/services/io.undertow.servlet.ServletExtension: -------------------------------------------------------------------------------- 1 | io.undertow.websockets.jsr.Bootstrap 2 | -------------------------------------------------------------------------------- /websockets-jsr/src/main/resources/META-INF/services/io.undertow.websockets.jsr.WebsocketClientSslProvider: -------------------------------------------------------------------------------- 1 | io.undertow.websockets.jsr.DefaultWebSocketClientSslProvider -------------------------------------------------------------------------------- /websockets-jsr/src/main/resources/META-INF/services/jakarta.websocket.ContainerProvider: -------------------------------------------------------------------------------- 1 | io.undertow.websockets.jsr.UndertowContainerProvider 2 | -------------------------------------------------------------------------------- /websockets-jsr/src/main/resources/META-INF/services/jakarta.websocket.server.ServerEndpointConfig$Configurator: -------------------------------------------------------------------------------- 1 | io.undertow.websockets.jsr.DefaultContainerConfigurator 2 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/JsrWebSocketServer08Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.websockets.jsr.test; 19 | 20 | import io.netty.handler.codec.http.websocketx.WebSocketVersion; 21 | 22 | /** 23 | * @author Norman Maurer 24 | */ 25 | public class JsrWebSocketServer08Test extends JsrWebSocketServer07Test{ 26 | @Override 27 | protected WebSocketVersion getVersion() { 28 | return WebSocketVersion.V08; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/JsrWebSocketServer13Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package io.undertow.websockets.jsr.test; 19 | 20 | import io.netty.handler.codec.http.websocketx.WebSocketVersion; 21 | 22 | /** 23 | * @author Norman Maurer 24 | */ 25 | public class JsrWebSocketServer13Test extends JsrWebSocketServer08Test { 26 | @Override 27 | protected WebSocketVersion getVersion() { 28 | return WebSocketVersion.V13; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/annotated/AnnotatedAddedProgrammaticallyEndpoint.java: -------------------------------------------------------------------------------- 1 | package io.undertow.websockets.jsr.test.annotated; 2 | 3 | 4 | import jakarta.websocket.OnMessage; 5 | import jakarta.websocket.Session; 6 | import jakarta.websocket.server.ServerEndpoint; 7 | 8 | @ServerEndpoint(AnnotatedAddedProgrammaticallyEndpoint.PATH) 9 | public class AnnotatedAddedProgrammaticallyEndpoint { 10 | 11 | static final String PATH = "/programmatic"; 12 | 13 | @OnMessage 14 | public String handleMessage(String message, Session session) { 15 | StringBuilder reversed = new StringBuilder(message); 16 | reversed.reverse(); 17 | return reversed.toString(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/annotated/EncodableObjectSubClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.jsr.test.annotated; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public class EncodableObjectSubClass extends EncodableObject { 25 | public EncodableObjectSubClass(String value) { 26 | super(value); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/annotated/EncodingGenericsEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.jsr.test.annotated; 20 | 21 | import jakarta.websocket.OnMessage; 22 | import jakarta.websocket.server.PathParam; 23 | import jakarta.websocket.server.ServerEndpoint; 24 | 25 | /** 26 | * UNDERTOW-287 27 | * 28 | * 29 | * 30 | * @author Stuart Douglas 31 | */ 32 | @ServerEndpoint(value = "/encodingGenerics/{user}", decoders = SubclassDecoder.class) 33 | public class EncodingGenericsEndpoint { 34 | 35 | @OnMessage 36 | public String handleMessage(final EncodableObject message, @PathParam("user") String user) { 37 | return message.getValue() + " " + user; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/annotated/GenericWebSocketClientEndpoint.java: -------------------------------------------------------------------------------- 1 | package io.undertow.websockets.jsr.test.annotated; 2 | 3 | public interface GenericWebSocketClientEndpoint { 4 | 5 | void onMessage(M message); 6 | } 7 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/annotated/MiddleClassDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.jsr.test.annotated; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public abstract class MiddleClassDecoder extends GenericSuperclassDecoder { 25 | } 26 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/annotated/RequestUriEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.jsr.test.annotated; 20 | 21 | import jakarta.websocket.OnMessage; 22 | import jakarta.websocket.Session; 23 | import jakarta.websocket.server.ServerEndpoint; 24 | 25 | /** 26 | * @author Stuart Douglas 27 | */ 28 | @ServerEndpoint("/request") 29 | public class RequestUriEndpoint { 30 | 31 | @OnMessage 32 | public String handleMessage(String message, Session session) { 33 | return session.getRequestURI().toString(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/annotated/SubclassDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.jsr.test.annotated; 20 | 21 | /** 22 | * @author Stuart Douglas 23 | */ 24 | public class SubclassDecoder extends MiddleClassDecoder { 25 | @Override 26 | protected EncodableObject doRealDecode(String s) { 27 | return new EncodableObject(s); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/dynamicupgrade/EchoProgramaticEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.jsr.test.dynamicupgrade; 20 | 21 | import jakarta.websocket.Endpoint; 22 | import jakarta.websocket.EndpointConfig; 23 | import jakarta.websocket.Session; 24 | 25 | /** 26 | * @author Stuart Douglas 27 | */ 28 | public class EchoProgramaticEndpoint extends Endpoint { 29 | 30 | @Override 31 | public void onOpen(final Session session, EndpointConfig config) { 32 | final String foo = session.getPathParameters().get("foo"); 33 | session.addMessageHandler(String.class, message -> session.getAsyncRemote().sendText(foo + " " + message)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/reconnect/DisconnectServerEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.jsr.test.reconnect; 20 | 21 | import jakarta.websocket.OnMessage; 22 | import jakarta.websocket.Session; 23 | import jakarta.websocket.server.ServerEndpoint; 24 | import java.io.IOException; 25 | 26 | /** 27 | * @author Stuart Douglas 28 | */ 29 | @ServerEndpoint("/") 30 | public class DisconnectServerEndpoint { 31 | 32 | @OnMessage 33 | public String text(String message, Session session) throws IOException { 34 | if(message.equals("close")) { 35 | session.close(); 36 | return null; 37 | } 38 | return "ECHO-" + message; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/suspendresume/SuspendResumeEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2014 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.undertow.websockets.jsr.test.suspendresume; 20 | 21 | import jakarta.websocket.OnMessage; 22 | import jakarta.websocket.server.ServerEndpoint; 23 | 24 | /** 25 | * @author Stuart Douglas 26 | */ 27 | @ServerEndpoint(value = "/") 28 | public class SuspendResumeEndpoint { 29 | 30 | @OnMessage 31 | public String handleMessage(final String message) throws InterruptedException { 32 | Thread.sleep(2000); 33 | return message; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /zanata.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | https://translate.jboss.org/ 23 | undertow 24 | 2.0 25 | properties 26 | 27 | 28 | --------------------------------------------------------------------------------