2013-08-23 02:21:52 -04:00
|
|
|
class Plugin::AuthProvider
|
2015-09-25 11:29:05 -04:00
|
|
|
|
|
|
|
def self.auth_attributes
|
2018-07-23 11:51:57 -04:00
|
|
|
[:glyph, :background_color, :pretty_name, :title, :message, :frame_width, :frame_height, :authenticator,
|
2018-07-25 19:07:39 -04:00
|
|
|
:pretty_name_setting, :title_setting, :enabled_setting, :full_screen_login, :full_screen_login_setting,
|
|
|
|
:custom_url]
|
2015-09-25 11:29:05 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
attr_accessor(*auth_attributes)
|
2013-08-25 21:04:16 -04:00
|
|
|
|
2013-08-25 22:52:36 -04:00
|
|
|
def name
|
|
|
|
authenticator.name
|
|
|
|
end
|
|
|
|
|
2015-09-25 11:29:05 -04:00
|
|
|
def to_json
|
2017-07-27 21:20:09 -04:00
|
|
|
result = { name: name }
|
2016-04-20 13:19:38 -04:00
|
|
|
result['customUrl'] = custom_url if custom_url
|
2018-07-23 11:51:57 -04:00
|
|
|
result['prettyNameOverride'] = pretty_name || name
|
2015-09-25 11:29:05 -04:00
|
|
|
result['titleOverride'] = title if title
|
|
|
|
result['titleSetting'] = title_setting if title_setting
|
2018-07-23 11:51:57 -04:00
|
|
|
result['prettyNameSetting'] = pretty_name_setting if pretty_name_setting
|
2015-09-25 11:29:05 -04:00
|
|
|
result['enabledSetting'] = enabled_setting if enabled_setting
|
|
|
|
result['messageOverride'] = message if message
|
|
|
|
result['frameWidth'] = frame_width if frame_width
|
|
|
|
result['frameHeight'] = frame_height if frame_height
|
2015-10-12 22:11:39 -04:00
|
|
|
result['fullScreenLogin'] = full_screen_login if full_screen_login
|
2018-07-25 19:07:39 -04:00
|
|
|
result['fullScreenLoginSetting'] = full_screen_login_setting if full_screen_login_setting
|
2015-09-25 11:29:05 -04:00
|
|
|
result.to_json
|
|
|
|
end
|
|
|
|
|
2013-08-23 02:21:52 -04:00
|
|
|
end
|