Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Mar 23, 2017
1 parent a054b2f commit 37c7028
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions packages/meteor-accounts-saml/saml_rocketchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -168,5 +169,9 @@ Meteor.startup(() => {
});

export {
updateServices, configureSamlService, getSamlConfigs, debounce, logger
updateServices,
configureSamlService,
getSamlConfigs,
debounce,
logger
};

0 comments on commit 37c7028

Please sign in to comment.