Class WebSocketWebResource
java.lang.Object
org.apache.pulsar.websocket.admin.WebSocketWebResource
- Direct Known Subclasses:
WebSocketProxyStatsBase
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pulsar.broker.authentication.AuthenticationDataSourceauthData()Gets a caller id (IP + role).protected booleanisAuthorized(org.apache.pulsar.common.naming.TopicName topic) Checks if user is authorized to produce/consume on a given topic.protected WebSocketServiceservice()protected voidChecks whether the user has Pulsar Super-User access to the system.protected voidvalidateUserAccess(org.apache.pulsar.common.naming.TopicName topic) Checks if user has super-user access or user is authorized to produce/consume on a given topic.
-
Field Details
-
ATTRIBUTE_PROXY_SERVICE_NAME
- See Also:
-
ADMIN_PATH_V1
- See Also:
-
ADMIN_PATH_V2
- See Also:
-
servletContext
@Context protected javax.servlet.ServletContext servletContext -
httpRequest
@Context protected javax.servlet.http.HttpServletRequest httpRequest -
uri
@Context protected javax.ws.rs.core.UriInfo uri
-
-
Constructor Details
-
WebSocketWebResource
public WebSocketWebResource()
-
-
Method Details
-
service
-
clientAppId
Gets a caller id (IP + role).- Returns:
- the web service caller identification
-
authData
public org.apache.pulsar.broker.authentication.AuthenticationDataSource authData() throws AuthenticationException- Throws:
AuthenticationException
-
validateSuperUserAccess
protected void validateSuperUserAccess()Checks whether the user has Pulsar Super-User access to the system.- Throws:
org.apache.pulsar.common.util.RestException- if not authorized
-
validateUserAccess
protected void validateUserAccess(org.apache.pulsar.common.naming.TopicName topic) Checks if user has super-user access or user is authorized to produce/consume on a given topic.- Parameters:
topic-- Throws:
org.apache.pulsar.common.util.RestException
-
isAuthorized
Checks if user is authorized to produce/consume on a given topic.- Parameters:
topic-- Returns:
- Throws:
Exception
-