Class ApiKeyWebServiceHandlerPlugin
java.lang.Object
io.vertigo.vega.plugins.webservice.handler.ApiKeyWebServiceHandlerPlugin
- All Implemented Interfaces:
io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Plugin,WebServiceHandlerPlugin
Security handler.
Check Api Key, throw VSecurityException if not equals to configured Key.
- Author:
- skerdudou
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intStack index of the handler for sorting at startup -
Constructor Summary
ConstructorsConstructorDescriptionApiKeyWebServiceHandlerPlugin(String apiKey, Optional<String> headerNameOpt) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(WebServiceDefinition webServiceDefinition) intReturn an index to compute the order of the handlers stack.handle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, WebServiceCallContext webServiceCallContext, HandlerChain chain) Do handle of this route.
-
Field Details
-
STACK_INDEX
public static final int STACK_INDEXStack index of the handler for sorting at startup- See Also:
-
-
Constructor Details
-
ApiKeyWebServiceHandlerPlugin
Constructor.
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceWebServiceHandlerPlugin- Parameters:
webServiceDefinition- WebServiceDefinition- Returns:
- If this handler should be use for this webService
-
handle
public Object handle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, WebServiceCallContext webServiceCallContext, HandlerChain chain) throws SessionException Description copied from interface:WebServiceHandlerPluginDo handle of this route.- Specified by:
handlein interfaceWebServiceHandlerPlugin- Parameters:
request- Requestresponse- ResponsewebServiceCallContext- Context of this requestchain- current HandlerChain.- Returns:
- Response body
- Throws:
SessionException- Session expired exception
-
getStackIndex
public int getStackIndex()Description copied from interface:WebServiceHandlerPluginReturn an index to compute the order of the handlers stack. Please check the index of the provided handlers by vertigo and choose the index for yours accordingly. Vertigo's handlers start à 10 and leave a space of 10 between each. The last handler must beRestfulServiceWebServiceHandlerPluginwhich has the index 120. Therefore the provided index must be between 0 and 119- Specified by:
getStackIndexin interfaceWebServiceHandlerPlugin- Returns:
- the index (between 0 and 119)
-