Class List Method List File List

# Class: VertxAuthHtdigest::HtdigestAuth

Inherits:
  VertxAuthCommon::AuthProvider
  - Object
  - VertxAuthCommon::AuthProvider
  - VertxAuthHtdigest::HtdigestAuth
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-htdigest/htdigest_auth.rb

## Overview

An extension of AuthProvider which is using .htdigest file as store

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxAuthHtdigest::HtdigestAuth) create(vertx = nil, htfile = nil)
  Creates an instance of HtdigestAuth by using the given htfile file.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) authenticate(arg0 = nil) { ... }
- - (String) realm
  Return the currently used realm.

## Class Method Details

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

Returns:

- (`Boolean`)

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-htdigest/htdigest_auth.rb', line 21

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

### + (`::VertxAuthHtdigest::HtdigestAuth`) create(vertx = nil, htfile = nil)

Creates an instance of HtdigestAuth by using the given htfile file.

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`)
- htfile (`String`) (defaults to: `nil`) —
  the existing htfile.

Returns:

- (`::VertxAuthHtdigest::HtdigestAuth`) —
  the created instance of {::VertxAuthHtdigest::HtdigestAuth}s

Raises:

- (`ArgumentError`)

    49
    50
    51
    52
    53
    54
    55
    56
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-htdigest/htdigest_auth.rb', line 49

    def self.create(vertx=nil,htfile=nil)
      if vertx.class.method_defined?(:j_del) && !block_given? && htfile == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthHtdigest::HtdigestAuth.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(vertx.j_del),::VertxAuthHtdigest::HtdigestAuth)
      elsif vertx.class.method_defined?(:j_del) && htfile.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthHtdigest::HtdigestAuth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,htfile),::VertxAuthHtdigest::HtdigestAuth)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{vertx},#{htfile})"
    end

### + (`Object`) j_api_type

    30
    31
    32
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-htdigest/htdigest_auth.rb', line 30

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    33
    34
    35
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-htdigest/htdigest_auth.rb', line 33

    def self.j_class
      Java::IoVertxExtAuthHtdigest::HtdigestAuth.java_class
    end

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

    27
    28
    29
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-htdigest/htdigest_auth.rb', line 27

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

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

    24
    25
    26
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-htdigest/htdigest_auth.rb', line 24

    def @@j_api_type.wrap(obj)
      HtdigestAuth.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`)

    39
    40
    41
    42
    43
    44
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-htdigest/htdigest_auth.rb', line 39

    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`) realm

Return the currently used realm

Returns:

- (`String`) —
  the realm

Raises:

- (`ArgumentError`)

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

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