Class: Auth::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/auth/engine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/auth/engine.rb', line 198

def initialize
  

  ##############################################################
  ##
  ## CSS BASED OPTIONS.
  ##
  ##############################################################
  
  ## whether there should be modals for sign-in / sign-up
  ## ensure to include the css and js files as mentioned in the readme.
  @enable_sign_in_modals = false
  
  ## this is shown on the left hand side of the navbar.
  @brand_name = "Your App Name"

  ## whether there should be a navbar as shown in the image in the readme.
  @navbar = false

  #############################################################
  ##
  ## AUTHENTICATION OPTIONS.
  ##
  #############################################################
  
  ## whether token authentication should be enabled
  @enable_token_auth = true

  ##the regeneration time of the auth_token,
  ##after the following mentioned time, the token is useless
  @token_regeneration_time = 1.day

  ## the oauth provider details, an empty hash will disable oauth authentication
  @oauth_credentials = {}
  
  ## which models the engine should use for authentication
  @auth_resources = {}

  ## whether recaptcha should be enabled or not.
  ## false by default.
  ## if set to true, will produce errors all over the place in case you forget to provide a recaptcha key and secret in the configuration file!
  @recaptcha = false


  ## if set to true, wil prevent merging of oauth accounts if they share the same email id.
  ## by default is false.
  @prevent_oauth_merger = false

  ##############################################################
  ##
  ## ENGINE BASED OPTIONS.
  ##
  ##############################################################
  @mount_path = "/authenticate"
  @redis_config_file_location = nil
  @third_party_api_keys = {}
  ##whether to redirect to redirect urls if provided in the
  ##request.
  @do_redirect = true
  @host_name = nil
  ## for the user.
  @user_class = nil

  ###############################################################
  ##
  ## OPTIONS FOR TESTS
  ##
  ###############################################################
  @stub_otp_api_calls = false
  @simulate_invalid_otp = false

  ###############################################################
  ##
  ## OPTIONS FOR OTP
  ##
  ###############################################################
  @otp_controller = nil


  ###############################################################
  ##
  ## OPTIONS FOR SHOPPING MODULE
  ##
  ###############################################################
  @cart_item_controller = nil
  @cart_item_class = nil
  @cart_controller = nil
  @cart_class = nil
  @payment_controller = nil
  @payment_class = nil
  @payment_gateway_info = {}
  @product_class = nil
  @product_controller = nil
  @discount_class = nil
  @discount_controller = nil

  ###############################################################
  ##
  ## OPTIONS FOR MAILER AND NOTIFICATIONS
  ##
  ###############################################################
  @mailer_class = nil
  @notification_class = nil
  @notification_response_class = nil

  
  
  
  ###############################################################
  ##
  ## OPTIONS FOR THE BACKGROUND JOB USED BY THE ENGINE.
  ##
  ###############################################################
  @queue_adapter = "shoryuken"

  
  ####################################################
  ##
  ##
  ## elasticsearch options.
  ##
  ###################################################
  @use_es = true

  ########################################################
  ##
  ##
  ## workflow accessors.
  ##
  ## are set to default to the engine classes.
  ## so if you don't set them, it doesn't matter.
  ##
  ########################################################
  @assembly_class = "Auth::Workflow::Assembly"
  @assembly_controller = "auth/workflow/assemblies"

  @stage_class = "Auth::Workflow::Stage"
  @stage_controller = "auth/workflow/stages"

  @sop_class = "Auth::Workflow::Sop"
  @sop_controller = "auth/workflow/sops"

  @step_class = "Auth::Workflow::Step"
  @step_controller = "auth/workflow/steps"
    
  @order_class = "Auth::Workflow::Order"
  @order_controller = "auth/workflow/orders"

  @requirement_class = "Auth::Workflow::Requirement"
  @requirement_controller = "auth/workflow/requirements"  

  @state_class = "Auth::Workflow::State"
  @state_controller = "auth/workflow/states"

  ## tlocation is not used anywhere, either the model or controller
  @tlocation_class = "Auth::Workflow::Tlocation"
  @tlocation_controller = "auth/workflow/tlocations"

  
  @location_class = "Auth::Workflow::Location"
  @location_controller = "auth/workflow/locations"

  @schedule_class = "Auth::Workflow::Schedule"
  @schedule_controller = "auth/workflow/schedules"

  @booking_class = "Auth::Workflow::Booking"
  @booking_controller = "auth/workflow/bookings"

  @slot_class = "Auth::Workflow::Slot"
  @slot_controller = "auth/workflow/slots"

  @overlap_class = "Auth::Workflow::Overlap"
  @overlap_controller = "auth/workflow/overlaps"

  @minute_class = "Auth::Workflow::Minute"
  @minute_controller = "auth/workflow/minutes"

  @category_class = "Auth::Workflow::Category"
  @category_controller = "auth/workflow/categories"

  @entity_class = "Auth::Workflow::Entity"
  @entity_controller = "auth/workflow/entities"

  @specification_class = "Auth::Workflow::Specification"
  @specification_controller = "auth/workflow/specifications"

  ## this is the 
  @consumable_class = "Auth::Workflow::Consumable"
  @consumable_controller = "auth/workflow/consumables"
  ########################################################
  ##
  ##
  ##
  ## IMAGE CONCERN MODEL AND CONTROLLER CLASSES
  ##
  ##
  ##
  ########################################################

  @image_class = "Auth::Image"
  @image_controller = "auth/images"


  ########################################################
  ##
  ## ROLLING MINUTES
  ##
  ########################################################
  @rolling_minutes = 30

end

Instance Attribute Details

#assembly_classObject

Returns the value of attribute assembly_class.



114
115
116
# File 'lib/auth/engine.rb', line 114

def assembly_class
  @assembly_class
end

#assembly_controllerObject

Returns the value of attribute assembly_controller.



115
116
117
# File 'lib/auth/engine.rb', line 115

def assembly_controller
  @assembly_controller
end

#auth_resourcesObject

Returns the value of attribute auth_resources.



58
59
60
# File 'lib/auth/engine.rb', line 58

def auth_resources
  @auth_resources
end

#booking_classObject

Returns the value of attribute booking_class.



147
148
149
# File 'lib/auth/engine.rb', line 147

def booking_class
  @booking_class
end

#booking_controllerObject

Returns the value of attribute booking_controller.



148
149
150
# File 'lib/auth/engine.rb', line 148

def booking_controller
  @booking_controller
end

#brand_nameObject

Returns the value of attribute brand_name.



82
83
84
# File 'lib/auth/engine.rb', line 82

def brand_name
  @brand_name
end

#cart_classObject

Returns the value of attribute cart_class.



70
71
72
# File 'lib/auth/engine.rb', line 70

def cart_class
  @cart_class
end

#cart_controllerObject

Returns the value of attribute cart_controller.



69
70
71
# File 'lib/auth/engine.rb', line 69

def cart_controller
  @cart_controller
end

#cart_item_classObject

Returns the value of attribute cart_item_class.



68
69
70
# File 'lib/auth/engine.rb', line 68

def cart_item_class
  @cart_item_class
end

#cart_item_controllerObject

Returns the value of attribute cart_item_controller.



67
68
69
# File 'lib/auth/engine.rb', line 67

def cart_item_controller
  @cart_item_controller
end

#category_classObject

CURRENTLY USED ####



163
164
165
# File 'lib/auth/engine.rb', line 163

def category_class
  @category_class
end

#category_controllerObject

Returns the value of attribute category_controller.



164
165
166
# File 'lib/auth/engine.rb', line 164

def category_controller
  @category_controller
end

#consumable_classObject

workflow accessors.



111
112
113
# File 'lib/auth/engine.rb', line 111

def consumable_class
  @consumable_class
end

#consumable_controllerObject

Returns the value of attribute consumable_controller.



112
113
114
# File 'lib/auth/engine.rb', line 112

def consumable_controller
  @consumable_controller
end

#discount_classObject

Returns the value of attribute discount_class.



74
75
76
# File 'lib/auth/engine.rb', line 74

def discount_class
  @discount_class
end

#discount_controllerObject

Returns the value of attribute discount_controller.



75
76
77
# File 'lib/auth/engine.rb', line 75

def discount_controller
  @discount_controller
end

#do_redirectObject

Returns the value of attribute do_redirect.



81
82
83
# File 'lib/auth/engine.rb', line 81

def do_redirect
  @do_redirect
end

#enable_sign_in_modalsObject

Returns the value of attribute enable_sign_in_modals.



59
60
61
# File 'lib/auth/engine.rb', line 59

def 
  @enable_sign_in_modals
end

#enable_token_authObject

Returns the value of attribute enable_token_auth.



55
56
57
# File 'lib/auth/engine.rb', line 55

def enable_token_auth
  @enable_token_auth
end

#entity_classObject

Returns the value of attribute entity_class.



169
170
171
# File 'lib/auth/engine.rb', line 169

def entity_class
  @entity_class
end

#entity_controllerObject

Returns the value of attribute entity_controller.



170
171
172
# File 'lib/auth/engine.rb', line 170

def entity_controller
  @entity_controller
end

#host_nameObject

used in lib/auth/omniauth.rb inside Google_OAuth2.class_eval



97
98
99
# File 'lib/auth/engine.rb', line 97

def host_name
  @host_name
end

#image_classObject

image concern accessors



183
184
185
# File 'lib/auth/engine.rb', line 183

def image_class
  @image_class
end

#image_controllerObject

Returns the value of attribute image_controller.



184
185
186
# File 'lib/auth/engine.rb', line 184

def image_controller
  @image_controller
end

#location_classObject

CURRENTLY USED



140
141
142
# File 'lib/auth/engine.rb', line 140

def location_class
  @location_class
end

#location_controllerObject

Returns the value of attribute location_controller.



141
142
143
# File 'lib/auth/engine.rb', line 141

def location_controller
  @location_controller
end

#mailer_classObject

the class used in the user_concern, to send emails. should inherit from Auth::Notifier. the class used to send the notification



87
88
89
# File 'lib/auth/engine.rb', line 87

def mailer_class
  @mailer_class
end

#minute_classObject

Returns the value of attribute minute_class.



166
167
168
# File 'lib/auth/engine.rb', line 166

def minute_class
  @minute_class
end

#minute_controllerObject

Returns the value of attribute minute_controller.



167
168
169
# File 'lib/auth/engine.rb', line 167

def minute_controller
  @minute_controller
end

#mount_pathObject

Returns the value of attribute mount_path.



57
58
59
# File 'lib/auth/engine.rb', line 57

def mount_path
  @mount_path
end

Returns the value of attribute navbar.



93
94
95
# File 'lib/auth/engine.rb', line 93

def navbar
  @navbar
end

#notification_classObject

Returns the value of attribute notification_class.



76
77
78
# File 'lib/auth/engine.rb', line 76

def notification_class
  @notification_class
end

#notification_response_classObject

Returns the value of attribute notification_response_class.



83
84
85
# File 'lib/auth/engine.rb', line 83

def notification_response_class
  @notification_response_class
end

#oauth_credentialsObject

Returns the value of attribute oauth_credentials.



56
57
58
# File 'lib/auth/engine.rb', line 56

def oauth_credentials
  @oauth_credentials
end

#order_classObject

Returns the value of attribute order_class.



126
127
128
# File 'lib/auth/engine.rb', line 126

def order_class
  @order_class
end

#order_controllerObject

Returns the value of attribute order_controller.



127
128
129
# File 'lib/auth/engine.rb', line 127

def order_controller
  @order_controller
end

#otp_controllerObject

Returns the value of attribute otp_controller.



66
67
68
# File 'lib/auth/engine.rb', line 66

def otp_controller
  @otp_controller
end

#overlap_classObject

this is also no longer user.



155
156
157
# File 'lib/auth/engine.rb', line 155

def overlap_class
  @overlap_class
end

#overlap_controllerObject

Returns the value of attribute overlap_controller.



156
157
158
# File 'lib/auth/engine.rb', line 156

def overlap_controller
  @overlap_controller
end

#payment_classObject

Returns the value of attribute payment_class.



73
74
75
# File 'lib/auth/engine.rb', line 73

def payment_class
  @payment_class
end

#payment_controllerObject

Returns the value of attribute payment_controller.



77
78
79
# File 'lib/auth/engine.rb', line 77

def payment_controller
  @payment_controller
end

#payment_gateway_infoObject

Returns the value of attribute payment_gateway_info.



78
79
80
# File 'lib/auth/engine.rb', line 78

def payment_gateway_info
  @payment_gateway_info
end

#prevent_oauth_mergerObject

Returns the value of attribute prevent_oauth_merger.



60
61
62
# File 'lib/auth/engine.rb', line 60

def prevent_oauth_merger
  @prevent_oauth_merger
end

#product_classObject

Returns the value of attribute product_class.



71
72
73
# File 'lib/auth/engine.rb', line 71

def product_class
  @product_class
end

#product_controllerObject

Returns the value of attribute product_controller.



72
73
74
# File 'lib/auth/engine.rb', line 72

def product_controller
  @product_controller
end

#queue_adapterObject

the queue adapter for the delayed jobs



91
92
93
# File 'lib/auth/engine.rb', line 91

def queue_adapter
  @queue_adapter
end

#recaptchaObject

Returns the value of attribute recaptcha.



61
62
63
# File 'lib/auth/engine.rb', line 61

def recaptcha
  @recaptcha
end

#redis_config_file_locationObject

Returns the value of attribute redis_config_file_location.



62
63
64
# File 'lib/auth/engine.rb', line 62

def redis_config_file_location
  @redis_config_file_location
end

#requirement_classObject

Returns the value of attribute requirement_class.



129
130
131
# File 'lib/auth/engine.rb', line 129

def requirement_class
  @requirement_class
end

#requirement_controllerObject

Returns the value of attribute requirement_controller.



130
131
132
# File 'lib/auth/engine.rb', line 130

def requirement_controller
  @requirement_controller
end

#rolling_minutesObject

WORK CONSTANTS.



196
197
198
# File 'lib/auth/engine.rb', line 196

def rolling_minutes
  @rolling_minutes
end

#schedule_classObject

these three are not used.



144
145
146
# File 'lib/auth/engine.rb', line 144

def schedule_class
  @schedule_class
end

#schedule_controllerObject

Returns the value of attribute schedule_controller.



145
146
147
# File 'lib/auth/engine.rb', line 145

def schedule_controller
  @schedule_controller
end

#simulate_invalid_otpObject

Returns the value of attribute simulate_invalid_otp.



65
66
67
# File 'lib/auth/engine.rb', line 65

def simulate_invalid_otp
  @simulate_invalid_otp
end

#slot_classObject

Returns the value of attribute slot_class.



150
151
152
# File 'lib/auth/engine.rb', line 150

def slot_class
  @slot_class
end

#slot_controllerObject

Returns the value of attribute slot_controller.



151
152
153
# File 'lib/auth/engine.rb', line 151

def slot_controller
  @slot_controller
end

#sop_classObject

Returns the value of attribute sop_class.



120
121
122
# File 'lib/auth/engine.rb', line 120

def sop_class
  @sop_class
end

#sop_controllerObject

Returns the value of attribute sop_controller.



121
122
123
# File 'lib/auth/engine.rb', line 121

def sop_controller
  @sop_controller
end

#specification_classObject

Returns the value of attribute specification_class.



172
173
174
# File 'lib/auth/engine.rb', line 172

def specification_class
  @specification_class
end

#specification_controllerObject

Returns the value of attribute specification_controller.



173
174
175
# File 'lib/auth/engine.rb', line 173

def specification_controller
  @specification_controller
end

#stage_classObject

Returns the value of attribute stage_class.



117
118
119
# File 'lib/auth/engine.rb', line 117

def stage_class
  @stage_class
end

#stage_controllerObject

Returns the value of attribute stage_controller.



118
119
120
# File 'lib/auth/engine.rb', line 118

def stage_controller
  @stage_controller
end

#state_classObject

Returns the value of attribute state_class.



132
133
134
# File 'lib/auth/engine.rb', line 132

def state_class
  @state_class
end

#state_controllerObject

Returns the value of attribute state_controller.



133
134
135
# File 'lib/auth/engine.rb', line 133

def state_controller
  @state_controller
end

#step_classObject

Returns the value of attribute step_class.



123
124
125
# File 'lib/auth/engine.rb', line 123

def step_class
  @step_class
end

#step_controllerObject

Returns the value of attribute step_controller.



124
125
126
# File 'lib/auth/engine.rb', line 124

def step_controller
  @step_controller
end

#stub_otp_api_callsObject

Returns the value of attribute stub_otp_api_calls.



64
65
66
# File 'lib/auth/engine.rb', line 64

def stub_otp_api_calls
  @stub_otp_api_calls
end

#third_party_api_keysObject

Returns the value of attribute third_party_api_keys.



63
64
65
# File 'lib/auth/engine.rb', line 63

def third_party_api_keys
  @third_party_api_keys
end

#tlocation_classObject

this tlocation thing is no longer used.



136
137
138
# File 'lib/auth/engine.rb', line 136

def tlocation_class
  @tlocation_class
end

#tlocation_controllerObject

Returns the value of attribute tlocation_controller.



137
138
139
# File 'lib/auth/engine.rb', line 137

def tlocation_controller
  @tlocation_controller
end

#token_regeneration_timeObject

Returns the value of attribute token_regeneration_time.



79
80
81
# File 'lib/auth/engine.rb', line 79

def token_regeneration_time
  @token_regeneration_time
end

#use_esObject

whether to use es or not.



101
102
103
# File 'lib/auth/engine.rb', line 101

def use_es
  @use_es
end

#user_classObject

Returns the value of attribute user_class.



80
81
82
# File 'lib/auth/engine.rb', line 80

def user_class
  @user_class
end