io.vertx.ext.auth.jdbc

## Interface JDBCUserUtil

-     public interface JDBCUserUtil

  Utility to create users/roles/permissions. This is a helper class and not intended to be a full user management utility. While the standard authentication and authorization interfaces will require usually read only access to the database, in order to use this API a full read/write access must be granted.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JDBCUserUtil` | `create(JDBCClient client)` Create an instance of the user helper.
    `static JDBCUserUtil` | `create(JDBCClient client, String insertUserSQL, String insertUserRoleSQL, String insertRolePermissionSQL)` Create an instance of the user helper with custom queries.
    `default Future<Void>` | `createHashedUser(String username, String hash)`
    `JDBCUserUtil` | `createHashedUser(String username, String hash, Handler<AsyncResult<Void>> resultHandler)` Insert a user into a database.
    `default Future<Void>` | `createRolePermission(String role, String permission)`
    `JDBCUserUtil` | `createRolePermission(String role, String permission, Handler<AsyncResult<Void>> resultHandler)` Insert a role permission into a database.
    `default Future<Void>` | `createUser(String username, String password)`
    `JDBCUserUtil` | `createUser(String username, String password, Handler<AsyncResult<Void>> resultHandler)` Insert a user into a database.
    `default Future<Void>` | `createUserRole(String user, String role)`
    `JDBCUserUtil` | `createUserRole(String username, String role, Handler<AsyncResult<Void>> resultHandler)` Insert a user role into a database.

- - ### Method Detail

    - #### create

          static JDBCUserUtil create(JDBCClient client)

      Create an instance of the user helper.
      Parameters:
        `client` - the client with write rights to the database.
      Returns:
        the instance

    - #### create

          static JDBCUserUtil create(JDBCClient client,
                                     String insertUserSQL,
                                     String insertUserRoleSQL,
                                     String insertRolePermissionSQL)

      Create an instance of the user helper with custom queries.
      Parameters:
        `client` - the client with write rights to the database.
      Returns:
        the instance

    - #### createUser

          JDBCUserUtil createUser(String username,
                                  String password,
                                  Handler<AsyncResult<Void>> resultHandler)

      Insert a user into a database.
      Parameters:
        `username` - the username to be set
        `password` - the passsword in clear text, will be adapted following the definitions of the defined strategy
        `resultHandler` - the ResultHandler will be provided with the result of the operation
      Returns:
        fluent self

    - #### createUser

          default Future<Void> createUser(String username,
                                          String password)

      See Also:
        `createUser(String, String, Handler).`

    - #### createHashedUser

          JDBCUserUtil createHashedUser(String username,
                                        String hash,
                                        Handler<AsyncResult<Void>> resultHandler)

      Insert a user into a database.
      Parameters:
        `username` - the username to be set
        `hash` - the password hash, as result of `HashingStrategy.hash(String, Map, String, String)`
        `resultHandler` - the ResultHandler will be provided with the result of the operation
      Returns:
        fluent self

    - #### createHashedUser

          default Future<Void> createHashedUser(String username,
                                                String hash)

      See Also:
        `createHashedUser(String, String, Handler).`

    - #### createUserRole

          JDBCUserUtil createUserRole(String username,
                                      String role,
                                      Handler<AsyncResult<Void>> resultHandler)

      Insert a user role into a database.
      Parameters:
        `username` - the username to be set
        `role` - a to be set
        `resultHandler` - the ResultHandler will be provided with the result of the operation
      Returns:
        fluent self

    - #### createUserRole

          default Future<Void> createUserRole(String user,
                                              String role)

      See Also:
        `createUserRole(String, String, Handler).`

    - #### createRolePermission

          JDBCUserUtil createRolePermission(String role,
                                            String permission,
                                            Handler<AsyncResult<Void>> resultHandler)

      Insert a role permission into a database.
      Parameters:
        `role` - a to be set
        `permission` - the permission to be set
        `resultHandler` - the ResultHandler will be provided with the result of the operation
      Returns:
        fluent self

    - #### createRolePermission

          default Future<Void> createRolePermission(String role,
                                                    String permission)

      See Also:
        `createRolePermission(String, String, Handler).`

Copyright © 2020 Eclipse. All rights reserved.