Class: VertxAuthMongo::MongoAuth

Inherits:
VertxAuthCommon::AuthProvider show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb

Overview

An extension of AuthProvider which is using as store

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


21
22
23
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 21

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

+ (::VertxAuthMongo::MongoAuth) create(mongoClient = nil, config = nil)

Creates an instance of MongoAuth by using the given and configuration object. An example for a configuration object:

 JsonObject js = new JsonObject();
 js.put(MongoAuth.PROPERTY_COLLECTION_NAME, createCollectionName(MongoAuth.DEFAULT_COLLECTION_NAME));
 

Parameters:

  • mongoClient (::VertxMongo::MongoClient) (defaults to: nil)
    an instance of to be used for data storage and retrival
  • config (Hash{String => Object}) (defaults to: nil)
    the configuration object for the current instance. By this

Returns:

Raises:

  • (ArgumentError)


70
71
72
73
74
75
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 70

def self.create(mongoClient=nil,config=nil)
  if mongoClient.class.method_defined?(:j_del) && config.class == Hash && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthMongo::MongoAuth.java_method(:create, [Java::IoVertxExtMongo::MongoClient.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(mongoClient.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxAuthMongo::MongoAuth)
  end
  raise ArgumentError, "Invalid arguments when calling create(#{mongoClient},#{config})"
end

+ (Object) DEFAULT_COLLECTION_NAME

The default name of the collection to be used


308
309
310
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 308

def self.DEFAULT_COLLECTION_NAME
  Java::IoVertxExtAuthMongo::MongoAuth.DEFAULT_COLLECTION_NAME
end

+ (Object) DEFAULT_CREDENTIAL_PASSWORD_FIELD

The default name of the property for the password, like it is transported in credentials by method VertxAuthCommon::AuthProvider#authenticate


336
337
338
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 336

def self.DEFAULT_CREDENTIAL_PASSWORD_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.DEFAULT_CREDENTIAL_PASSWORD_FIELD
end

+ (Object) DEFAULT_CREDENTIAL_USERNAME_FIELD

The default name of the property for the username, like it is transported in credentials by method VertxAuthCommon::AuthProvider#authenticate


331
332
333
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 331

def self.DEFAULT_CREDENTIAL_USERNAME_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.DEFAULT_CREDENTIAL_USERNAME_FIELD
end

+ (Object) DEFAULT_PASSWORD_FIELD

The default name of the property for the password, like it is stored in mongodb


316
317
318
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 316

def self.DEFAULT_PASSWORD_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.DEFAULT_PASSWORD_FIELD
end

+ (Object) DEFAULT_PERMISSION_FIELD

The default name of the property for the permissions, like it is stored in mongodb. Permissions are expected to be saved as JsonArray


326
327
328
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 326

def self.DEFAULT_PERMISSION_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.DEFAULT_PERMISSION_FIELD
end

+ (Object) DEFAULT_ROLE_FIELD

The default name of the property for the roles, like it is stored in mongodb. Roles are expected to be saved as JsonArray


321
322
323
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 321

def self.DEFAULT_ROLE_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.DEFAULT_ROLE_FIELD
end

+ (Object) DEFAULT_SALT_FIELD

The default name of the property for the salt field


340
341
342
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 340

def self.DEFAULT_SALT_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.DEFAULT_SALT_FIELD
end

+ (Object) DEFAULT_USERNAME_FIELD

The default name of the property for the username, like it is stored in mongodb


312
313
314
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 312

def self.DEFAULT_USERNAME_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.DEFAULT_USERNAME_FIELD
end

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

def self.j_class
  Java::IoVertxExtAuthMongo::MongoAuth.java_class
end

+ (Object) PROPERTY_COLLECTION_NAME

The property name to be used to set the name of the collection inside the config


272
273
274
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 272

def self.PROPERTY_COLLECTION_NAME
  Java::IoVertxExtAuthMongo::MongoAuth.PROPERTY_COLLECTION_NAME
end

+ (Object) PROPERTY_CREDENTIAL_PASSWORD_FIELD

The property name to be used to set the name of the field, where the password for the credentials is stored inside


296
297
298
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 296

def self.PROPERTY_CREDENTIAL_PASSWORD_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.PROPERTY_CREDENTIAL_PASSWORD_FIELD
end

+ (Object) PROPERTY_CREDENTIAL_USERNAME_FIELD

The property name to be used to set the name of the field, where the username for the credentials is stored inside


292
293
294
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 292

def self.PROPERTY_CREDENTIAL_USERNAME_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.PROPERTY_CREDENTIAL_USERNAME_FIELD
end

+ (Object) PROPERTY_PASSWORD_FIELD

The property name to be used to set the name of the field, where the password is stored inside


288
289
290
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 288

def self.PROPERTY_PASSWORD_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.PROPERTY_PASSWORD_FIELD
end

+ (Object) PROPERTY_PERMISSION_FIELD

The property name to be used to set the name of the field, where the permissions are stored inside


284
285
286
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 284

def self.PROPERTY_PERMISSION_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.PROPERTY_PERMISSION_FIELD
end

+ (Object) PROPERTY_ROLE_FIELD

The property name to be used to set the name of the field, where the roles are stored inside


280
281
282
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 280

def self.PROPERTY_ROLE_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.PROPERTY_ROLE_FIELD
end

+ (Object) PROPERTY_SALT_FIELD

The property name to be used to set the name of the field, where the SALT is stored inside


300
301
302
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 300

def self.PROPERTY_SALT_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.PROPERTY_SALT_FIELD
end

+ (Object) PROPERTY_SALT_STYLE

The property name to be used to set the name of the field, where the salt style is stored inside


304
305
306
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 304

def self.PROPERTY_SALT_STYLE
  Java::IoVertxExtAuthMongo::MongoAuth.PROPERTY_SALT_STYLE
end

+ (Object) PROPERTY_USERNAME_FIELD

The property name to be used to set the name of the field, where the username is stored inside


276
277
278
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 276

def self.PROPERTY_USERNAME_FIELD
  Java::IoVertxExtAuthMongo::MongoAuth.PROPERTY_USERNAME_FIELD
end

+ (Object) ROLE_PREFIX

The prefix which is used by the method when checking for role access


344
345
346
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 344

def self.ROLE_PREFIX
  Java::IoVertxExtAuthMongo::MongoAuth.ROLE_PREFIX
end

+ (Object) unwrap(obj)



27
28
29
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_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-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 24

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

Instance Method Details

- (void) authenticate(authInfo = nil) { ... }

This method returns an undefined value.

Authenticate a user.

The first argument is a JSON object containing information for authenticating the user. What this actually contains depends on the specific implementation. In the case of a simple username/password based authentication it is likely to contain a JSON object with the following structure:


   {
     "username": "tim",
     "password": "mypassword"
   }
For other types of authentication it contain different information - for example a JWT token or OAuth bearer token.

If the user is successfully authenticated a object is passed to the handler in an AsyncResult. The user object can then be used for authorisation.

Parameters:

  • authInfo (Hash{String => Object}) (defaults to: nil)
    The auth information

Yields:

  • The result handler

Raises:

  • (ArgumentError)


54
55
56
57
58
59
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 54

def authenticate(authInfo=nil)
  if authInfo.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(authInfo),(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(#{authInfo})"
end

- (String) get_collection_name

The name of the collection used to store User objects inside. Defaults to DEFAULT_COLLECTION_NAME

Returns:

  • (String)
    the collectionName

Raises:

  • (ArgumentError)


163
164
165
166
167
168
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 163

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

- (::VertxAuthMongo::HashStrategy) get_hash_strategy

The HashStrategy which is used by the current instance

Returns:

Raises:

  • (ArgumentError)


242
243
244
245
246
247
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 242

def get_hash_strategy
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getHashStrategy, []).call(),::VertxAuthMongo::HashStrategy)
  end
  raise ArgumentError, "Invalid arguments when calling get_hash_strategy()"
end

- (String) get_password_credential_field

Get the name of the field to be used as property for the password of credentials in the method VertxAuthCommon::AuthProvider#authenticate. Defaults to DEFAULT_CREDENTIAL_PASSWORD_FIELD

Returns:

  • (String)
    the passwordCredentialField

Raises:

  • (ArgumentError)


215
216
217
218
219
220
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 215

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

- (String) get_password_field

Get the name of the field to be used for the password Defaults to DEFAULT_PASSWORD_FIELD

Returns:

  • (String)
    the passwordField

Raises:

  • (ArgumentError)


179
180
181
182
183
184
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 179

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

- (String) get_permission_field

Get the name of the field to be used for the permissions. Defaults to DEFAULT_PERMISSION_FIELD. Permissions are expected to be saved as JsonArray

Returns:

  • (String)
    the permissionField

Raises:

  • (ArgumentError)


197
198
199
200
201
202
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 197

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

- (String) get_role_field

Get the name of the field to be used for the roles. Defaults to DEFAULT_ROLE_FIELD. Roles are expected to be saved as JsonArray

Returns:

  • (String)
    the roleField

Raises:

  • (ArgumentError)


188
189
190
191
192
193
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 188

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

- (String) get_salt_field

Get the name of the field to be used for the salt. Only used when HashStrategy#set_salt_style is set to

Returns:

  • (String)
    the saltField

Raises:

  • (ArgumentError)


224
225
226
227
228
229
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 224

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

- (String) get_username_credential_field

Get the name of the field to be used as property for the username in the method VertxAuthCommon::AuthProvider#authenticate. Defaults to DEFAULT_CREDENTIAL_USERNAME_FIELD

Returns:

  • (String)
    the usernameCredentialField

Raises:

  • (ArgumentError)


206
207
208
209
210
211
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 206

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

- (String) get_username_field

Get the name of the field to be used for the username. Defaults to DEFAULT_USERNAME_FIELD

Returns:

  • (String)
    the usernameField

Raises:

  • (ArgumentError)


171
172
173
174
175
176
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 171

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

- (void) insert_user(username = nil, password = nil, roles = nil, permissions = nil) { ... }

This method returns an undefined value.

Insert a new user into mongo in the convenient way

Parameters:

  • username (String) (defaults to: nil)
    the username to be set
  • password (String) (defaults to: nil)
    the passsword in clear text, will be adapted following the definitions of the defined HashStrategy
  • roles (Array<String>) (defaults to: nil)
    a list of roles to be set
  • permissions (Array<String>) (defaults to: nil)
    a list of permissions to be set

Yields:

  • the ResultHandler will be provided with the id of the generated record

Raises:

  • (ArgumentError)


265
266
267
268
269
270
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 265

def insert_user(username=nil,password=nil,roles=nil,permissions=nil)
  if username.class == String && password.class == String && roles.class == Array && permissions.class == Array && block_given?
    return @j_del.java_method(:insertUser, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::JavaUtil::List.java_class,Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(username,password,roles.map { |element| element },permissions.map { |element| element },(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
  end
  raise ArgumentError, "Invalid arguments when calling insert_user(#{username},#{password},#{roles},#{permissions})"
end

- (self) set_collection_name(collectionName = nil)

Set the name of the collection to be used. Defaults to DEFAULT_COLLECTION_NAME

Parameters:

  • collectionName (String) (defaults to: nil)
    the name of the collection to be used for storing and reading user data

Returns:

  • (self)

Raises:

  • (ArgumentError)


79
80
81
82
83
84
85
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 79

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

- (self) set_hash_algorithm(hashAlgorithm = nil)

The Hash Algorithm which is used by the current instance

Parameters:

  • hashAlgorithm (:SHA512, :PBKDF2) (defaults to: nil)
    the HashAlgorithm to be set

Returns:

  • (self)

Raises:

  • (ArgumentError)


251
252
253
254
255
256
257
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 251

def set_hash_algorithm(hashAlgorithm=nil)
  if hashAlgorithm.class == Symbol && !block_given?
    @j_del.java_method(:setHashAlgorithm, [Java::IoVertxExtAuthMongo::HashAlgorithm.java_class]).call(Java::IoVertxExtAuthMongo::HashAlgorithm.valueOf(hashAlgorithm.to_s))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_hash_algorithm(#{hashAlgorithm})"
end

- (self) set_hash_strategy(hashStrategy = nil)

The HashStrategy which is used by the current instance

Parameters:

Returns:

  • (self)

Raises:

  • (ArgumentError)


233
234
235
236
237
238
239
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 233

def set_hash_strategy(hashStrategy=nil)
  if hashStrategy.class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:setHashStrategy, [Java::IoVertxExtAuthMongo::HashStrategy.java_class]).call(hashStrategy.j_del)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_hash_strategy(#{hashStrategy})"
end

- (self) set_password_credential_field(fieldName = nil)

Set the name of the field to be used as property for the password of credentials in the method VertxAuthCommon::AuthProvider#authenticate. Defaults to DEFAULT_CREDENTIAL_PASSWORD_FIELD

Parameters:

  • fieldName (String) (defaults to: nil)
    the name of the field to be used

Returns:

  • (self)

Raises:

  • (ArgumentError)


143
144
145
146
147
148
149
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 143

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

- (self) set_password_field(fieldName = nil)

Set the name of the field to be used for the password Defaults to DEFAULT_PASSWORD_FIELD

Parameters:

  • fieldName (String) (defaults to: nil)
    the name of the field to be used

Returns:

  • (self)

Raises:

  • (ArgumentError)


99
100
101
102
103
104
105
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 99

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

- (self) set_permission_field(fieldName = nil)

Set the name of the field to be used for the permissions. Defaults to DEFAULT_PERMISSION_FIELD. Permissions are expected to be saved as JsonArray

Parameters:

  • fieldName (String) (defaults to: nil)
    the name of the field to be used

Returns:

  • (self)

Raises:

  • (ArgumentError)


121
122
123
124
125
126
127
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 121

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

- (self) set_role_field(fieldName = nil)

Set the name of the field to be used for the roles. Defaults to DEFAULT_ROLE_FIELD. Roles are expected to be saved as JsonArray

Parameters:

  • fieldName (String) (defaults to: nil)
    the name of the field to be used

Returns:

  • (self)

Raises:

  • (ArgumentError)


110
111
112
113
114
115
116
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 110

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

- (self) set_salt_field(fieldName = nil)

Set the name of the field to be used for the salt. Only used when HashStrategy#set_salt_style is set to

Parameters:

  • fieldName (String) (defaults to: nil)
    the name of the field to be used

Returns:

  • (self)

Raises:

  • (ArgumentError)


154
155
156
157
158
159
160
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 154

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

- (self) set_username_credential_field(fieldName = nil)

Set the name of the field to be used as property for the username in the method VertxAuthCommon::AuthProvider#authenticate. Defaults to DEFAULT_CREDENTIAL_USERNAME_FIELD

Parameters:

  • fieldName (String) (defaults to: nil)
    the name of the field to be used

Returns:

  • (self)

Raises:

  • (ArgumentError)


132
133
134
135
136
137
138
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 132

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

- (self) set_username_field(fieldName = nil)

Set the name of the field to be used for the username. Defaults to DEFAULT_USERNAME_FIELD

Parameters:

  • fieldName (String) (defaults to: nil)
    the name of the field to be used

Returns:

  • (self)

Raises:

  • (ArgumentError)


89
90
91
92
93
94
95
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-mongo/mongo_auth.rb', line 89

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