Class DefaultAccessAuthenticationHook
java.lang.Object
com.iohao.net.external.core.hook.internal.DefaultAccessAuthenticationHook
- All Implemented Interfaces:
AccessAuthenticationHook
AccessAuthentication
- Author:
- 渔民小镇
- date:
- 2023-02-19
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIgnoreAuthCmd(int cmd) Adds main routes that need to be ignored; these ignored main routes can be accessed without login.voidaddIgnoreAuthCmd(int cmd, int subCmd) Adds routes that need to be ignored; these ignored routes can be accessed without login.voidaddRejectionCmd(int cmd) Adds a main route to be rejected; these main routes cannot be accessed directly from the outside.voidaddRejectionCmd(int cmd, int subCmd) Adds a route to be rejected; these routes cannot be accessed directly from the outside.voidclear()Clears all configurations for ignored routes and rejected routes.booleanpass(boolean loginSuccess, int cmdMerge) Access verification.booleanreject(int cmdMerge) Rejection check for the route.voidremoveIgnoreAuthCmd(int cmd) Removes a route that needs to be ignored.voidremoveIgnoreAuthCmd(int cmd, int subCmd) Removes a route that needs to be ignored.voidremoveRejectCmd(int cmd) Removes a route from rejection.voidremoveRejectCmd(int cmd, int subCmd) Removes a route from rejection.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AccessAuthenticationHook
setVerifyIdentity
-
Constructor Details
-
DefaultAccessAuthenticationHook
public DefaultAccessAuthenticationHook()
-
-
Method Details
-
addIgnoreAuthCmd
public void addIgnoreAuthCmd(int cmd, int subCmd) Description copied from interface:AccessAuthenticationHookAdds routes that need to be ignored; these ignored routes can be accessed without login.- Specified by:
addIgnoreAuthCmdin interfaceAccessAuthenticationHook- Parameters:
cmd- cmdsubCmd- subCmd
-
addIgnoreAuthCmd
public void addIgnoreAuthCmd(int cmd) Description copied from interface:AccessAuthenticationHookAdds main routes that need to be ignored; these ignored main routes can be accessed without login.- Specified by:
addIgnoreAuthCmdin interfaceAccessAuthenticationHook- Parameters:
cmd- main route
-
removeIgnoreAuthCmd
public void removeIgnoreAuthCmd(int cmd, int subCmd) Description copied from interface:AccessAuthenticationHookRemoves a route that needs to be ignored.- Specified by:
removeIgnoreAuthCmdin interfaceAccessAuthenticationHook- Parameters:
cmd- cmdsubCmd- subCmd
-
removeIgnoreAuthCmd
public void removeIgnoreAuthCmd(int cmd) Description copied from interface:AccessAuthenticationHookRemoves a route that needs to be ignored.- Specified by:
removeIgnoreAuthCmdin interfaceAccessAuthenticationHook- Parameters:
cmd- cmd
-
pass
public boolean pass(boolean loginSuccess, int cmdMerge) Description copied from interface:AccessAuthenticationHookAccess verification.- Specified by:
passin interfaceAccessAuthenticationHook- Parameters:
loginSuccess- true if the user login was successfulUserSession.isVerifyIdentity()cmdMerge- route- Returns:
- true if access verification passed
-
addRejectionCmd
public void addRejectionCmd(int cmd) Description copied from interface:AccessAuthenticationHookAdds a main route to be rejected; these main routes cannot be accessed directly from the outside.- Specified by:
addRejectionCmdin interfaceAccessAuthenticationHook- Parameters:
cmd- main route
-
addRejectionCmd
public void addRejectionCmd(int cmd, int subCmd) Description copied from interface:AccessAuthenticationHookAdds a route to be rejected; these routes cannot be accessed directly from the outside.- Specified by:
addRejectionCmdin interfaceAccessAuthenticationHook- Parameters:
cmd- main routesubCmd- sub route
-
removeRejectCmd
public void removeRejectCmd(int cmd, int subCmd) Description copied from interface:AccessAuthenticationHookRemoves a route from rejection.- Specified by:
removeRejectCmdin interfaceAccessAuthenticationHook- Parameters:
cmd- main routesubCmd- sub route
-
removeRejectCmd
public void removeRejectCmd(int cmd) Description copied from interface:AccessAuthenticationHookRemoves a route from rejection.- Specified by:
removeRejectCmdin interfaceAccessAuthenticationHook- Parameters:
cmd- main route
-
reject
public boolean reject(int cmdMerge) Description copied from interface:AccessAuthenticationHookRejection check for the route.- Specified by:
rejectin interfaceAccessAuthenticationHook- Parameters:
cmdMerge- route- Returns:
- true if the user is forbidden from accessing this route
-
clear
public void clear()Description copied from interface:AccessAuthenticationHookClears all configurations for ignored routes and rejected routes.- Specified by:
clearin interfaceAccessAuthenticationHook
-