Class AbstractApiAuthController
-
- All Implemented Interfaces:
public abstract class AbstractApiAuthControllerMessage signature verification, Terminal login and logout
- Since:
2022-11-09
trydofor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumAbstractApiAuthController.ApiErrorpublic classAbstractApiAuthController.ApiEntity
-
Constructor Summary
Constructors Constructor Description AbstractApiAuthController()
-
Method Summary
Modifier and Type Method Description voidrequestMapping(@NotNull() HttpServletRequest request, @NotNull() HttpServletResponse response)To annotate `@RequestMapping`, Need subclass Override AbstractApiAuthController.ApiEntityparse(@NotNull() HttpServletRequest request, boolean mustSign)AbstractApiAuthController.ApiEntityvalidate(@NotNull() HttpServletRequest request, @NotNull() String secret)Validate an Api request and returns Entity if it does not fail (successful or unvalidated), otherwise it returns null. Stringdigest(InputStream data, int len)Stringdigest(String data, int len)Stringsignature(String data, int len, String secret)abstract booleanhandle(@NotNull() HttpServletRequest request, @NotNull() AbstractApiAuthController.ApiEntity entity)After passing validate, this method performs business logic. booleanisCompatible()Whether it is compatible mode (send clientId directly), or only the ticket mode. voidsetApiAuthProp(WarlockApiAuthProp apiAuthProp)voidsetTicketService(WarlockTicketService ticketService)voidsetTerminalInterceptor(TerminalInterceptor terminalInterceptor)voidsetCompatible(boolean compatible)Whether it is compatible mode (send clientId directly), or only the ticket mode. -
-
Method Detail
-
requestMapping
void requestMapping(@NotNull() HttpServletRequest request, @NotNull() HttpServletResponse response)
To annotate `@RequestMapping`, Need subclass Override
-
parse
@NotNull() AbstractApiAuthController.ApiEntity parse(@NotNull() HttpServletRequest request, boolean mustSign)
-
validate
@NotNull() AbstractApiAuthController.ApiEntity validate(@NotNull() HttpServletRequest request, @NotNull() String secret)
Validate an Api request and returns Entity if it does not fail (successful or unvalidated), otherwise it returns null.
-
digest
@NotNull() String digest(InputStream data, int len)
-
handle
abstract boolean handle(@NotNull() HttpServletRequest request, @NotNull() AbstractApiAuthController.ApiEntity entity)
After passing validate, this method performs business logic. `true` means it has been processed and can response, `false` means it has not been processed.
-
isCompatible
boolean isCompatible()
Whether it is compatible mode (send clientId directly), or only the ticket mode.
-
setApiAuthProp
@Autowired() void setApiAuthProp(WarlockApiAuthProp apiAuthProp)
-
setTicketService
@Autowired() void setTicketService(WarlockTicketService ticketService)
-
setTerminalInterceptor
@Autowired() void setTerminalInterceptor(TerminalInterceptor terminalInterceptor)
-
setCompatible
void setCompatible(boolean compatible)
Whether it is compatible mode (send clientId directly), or only the ticket mode.
-
-
-
-