From 37c70286bae98f2fa4fe0a5510b87ff68c1ee5b9 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 23 Mar 2017 16:35:28 -0300 Subject: [PATCH] fix review --- .../meteor-accounts-saml/saml_rocketchat.js | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/packages/meteor-accounts-saml/saml_rocketchat.js b/packages/meteor-accounts-saml/saml_rocketchat.js index 7cc2874f58e3..0fe772f27208 100644 --- a/packages/meteor-accounts-saml/saml_rocketchat.js +++ b/packages/meteor-accounts-saml/saml_rocketchat.js @@ -10,76 +10,76 @@ RocketChat.settings.addGroup('SAML'); Meteor.methods({ addSamlService(name) { - RocketChat.settings.add('SAML_Custom_' + name, false, { + RocketChat.settings.add(`SAML_Custom_${name}`, false, { type: 'boolean', group: 'SAML', section: name, i18nLabel: 'Accounts_OAuth_Custom_Enable' }); - RocketChat.settings.add('SAML_Custom_' + name + '_provider', 'provider-name', { + RocketChat.settings.add(`SAML_Custom_${name}_provider`, 'provider-name', { type: 'string', group: 'SAML', section: name, i18nLabel: 'SAML_Custom_Provider' }); - RocketChat.settings.add('SAML_Custom_' + name + '_entry_point', 'https://example.com/simplesaml/saml2/idp/SSOService.php', { + RocketChat.settings.add(`SAML_Custom_${name}_entry_point`, 'https://example.com/simplesaml/saml2/idp/SSOService.php', { type: 'string', group: 'SAML', section: name, i18nLabel: 'SAML_Custom_Entry_point' }); - RocketChat.settings.add('SAML_Custom_' + name + '_idp_slo_redirect_url', 'https://example.com/simplesaml/saml2/idp/SingleLogoutService.php', { + RocketChat.settings.add(`SAML_Custom_${name}_idp_slo_redirect_url`, 'https://example.com/simplesaml/saml2/idp/SingleLogoutService.php', { type: 'string', group: 'SAML', section: name, i18nLabel: 'SAML_Custom_IDP_SLO_Redirect_URL' }); - RocketChat.settings.add('SAML_Custom_' + name + '_issuer', 'https://your-rocket-chat/_saml/metadata/provider-name', { + RocketChat.settings.add(`SAML_Custom_${name}_issuer`, 'https://your-rocket-chat/_saml/metadata/provider-name', { type: 'string', group: 'SAML', section: name, i18nLabel: 'SAML_Custom_Issuer' }); - RocketChat.settings.add('SAML_Custom_' + name + '_cert', '', { + RocketChat.settings.add(`SAML_Custom_${name}_cert`, '', { type: 'string', group: 'SAML', section: name, i18nLabel: 'SAML_Custom_Cert', multiline: true }); - RocketChat.settings.add('SAML_Custom_' + name + '_public_cert', '', { + RocketChat.settings.add(`SAML_Custom_${name}_public_cert`, '', { type: 'string', group: 'SAML', section: name, multiline: true, i18nLabel: 'SAML_Custom_Public_Cert' }); - RocketChat.settings.add('SAML_Custom_' + name + '_private_key', '', { + RocketChat.settings.add(`SAML_Custom_${name}_private_key`, '', { type: 'string', group: 'SAML', section: name, multiline: true, i18nLabel: 'SAML_Custom_Private_Key' }); - RocketChat.settings.add('SAML_Custom_' + name + '_button_label_text', '', { + RocketChat.settings.add(`SAML_Custom_${name}_button_label_text`, '', { type: 'string', group: 'SAML', section: name, i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text' }); - RocketChat.settings.add('SAML_Custom_' + name + '_button_label_color', '#FFFFFF', { + RocketChat.settings.add(`SAML_Custom_${name}_button_label_color`, '#FFFFFF', { type: 'string', group: 'SAML', section: name, i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color' }); - RocketChat.settings.add('SAML_Custom_' + name + '_button_color', '#13679A', { + RocketChat.settings.add(`SAML_Custom_${name}_button_color`, '#13679A', { type: 'string', group: 'SAML', section: name, i18nLabel: 'Accounts_OAuth_Custom_Button_Color' }); - RocketChat.settings.add('SAML_Custom_' + name + '_generate_username', false, { + RocketChat.settings.add(`SAML_Custom_${name}_generate_username`, false, { type: 'boolean', group: 'SAML', section: name, @@ -120,7 +120,8 @@ const debounce = (fn, delay) => { const serviceName = 'saml'; const configureSamlService = function(samlConfigs) { - let privateCert = false, privateKey = false; + let privateCert = false; + let privateKey = false; if (samlConfigs.secret.privateKey && samlConfigs.secret.publicCert) { privateKey = samlConfigs.secret.privateKey; privateCert = samlConfigs.secret.publicCert; @@ -168,5 +169,9 @@ Meteor.startup(() => { }); export { - updateServices, configureSamlService, getSamlConfigs, debounce, logger + updateServices, + configureSamlService, + getSamlConfigs, + debounce, + logger };