Class: VertxWeb::AuthorizationHandler

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/authorization_handler.rb

Overview

Base interface for authorization handlers that provide authorization support.

AuthorizationHandlerImpl usually requires a AuthenticationHandler to be on the routing chain before it or a custom handler that has previously set a VertxAuthCommon::User in the RoutingContext

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/authorization_handler.rb', line 24

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

+ (::VertxWeb::AuthorizationHandler) create(authorization)

create the the handler that will check the specified authorization Note that to check several authorizations, you can specify a sub-interface such as VertxAuthCommon::AndAuthorization or VertxAuthCommon::OrAuthorization

Parameters:

Returns:



44
45
46
47
48
49
50
51
52
53
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/authorization_handler.rb', line 44

def self.create(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::AuthorizationHandler.java_method(:create, [Java::IoVertxExtAuthAuthorization::Authorization.java_class]).call(args[0].j_del),::VertxWeb::AuthorizationHandler)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create(#{args[0]})"
  end
end

+ (Object) j_api_type



33
34
35
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/authorization_handler.rb', line 33

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



36
37
38
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/authorization_handler.rb', line 36

def self.j_class
  Java::IoVertxExtWebHandler::AuthorizationHandler.java_class
end

+ (Object) unwrap(obj)



30
31
32
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/authorization_handler.rb', line 30

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

+ (Object) wrap(obj)



27
28
29
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/authorization_handler.rb', line 27

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

Instance Method Details

- (self) addAuthorizationProvider(authorizationProvider)

Adds a provider that shall be used to retrieve the required authorizations for the user to attest. Multiple calls are allowed to retrieve authorizations from many sources.

Parameters:

Returns:

  • (self)


73
74
75
76
77
78
79
80
81
82
83
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/authorization_handler.rb', line 73

def add_authorization_provider(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:addAuthorizationProvider, [Java::IoVertxExtAuthAuthorization::AuthorizationProvider.java_class]).call(args[0].j_del)
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling add_authorization_provider(#{args[0]})"
  end
end

- (void) handle(event)

This method returns an undefined value.

Something has happened, so handle it.

Parameters:



58
59
60
61
62
63
64
65
66
67
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/authorization_handler.rb', line 58

def handle(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    return @j_del.java_method(:handle, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(args[0].j_del)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling handle(#{args[0]})"
  end
end