2013-08-23 14:21:52 +08:00
|
|
|
class Plugin::AuthProvider
|
2015-09-25 23:29:05 +08:00
|
|
|
|
|
|
|
def self.auth_attributes
|
2018-07-23 23:51:57 +08:00
|
|
|
[:glyph, :background_color, :pretty_name, :title, :message, :frame_width, :frame_height, :authenticator,
|
2018-07-26 07:07:39 +08:00
|
|
|
:pretty_name_setting, :title_setting, :enabled_setting, :full_screen_login, :full_screen_login_setting,
|
|
|
|
:custom_url]
|
2015-09-25 23:29:05 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
attr_accessor(*auth_attributes)
|
2013-08-26 09:04:16 +08:00
|
|
|
|
2013-08-26 10:52:36 +08:00
|
|
|
def name
|
|
|
|
authenticator.name
|
|
|
|
end
|
|
|
|
|
2015-09-25 23:29:05 +08:00
|
|
|
def to_json
|
2017-07-28 09:20:09 +08:00
|
|
|
result = { name: name }
|
2016-04-21 01:19:38 +08:00
|
|
|
result['customUrl'] = custom_url if custom_url
|
2018-07-23 23:51:57 +08:00
|
|
|
result['prettyNameOverride'] = pretty_name || name
|
2015-09-25 23:29:05 +08:00
|
|
|
result['titleOverride'] = title if title
|
|
|
|
result['titleSetting'] = title_setting if title_setting
|
2018-07-23 23:51:57 +08:00
|
|
|
result['prettyNameSetting'] = pretty_name_setting if pretty_name_setting
|
2015-09-25 23:29:05 +08: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-13 10:11:39 +08:00
|
|
|
result['fullScreenLogin'] = full_screen_login if full_screen_login
|
2018-07-26 07:07:39 +08:00
|
|
|
result['fullScreenLoginSetting'] = full_screen_login_setting if full_screen_login_setting
|
2015-09-25 23:29:05 +08:00
|
|
|
result.to_json
|
|
|
|
end
|
|
|
|
|
2013-08-23 14:21:52 +08:00
|
|
|
end
|