* This class is a singleton instance, that can be obtained
* calling {@link #getInstance()}, since it works with
* any request even if there are no annotation mapping.
*
* @author Daniel Figueiredo Caetano
- *
*/
public class OslcGlobalNamespaceProvider {
- private static OslcGlobalNamespaceProvider instance;
+ private static OslcGlobalNamespaceProvider instance;
- private Map
+ * key - prefix
+ * value - namespace
+ *
+ * @return empty hash map instance if there are no global
+ * namespace mappings.
+ */
+ public Map
* If the request fails validation, you can use - * {@link OAuthServlet#handleException(javax.servlet.http.HttpServletResponse, Exception, String)} + * {@link OAuthServlet#handleException(jakarta.servlet.http.HttpServletResponse, Exception, String)} * to send an unauthorized response. * * @throws OAuthException if the request fails validation diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/SimpleTokenStrategy.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/SimpleTokenStrategy.java index c62865e15..82176e384 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/SimpleTokenStrategy.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/SimpleTokenStrategy.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.UUID; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.eclipse.lyo.server.oauth.core.OAuthRequest; diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/TokenStrategy.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/TokenStrategy.java index d321516f3..0f306a977 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/TokenStrategy.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/TokenStrategy.java @@ -15,14 +15,13 @@ import java.io.IOException; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; + +import org.eclipse.lyo.server.oauth.core.OAuthRequest; -import net.oauth.OAuthAccessor; import net.oauth.OAuthException; import net.oauth.OAuthMessage; -import org.eclipse.lyo.server.oauth.core.OAuthRequest; - /** * Manages and validates OAuth tokens and token secrets. * {@link SimpleTokenStrategy} is a basic implementation, but you can implement diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java index 0f8b4d537..c73e490c4 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java @@ -16,26 +16,18 @@ import java.io.IOException; import java.net.URISyntaxException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionListener; - -import net.oauth.OAuth; -import net.oauth.OAuthAccessor; -import net.oauth.OAuthException; -import net.oauth.OAuthMessage; -import net.oauth.OAuthProblemException; -import net.oauth.http.HttpMessage; -import net.oauth.server.OAuthServlet; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpSessionEvent; +import jakarta.servlet.http.HttpSessionListener; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; import org.eclipse.lyo.server.oauth.core.Application; @@ -49,6 +41,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import net.oauth.OAuth; +import net.oauth.OAuthAccessor; +import net.oauth.OAuthException; +import net.oauth.OAuthMessage; +import net.oauth.OAuthProblemException; +import net.oauth.http.HttpMessage; +import net.oauth.server.OAuthServlet; + /** *
+ * Supported properties: + *
trs_uri
- a TRS Provider endpointbaseAuth_user
- HTTP Basic auth user (optional)baseAuth_pwd
- HTTP Basic auth password (optional)