Class List Method List File List

# Class: VertxAuthJdbc::JDBCAuth

Inherits:
  VertxAuthCommon::AuthProvider
  - Object
  - VertxAuthCommon::AuthProvider
  - VertxAuthJdbc::JDBCAuth
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb

## Overview

Factory interface for creating VertxAuthCommon::AuthProvider instances that use the Vert.x JDBC client

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxAuthJdbc::JDBCAuth) create(vertx = nil, client = nil)
  Create a JDBC auth provider implementation.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) authenticate(arg0 = nil) { ... }
- - (String) compute_hash(password = nil, salt = nil)
  Compute the hashed password given the unhashed password and the salt.
- - (String) generate_salt
  Compute a salt string.
- - (::VertxAuthJdbc::JDBCAuth) set_authentication_query(authenticationQuery = nil)
  Set the authentication query to use.
- - (::VertxAuthJdbc::JDBCAuth) set_permissions_query(permissionsQuery = nil)
  Set the permissions query to use.
- - (::VertxAuthJdbc::JDBCAuth) set_role_prefix(rolePrefix = nil)
  Set the role prefix to distinguish from permissions when checking for isPermitted requests.
- - (::VertxAuthJdbc::JDBCAuth) set_roles_query(rolesQuery = nil)
  Set the roles query to use.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    22
    23
    24
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 22

    def @@j_api_type.accept?(obj)
      obj.class == JDBCAuth
    end

### + (`::VertxAuthJdbc::JDBCAuth`) create(vertx = nil, client = nil)

Create a JDBC auth provider implementation

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`)
- client (`::VertxJdbc::JDBCClient`) (defaults to: `nil`) —
  the JDBC client instance

Returns:

- (`::VertxAuthJdbc::JDBCAuth`) —
  the auth provider

Raises:

- (`ArgumentError`)

    50
    51
    52
    53
    54
    55
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 50

    def self.create(vertx=nil,client=nil)
      if vertx.class.method_defined?(:j_del) && client.class.method_defined?(:j_del) && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthJdbc::JDBCAuth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtJdbc::JDBCClient.java_class]).call(vertx.j_del,client.j_del),::VertxAuthJdbc::JDBCAuth)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{vertx},#{client})"
    end

### + (`Object`) j_api_type

    31
    32
    33
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 31

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    34
    35
    36
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 34

    def self.j_class
      Java::IoVertxExtAuthJdbc::JDBCAuth.java_class
    end

### + (`Object`) unwrap(obj)

    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 28

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    25
    26
    27
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 25

    def @@j_api_type.wrap(obj)
      JDBCAuth.new(obj)
    end

## Instance Method Details

### - (`void`) authenticate(arg0 = nil) { ... }

This method returns an undefined value.

Parameters:

- arg0 (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Raises:

- (`ArgumentError`)

    40
    41
    42
    43
    44
    45
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 40

    def authenticate(arg0=nil)
      if arg0.class == Hash && block_given?
        return @j_del.java_method(:authenticate, [Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_json_object(arg0),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxAuthCommon::User) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling authenticate(#{arg0})"
    end

### - (`String`) compute_hash(password = nil, salt = nil)

Compute the hashed password given the unhashed password and the salt The implementation relays to the JDBCHashStrategy provided.

Parameters:

- password (`String`) (defaults to: `nil`) —
  the unhashed password
- salt (`String`) (defaults to: `nil`) —
  the salt

Returns:

- (`String`) —
  the hashed password

Raises:

- (`ArgumentError`)

    98
    99
    100
    101
    102
    103
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 98

    def compute_hash(password=nil,salt=nil)
      if password.class == String && salt.class == String && !block_given?
        return @j_del.java_method(:computeHash, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(password,salt)
      end
      raise ArgumentError, "Invalid arguments when calling compute_hash(#{password},#{salt})"
    end

### - (`String`) generate_salt

Compute a salt string. The implementation relays to the JDBCHashStrategy provided.

Returns:

- (`String`) —
  a non null salt value

Raises:

- (`ArgumentError`)

    108
    109
    110
    111
    112
    113
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 108

    def generate_salt
      if !block_given?
        return @j_del.java_method(:generateSalt, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling generate_salt()"
    end

### - (`::VertxAuthJdbc::JDBCAuth`) set_authentication_query(authenticationQuery = nil)

Set the authentication query to use. Use this if you want to override the default authentication query.

Parameters:

- authenticationQuery (`String`) (defaults to: `nil`) —
  the authentication query

Returns:

- (`::VertxAuthJdbc::JDBCAuth`) —
  a reference to this for fluency

Raises:

- (`ArgumentError`)

    59
    60
    61
    62
    63
    64
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 59

    def set_authentication_query(authenticationQuery=nil)
      if authenticationQuery.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setAuthenticationQuery, [Java::java.lang.String.java_class]).call(authenticationQuery),::VertxAuthJdbc::JDBCAuth)
      end
      raise ArgumentError, "Invalid arguments when calling set_authentication_query(#{authenticationQuery})"
    end

### - (`::VertxAuthJdbc::JDBCAuth`) set_permissions_query(permissionsQuery = nil)

Set the permissions query to use. Use this if you want to override the default permissions query.

Parameters:

- permissionsQuery (`String`) (defaults to: `nil`) —
  the permissions query

Returns:

- (`::VertxAuthJdbc::JDBCAuth`) —
  a reference to this for fluency

Raises:

- (`ArgumentError`)

    77
    78
    79
    80
    81
    82
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 77

    def set_permissions_query(permissionsQuery=nil)
      if permissionsQuery.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setPermissionsQuery, [Java::java.lang.String.java_class]).call(permissionsQuery),::VertxAuthJdbc::JDBCAuth)
      end
      raise ArgumentError, "Invalid arguments when calling set_permissions_query(#{permissionsQuery})"
    end

### - (`::VertxAuthJdbc::JDBCAuth`) set_role_prefix(rolePrefix = nil)

Set the role prefix to distinguish from permissions when checking for isPermitted requests.

Parameters:

- rolePrefix (`String`) (defaults to: `nil`) —
  a Prefix e.g.: "role:"

Returns:

- (`::VertxAuthJdbc::JDBCAuth`) —
  a reference to this for fluency

Raises:

- (`ArgumentError`)

    86
    87
    88
    89
    90
    91
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 86

    def set_role_prefix(rolePrefix=nil)
      if rolePrefix.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setRolePrefix, [Java::java.lang.String.java_class]).call(rolePrefix),::VertxAuthJdbc::JDBCAuth)
      end
      raise ArgumentError, "Invalid arguments when calling set_role_prefix(#{rolePrefix})"
    end

### - (`::VertxAuthJdbc::JDBCAuth`) set_roles_query(rolesQuery = nil)

Set the roles query to use. Use this if you want to override the default roles query.

Parameters:

- rolesQuery (`String`) (defaults to: `nil`) —
  the roles query

Returns:

- (`::VertxAuthJdbc::JDBCAuth`) —
  a reference to this for fluency

Raises:

- (`ArgumentError`)

    68
    69
    70
    71
    72
    73
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-jdbc/jdbc_auth.rb', line 68

    def set_roles_query(rolesQuery=nil)
      if rolesQuery.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setRolesQuery, [Java::java.lang.String.java_class]).call(rolesQuery),::VertxAuthJdbc::JDBCAuth)
      end
      raise ArgumentError, "Invalid arguments when calling set_roles_query(#{rolesQuery})"
    end