Class PostgresSQLCoreProvider
java.lang.Object
pro.gravit.launchserver.auth.core.AuthCoreProvider
pro.gravit.launchserver.auth.core.AbstractSQLCoreProvider
pro.gravit.launchserver.auth.core.PostgresSQLCoreProvider
- All Implemented Interfaces:
AutoCloseable, AuthSupportSudo, Reconfigurable
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractSQLCoreProvider
AbstractSQLCoreProvider.ColumnFeature<U,T>, AbstractSQLCoreProvider.SQLUser, AbstractSQLCoreProvider.SQLUserSession Modifier and TypeClassDescriptionstatic final classDescribes a single optional column in the user table.static classstatic classNested classes/interfaces inherited from class AuthCoreProvider
AuthCoreProvider.OAuthAccessTokenExpired, AuthCoreProvider.PasswordVerifyReportModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsFields inherited from class AbstractSQLCoreProvider
accessTokenColumn, codeGenerator, customQueryByLoginSQL, customQueryByUsernameSQL, customQueryByUUIDSQL, customQueryPermissionsByUUIDSQL, customQueryRolesByUserUUID, customUpdateAuthSQL, customUpdateServerIdSQL, expireSeconds, logger, passwordColumn, passwordVerifier, permissionsPermissionColumn, permissionsTable, permissionsUUIDColumn, rolesNameColumn, rolesTable, rolesUUIDColumn, serverIDColumn, table, timeProvider, totpSecretColumn, usernameColumn, uuidColumn, verifierModifier and TypeFieldDescriptionprotected final dev.samstevens.totp.code.CodeGeneratorlongSession / access-token lifetime in seconds (default: 1 hour).protected final org.apache.logging.log4j.Loggerprotected final dev.samstevens.totp.time.TimeProviderOptional TOTP secret column in the user table.protected final dev.samstevens.totp.code.CodeVerifierFields inherited from class AuthCoreProvider
pair, providers, serverModifier and TypeFieldDescriptionprotected AuthProviderPairstatic final pro.gravit.utils.ProviderMap<AuthCoreProvider> protected LaunchServer -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractSQLCoreProvider
applyOptionalColumns, authorize, buildPreparedQueries, checkServer, close, constructUser, constructUserFromRow, createSession, executeSingleUpdate, getDetails, getUserByLogin, getUserByUsername, getUserByUUID, getUserSessionByOAuthAccessToken, isPermissionsEnabled, isRolesEnabled, joinServer, loadPermissions, makeUserCols, refreshAccessToken, registerColumnFeature, registerOptionalColumns, safeQueryUser, sudo, updateAuth, updateServerID, verifyTotpCodeModifier and TypeMethodDescriptionprotected final voidApplies all registered optional columns touserfrom the current row ofset.authorize(String login, AuthResponse.AuthContext context, pro.gravit.launcher.base.request.auth.AuthRequest.AuthPasswordInterface password, boolean minecraftAccess) protected voidBuilds all transient SQL strings.checkServer(Client client, String username, String serverID) voidclose()protected AbstractSQLCoreProvider.SQLUserconstructUser(ResultSet set) Advancessetby one row and delegates toAbstractSQLCoreProvider.constructUserFromRow(ResultSet), or returnsnullif the result set is empty.protected AbstractSQLCoreProvider.SQLUserConstructs aAbstractSQLCoreProvider.SQLUserfrom the current ResultSet row.protected AbstractSQLCoreProvider.SQLUserSessionprotected intexecuteSingleUpdate(String sql, String p1, String p2) Runs a two-parameter UPDATE and returns the affected-row count.List<pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent.AuthAvailabilityDetails> getDetails(Client client) getUserByLogin(String login) getUserByUsername(String username) getUserByUUID(UUID uuid) getUserSessionByOAuthAccessToken(String accessToken) booleanbooleanbooleanpro.gravit.launcher.base.ClientPermissionsloadPermissions(String uuid) protected StringReturns the comma-separated column list used in SELECT queries.refreshAccessToken(String refreshToken, AuthResponse.AuthContext context) protected final voidregisterColumnFeature(AbstractSQLCoreProvider.ColumnFeature<?, ?> feature) Registers one optional column.protected voidOverride to declare optional user-table columns.protected final AbstractSQLCoreProvider.SQLUsersafeQueryUser(String sql, String param) Executes a single-parameter SELECT and maps the result to aAbstractSQLCoreProvider.SQLUser(with permissions).protected voidupdateAuth(User user, String accessToken) protected booleanupdateServerID(User user, String serverID) protected voidverifyTotpCode(AbstractSQLCoreProvider.SQLUser user, String totpCode) Methods inherited from class AuthCoreProvider
authorize, getCommands, isSupport, registerProviders, verifyAuthModifier and TypeMethodDescriptionauthorize(User user, AuthResponse.AuthContext context, pro.gravit.launcher.base.request.auth.AuthRequest.AuthPasswordInterface password, boolean minecraftAccess) Gets a list of commands available for this object.<T> Tstatic voidvoidverifyAuth(AuthResponse.AuthContext context) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Reconfigurable
defaultCommandsMapModifier and TypeMethodDescription
-
Field Details
-
postgresSQLHolder
-
-
Constructor Details
-
PostgresSQLCoreProvider
public PostgresSQLCoreProvider()
-
-
Method Details
-
getSQLConfig
- Specified by:
getSQLConfigin classAbstractSQLCoreProvider
-
init
- Overrides:
initin classAbstractSQLCoreProvider
-