tcMenuJavaAPI
Classes | Public Member Functions | List of all members
com.thecoderscorner.menu.auth.PreDefinedAuthenticator Class Reference
Inheritance diagram for com.thecoderscorner.menu.auth.PreDefinedAuthenticator:
com.thecoderscorner.menu.auth.MenuAuthenticator

Classes

class  AuthenticationToken
 

Public Member Functions

 PreDefinedAuthenticator (boolean alwaysAllow)
 
 PreDefinedAuthenticator (String securePasscode, List< AuthenticationToken > upfrontTokens)
 
CompletableFuture< Boolean > addAuthentication (String name, UUID uuid, boolean needsApproval)
 
void removeAuthentication (String user)
 
boolean authenticate (String user, UUID uuid)
 
boolean doesPasscodeMatch (String passcode)
 
ManagementCapabilities managementCapabilities ()
 
List< String > getAllNames ()
 

Detailed Description

Implements the authentication interface using a pre-defined upfront set of name and UUID pairs that must be provided upfront. This implementation will never save authentication blocks to storage.

Member Function Documentation

◆ addAuthentication()

CompletableFuture<Boolean> com.thecoderscorner.menu.auth.PreDefinedAuthenticator.addAuthentication ( String  user,
UUID  uuid,
boolean  needsApproval 
)

Attempt to add authentication for user and UUID, if it fails to be added false will be returned.

Parameters
userthe user to add
uuidthe uuid associated with the user
needsApprovaltrue if this is being added from a remote connection and needs approval, otherwise false.
Returns
true if added, otherwise false.

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ authenticate()

boolean com.thecoderscorner.menu.auth.PreDefinedAuthenticator.authenticate ( String  user,
UUID  uuid 
)

Check if the user and UUID pair can connect to this board.

Parameters
userthe user to check for
uuidthe UUID to check for
Returns
true if the user and UUID are allowed, otherwise false

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ doesPasscodeMatch()

boolean com.thecoderscorner.menu.auth.PreDefinedAuthenticator.doesPasscodeMatch ( String  passcode)

Checks if the provided passcode matches with the security passcode and returns false if it does not match.

Parameters
passcodethe passcode to check
Returns
true if matching, otherwise false

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ getAllNames()

List<String> com.thecoderscorner.menu.auth.PreDefinedAuthenticator.getAllNames ( )

Gets a list of all apps/users stored in the system

Returns
the list of users

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ managementCapabilities()

ManagementCapabilities com.thecoderscorner.menu.auth.PreDefinedAuthenticator.managementCapabilities ( )

Indicates how this authenticator can be edited, some don't support any, some remove only.

Returns
how the authenticator can be managed

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ removeAuthentication()

void com.thecoderscorner.menu.auth.PreDefinedAuthenticator.removeAuthentication ( String  user)

Remove the authentication for the given user

Parameters
userthe user to remove

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.


The documentation for this class was generated from the following file: