FEATURE REMOVAL: persona login

see: https://meta.discourse.org/t/pulling-persona-out-of-discourse-core/12613
This commit is contained in:
Sam 2014-02-11 16:56:48 +11:00
parent fd34932068
commit 7ad00f426c
47 changed files with 2 additions and 178 deletions

View file

@ -114,10 +114,6 @@ gem 'omniauth-facebook'
gem 'omniauth-twitter'
gem 'omniauth-github'
gem 'omniauth-oauth2', require: false
# abandoned gem hard to tell what is going on, multiple PRs upstream being ignored:
# https://twitter.com/samsaffron/status/412372111710109696
# we use: gem 'omniauth-browserid', git: 'https://github.com/samsaffron/omniauth-browserid.git', branch: 'observer_api'
gem 'omniauth-browserid-discourse', require: 'omniauth-browserid'
gem 'omniauth-cas'
gem 'oj'
# while resolving https://groups.google.com/forum/#!topic/ruby-pg/5_ylGmog1S4

View file

@ -196,10 +196,6 @@ GEM
omniauth (1.1.4)
hashie (>= 1.2, < 3)
rack
omniauth-browserid-discourse (0.0.2)
faraday
multi_json
omniauth (~> 1.0)
omniauth-cas (1.0.4)
addressable (~> 2.3)
nokogiri (~> 1.6)
@ -434,7 +430,6 @@ DEPENDENCIES
nokogiri
oj
omniauth
omniauth-browserid-discourse
omniauth-cas
omniauth-facebook
omniauth-github

View file

@ -223,10 +223,6 @@ GEM
omniauth (1.1.4)
hashie (>= 1.2, < 3)
rack
omniauth-browserid-discourse (0.0.2)
faraday
multi_json
omniauth (~> 1.0)
omniauth-cas (1.0.4)
addressable (~> 2.3)
nokogiri (~> 1.6)
@ -449,7 +445,6 @@ DEPENDENCIES
nokogiri
oj
omniauth
omniauth-browserid-discourse
omniauth-cas
omniauth-facebook
omniauth-github

View file

@ -35,19 +35,12 @@ Discourse.LoginMethod.reopenClass({
"cas",
"twitter",
"yahoo",
"github",
"persona"
"github"
].forEach(function(name){
if(Discourse.SiteSettings["enable_" + name + "_logins"]){
var params = {name: name};
if(name === "persona") {
params.customLogin = function(){
navigator.id.request();
};
}
if(name === "google") {
params.frameWidth = 850;
params.frameHeight = 500;

View file

@ -17,31 +17,6 @@ Discourse.LoginView = Discourse.ModalBodyView.extend({
this.set('controller.lastY', e.screenY);
},
initPersona: function(){
var readyCalled = false;
navigator.id.watch({
onlogin: function(assertion) {
if (readyCalled) {
Discourse.ajax('/auth/persona/callback', {
type: 'POST',
data: { 'assertion': assertion },
dataType: 'json'
}).then(function(data) {
Discourse.authenticationComplete(data);
});
}
},
onlogout: function() {
if (readyCalled) {
Discourse.logout();
}
},
onready: function() {
readyCalled = true;
}
});
},
didInsertElement: function() {
this._super();
@ -64,11 +39,6 @@ Discourse.LoginView = Discourse.ModalBodyView.extend({
});
});
var view = this;
// load persona if needed
if(Discourse.SiteSettings.enable_persona_logins) {
$LAB.script("https://login.persona.org/include.js").wait(view.initPersona);
}
}
});

View file

@ -178,12 +178,6 @@ button {
content: "g";
}
}
&.persona {
background: $persona;
&:before {
content: "]";
}
}
}
// Button Sizes

View file

@ -22,7 +22,6 @@ $cas: #70BA61 !default;
$twitter: #00bced !default;
$yahoo: #810293 !default;
$github: #6d6d6d !default;
$persona: #606060 !default;
$primary: #333 !default;

View file

@ -11,7 +11,6 @@ class Users::OmniauthCallbacksController < ApplicationController
Auth::OpenIdAuthenticator.new("yahoo", "https://me.yahoo.com", trusted: true),
Auth::GithubAuthenticator.new,
Auth::TwitterAuthenticator.new,
Auth::PersonaAuthenticator.new,
Auth::CasAuthenticator.new
]

View file

@ -7,5 +7,4 @@ Disallow: /auth/twitter/callback
Disallow: /auth/google/callback
Disallow: /auth/yahoo/callback
Disallow: /auth/github/callback
Disallow: /auth/persona/callback
Disallow: /auth/cas/callback
Disallow: /auth/cas/callback

View file

@ -419,9 +419,6 @@ cs:
github:
title: "přes GitHub"
message: "Autorizuji přes GitHub (ujistěte se, že nemáte zablokovaná popup okna)"
persona:
title: "přes Persona"
message: "Autorizuji přes Mozilla Persona (ujistěte se, že nemáte zablokovaná popup okna)"
composer:
posting_not_on_topic: "Rozepsali jste odpověď na téma \"{{title}}\", ale nyní máte otevřené jiné téma."

View file

@ -467,9 +467,6 @@ da:
github:
title: "med GitHub"
message: "Logger ind med GitHub (kontrollér at pop-op-blokering ikke er aktiv)"
persona:
title: "med Persona"
message: "Logger ind med Mozilla Persona (kontrollér at pop-op-blokering ikke er aktiv)"
composer:
posting_not_on_topic: "Hvilket emne vil du svare på?"

View file

@ -480,9 +480,6 @@ de:
github:
title: "Mit GitHub"
message: "Authentisierung via GitHub (stelle sicher, dass der Popup-Blocker deaktiviert ist)"
persona:
title: "Mit Persona"
message: "Authentisierung via Mozilla Persona (stelle sicher, dass der Popup-Blocker deaktiviert ist)"
composer:
posting_not_on_topic: "Du antwortest auf das Thema \"{{title}}\", betrachtest gerade aber ein anderes Thema."

View file

@ -487,9 +487,6 @@ en:
github:
title: "with GitHub"
message: "Authenticating with GitHub (make sure pop up blockers are not enabled)"
persona:
title: "with Persona"
message: "Authenticating with Mozilla Persona (make sure pop up blockers are not enabled)"
composer:
posting_not_on_topic: "Which topic do you want to reply to?"

View file

@ -387,9 +387,6 @@ es:
github:
title: "con GitHub"
message: "Autenticando con GitHub (asegúrate de desactivar cualquier bloqueador de pop ups)"
persona:
title: "con Persona"
message: "Autenticando con Mozilla Persona (asegúrate de desactivar cualquier bloqueador de pop ups)"
composer:
posting_not_on_topic: "Estas respondiendo al tema \"{{title}}\", pero estas viendo un tema distinto."

View file

@ -467,9 +467,6 @@ fr:
github:
title: "via GitHub"
message: "Authentification via GitHub (assurez-vous que les popups ne soient pas bloquées)"
persona:
title: "via Persona"
message: "Authentification via Mozilla Persona (assurez-vous que les popups ne soient pas bloquées)"
composer:
posting_not_on_topic: "A quelle discussion voulez-vous répondre ?"

View file

@ -263,9 +263,6 @@ id:
github:
title: "with GitHub"
message: "Authenticating with GitHub (make sure pop up blockers are not enabled)"
persona:
title: "with Persona"
message: "Authenticating with Mozilla Persona (make sure pop up blockers are not enabled)"
composer:
saving_draft_tip: "saving"

View file

@ -440,9 +440,6 @@ it:
github:
title: "con GitHub"
message: "Autenticazione con GitHub (l'apertura di pop up deve essere permessa dal browser)"
persona:
title: "con Persona"
message: "Autenticazione con Mozilla Persona (l'apertura di pop up deve essere permessa dal browser)"
composer:
posting_not_on_topic: "Stai rispondendo al topic \"{{title}}\", ma al momento stai visualizzando un topic diverso."

View file

@ -427,9 +427,6 @@ ja:
github:
title: "with GitHub"
message: "Github による認証 (ポップアップがブロックされていないことを確認してください)"
persona:
title: "with Persona"
message: "Persona による認証 (ポップアップがブロックされていないことを確認してください)"
composer:
posting_not_on_topic: "回答したいトピックはどれですか?"

View file

@ -447,9 +447,6 @@ ko:
github:
title: "GitHub"
message: "GitHub 인증 중(팝업 차단을 해제 하세요)"
persona:
title: "Persona"
message: "Mozilla Persona 인증 중(팝업 차단을 해제 하세요)"
composer:
posting_not_on_topic: "어떤 토픽에 답글을 작성하시겠습니까?"

View file

@ -334,9 +334,6 @@ nb_NO:
github:
title: "med GitHub"
message: "Autentiserer med GitHub (sørg for at du tillater pop-up vindu)"
persona:
title: "med Persona"
message: "Autentiserer med Mozilla Persona (sørg for at du tillater pop-up vindu)"
composer:
posting_not_on_topic: "Du svarer på emnet \"{{title}}\", men for øyeblikket ser du på et annet emne."

View file

@ -481,9 +481,6 @@ nl:
github:
title: met Github
message: "Authenticatie met Github (zorg ervoor dat je popup blocker uit staat)"
persona:
title: met Persona
message: "Authenticatie met Mozilla Persona (zorg ervoor dat je popup blocker uit staat)"
composer:
posting_not_on_topic: "In welke topic wil je je antwoord plaatsen?"

View file

@ -454,10 +454,6 @@ pseudo:
title: '[[ ŵíťĥ ǦíťĤůƀ ]]'
message: '[[ Áůťĥéɳťíčáťíɳǧ ŵíťĥ ǦíťĤůƀ (ɱáǩé šůřé ƿóƿ ůƿ ƀłóčǩéřš ářé ɳóť
éɳáƀłéď) ]]'
persona:
title: '[[ ŵíťĥ Рéřšóɳá ]]'
message: '[[ Áůťĥéɳťíčáťíɳǧ ŵíťĥ Ϻóžíłłá Рéřšóɳá (ɱáǩé šůřé ƿóƿ ůƿ ƀłóčǩéřš
ářé ɳóť éɳáƀłéď) ]]'
composer:
posting_not_on_topic: '[[ Ŵĥíčĥ ťóƿíč ďó ýóů ŵáɳť ťó řéƿłý ťó? ]]'
saving_draft_tip: '[[ šáνíɳǧ ]]'

View file

@ -437,9 +437,6 @@ pt_BR:
github:
title: "com GitHub"
message: "Autenticando com GitHub (certifique-se de que os bloqueadores de popup estejam desativados)"
persona:
title: "com Persona"
message: "Autenticando com Mozilla Persona (certifique-se de que os bloqueadores de popup estejam desativados)"
composer:
posting_not_on_topic: "Qual tópico você gostaria de responder?"

View file

@ -461,9 +461,6 @@ ru:
github:
title: 'с помощью GitHub'
message: 'Вход с помощью учетной записи GitHub (всплывающие окна должны быть разрешены)'
persona:
title: 'с помощью Persona'
message: 'Вход с помощью учетной записи Mozilla Persona (всплывающие окна должны быть разрешены)'
composer:
posting_not_on_topic: 'В какой теме вы хотите ответить?'
saving_draft_tip: сохранение

View file

@ -451,9 +451,6 @@ sv:
github:
title: "med GitHub"
message: "Autentiserar med GitHub (kolla så att pop up-blockare inte är aktiverade)"
persona:
title: " med Persona"
message: "Autentiserar med Mozilla Persona (kolla så att pop up-blockare inte är aktiverade)"
composer:
posting_not_on_topic: "Du svarar på tråden \"{{title}}\", men du besöker just nu en annan tråd."

View file

@ -477,9 +477,6 @@ zh_CN:
github:
title: "使用 GitHub 帐号登录"
message: "使用 GitHub 帐号验证登录(请确保没有禁止浏览器弹出对话框)"
persona:
title: "使用 Persona 帐号登录"
message: "使用 Mozilla Persona 帐号验证登录(请确保没有禁止浏览器弹出对话框)"
composer:
posting_not_on_topic: "你正在回复主题 \"{{title}}\",但是当前你正在浏览的是另外一个主题。"

View file

@ -459,9 +459,6 @@ zh_TW:
github:
title: "使用 GitHub"
message: "使用 GitHub 認証 (請確定你的網頁瀏覽器未阻擋彈出視窗)"
persona:
title: "使用 Persona"
message: "使用 Mozilla Persona 認証 (請確定你的網頁瀏覽器未阻擋彈出視窗)"
composer:
posting_not_on_topic: "你想要回覆哪個主題?"

View file

@ -588,8 +588,6 @@ cs:
github_client_id: "'Client id' pro přihlašování přes Github, registrace na https://github.com/settings/applications"
github_client_secret: "'Client secret' pro přihlašování přes Github, registrace na https://github.com/settings/applications"
enable_persona_logins: "Povolit autorizaci přes službu Mozilla Persona"
allow_import: "Povolit import, kterým lze přepsat VŠECHNA data na tomto webu; nechte nastaveno na 'false', pokud neplánujete dělat importy dat"
active_user_rate_limit_secs: "Jak často aktualizujeme informaci o poslední návštěvě uživatelů, v sekundách"

View file

@ -652,8 +652,6 @@ da:
github_client_id: "Client id til Github-login, oprettes på https://github.com/settings/applications."
github_client_secret: "Client secret til Github-login, oprettes på at https://github.com/settings/applications."
enable_persona_logins: "Aktivér e-mail-baseret login med Mozilla Persona"
allow_import: "Tillad import, som kan erstatte ALLE sitets data; slå fra med mindre du planlægger at importere data"
active_user_rate_limit_secs: "Hvor ofte vi opdaterer feltet 'last_seen_at', i sekunder."

View file

@ -562,8 +562,6 @@ de:
github_client_id: "Client-ID für Github Authentisierung, registriert auf https://github.com/settings/applications"
github_client_secret: "Client Secret für Github Authentisierung, registriert auf https://github.com/settings/applications"
enable_persona_logins: "Aktiviere mailbasierte Authentisierung mit Mozilla Persona."
allow_import: "Erlaube Datenimports. (WARNUNG: Hiermit können ALLE vorhandenen Daten überschrieben werden; immer auf 'false' lassen, es sei denn Du planst wirklich Datenimports)."
active_user_rate_limit_secs: "Sekunden, nach denen das 'last_seen_at'-Feld aktualisiert wird."

View file

@ -667,8 +667,6 @@ en:
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"
enable_persona_logins: "Enable email-based authentication with Mozilla Persona"
allow_import: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"
active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds"

View file

@ -365,8 +365,6 @@ es:
github_client_id: "Client id para la autenticación por Github, registrado en https://github.com/settings/applications"
github_client_secret: "Client secret para la autenticación por Github, registrado en https://github.com/settings/applications"
enable_persona_logins: "Activar autenticación basada en email con Mozilla Persona"
allow_import: "Permitir importación, la cual puede reemplazar TODOS los datos del sitio, déjalo a false hasta que planees ahcer importaciones de datos"
active_user_rate_limit_secs: "Como de frecuentemente actualizaremos el campo 'last_seen_at', en segundos"

View file

@ -590,7 +590,6 @@ fr:
enable_github_logins: "Active l'authentification GitHub, nécessite github_client_id et github_client_secret"
github_client_id: "id client pour l'authentification Github, enregistré sur https://github.com/settings/applications"
github_client_secret: "secret client pour l'authentification Github, enregistré sur https://github.com/settings/applications"
enable_persona_logins: "Active l'authentification par e-mail avec Mozilla Persona"
allow_import: "Autoriser l'importation qui remplacera TOUTES les données du site. Laisser non coché, sauf si vous prévoyez d'importer des données."
active_user_rate_limit_secs: "A quelle fréquence mettre à jour le champ 'dernier_vu_a', en secondes."
previous_visit_timeout_hours: "Combien de temps dure une visite avant de la considérer comme la visite 'précédente', en heures."

View file

@ -376,8 +376,6 @@ id:
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"
enable_persona_logins: "Enable email-based authentication with Mozilla Persona"
allow_import: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"
active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds"

View file

@ -498,8 +498,6 @@ it:
github_client_id: "Client id per autenticazione Github, ottenibile da https://github.com/settings/applications"
github_client_secret: "Client secret per autenticazione Github, ottenibile da https://github.com/settings/applications"
enable_persona_logins: "Abilita autenticazione email con Mozilla Persona"
allow_import: "Abilita l'importazione, che può sostituire TUTTI i dati presenti nel sito; non modificare se non hai intenzione di importare dati"
active_user_rate_limit_secs: "Quanto frequentemente viene aggiornato il campo 'last_seen_at' field, in secondi"

View file

@ -582,8 +582,6 @@ ja:
github_client_id: "Github 認証用の client id。https://github.com/settings/applications で入手可能"
github_client_secret: "Github 認証用の client secret。https://github.com/settings/applications で入手可能"
enable_persona_logins: "Mozilla Persona によるメールベース認証を有効にする"
allow_import: "インポートを有効にする。サイトの全データの上書きが可能になるため、データのインポートを予定していない場合は false にすることを推奨"
active_user_rate_limit_secs: "'last_seen_at' フィールドを更新する頻度 (秒)"

View file

@ -601,8 +601,6 @@ ko:
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"
enable_persona_logins: "Enable email-based authentication with Mozilla Persona"
allow_import: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"
active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds"

View file

@ -656,8 +656,6 @@ nl:
github_client_id: "github_client_id (registreer op https://github.com/settings/applications)"
github_client_secret: "github_client_secret (registreer op https://github.com/settings/applications)"
enable_persona_logins: "Zet inloggen met Mozilla Persona aan"
allow_import: "Sta import toe, die ALLE site-data vervangt. Zet op 'false' tenzij je imports gaat doen."
active_user_rate_limit_secs: "Hoe vaak we het 'last_seen_at'-veld updaten, in seconden."

View file

@ -775,8 +775,6 @@ pseudo:
]]'
github_client_secret: '[[ Čłíéɳť šéčřéť ƒóř Ǧíťĥůƀ áůťĥéɳťíčáťíóɳ, řéǧíšťéřéď
áť ĥťťƿš://ǧíťĥůƀ.čóɱ/šéťťíɳǧš/áƿƿłíčáťíóɳš ]]'
enable_persona_logins: '[[ Éɳáƀłé éɱáíł-ƀášéď áůťĥéɳťíčáťíóɳ ŵíťĥ Ϻóžíłłá Рéřšóɳá
]]'
allow_import: '[[ Áłłóŵ íɱƿóřť, ŵĥíčĥ čáɳ řéƿłáčé ÁŁŁ šíťé ďáťá; łéáνé ƒáłšé ůɳłéšš
ýóů ƿłáɳ ťó ďó ďáťá íɱƿóřťš ]]'
active_user_rate_limit_secs: '[[ Ĥóŵ ƒřéƣůéɳťłý ŵé ůƿďáťé ťĥé ''łášť_šééɳ_áť''

View file

@ -593,8 +593,6 @@ pt_BR:
github_client_id: "Client id para autenticação via Github, registrado em https://github.com/settings/applications"
github_client_secret: "Client secret para autenticação via Github, registrado em https://github.com/settings/applications"
enable_persona_logins: "Ativar autenticação baseada em email com Mozilla Persona"
allow_import: "Permitir importar, vai substituir TODOS os dados do site. Deixe como falso a menos que você pretenda fazer importações."
active_user_rate_limit_secs: "Qual a frequencia de atualização do campo 'última vez visto em', em segundos."

View file

@ -588,7 +588,6 @@ ru:
enable_github_logins: 'Разрешить идентификацию с Github, требует github_client_id и github_client_secret'
github_client_id: 'Клиентский id для идентификации с Github, зарегистрированный на https://github.com/settings/applications'
github_client_secret: 'Клиентский секрет для идентификации с Github, зарегистрированный на https://github.com/settings/applications'
enable_persona_logins: 'Разрешить идентификацию с Mozilla Persona, основанную на электронной почте'
allow_import: 'Позволить импорт, который может заменить ВСЕ данные сайта. Оставьте false, если не планируете импортировать данные'
active_user_rate_limit_secs: 'Как часто мы обновляем поле ''last_seen_at'', в секундах'
previous_visit_timeout_hours: 'Как долго должно длиться посещение сайта, чтобы мы посчитали его «предыдущим посещением», в часах'

View file

@ -420,8 +420,6 @@ sv:
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"
enable_persona_logins: "Enable email-based authentication with Mozilla Persona"
allow_import: "Allow import, which can replace ALL site data; leave false unless you plan to do data imports"
active_user_rate_limit_secs: "How frequently we update the 'last_seen_at' field, in seconds"

View file

@ -518,8 +518,6 @@ zh_CN:
github_client_id: "Github 帐号验证的客户端帐号Client id到 https://github.com/settings/applications 来注册获取"
github_client_secret: "Github 帐号验证的客户端密码Client secret到 https://github.com/settings/applications 来注册获取"
enable_persona_logins: "启用基于电子邮箱的 Mozilla Persona 帐号验证登录"
allow_import: "允许导入数据这将替换全站数据。除非你计划导入数据否则请保持设置为false"
active_user_rate_limit_secs: "更新“最后一次见到”数据的频率,单位为秒"

View file

@ -518,8 +518,6 @@ zh_TW:
github_client_id: "Github 帳號驗證的用戶端帳號Client id到 https://github.com/settings/applications 來註冊獲取"
github_client_secret: "Github 帳號驗證的用戶端密碼Client secret到 https://github.com/settings/applications 來註冊獲取"
enable_persona_logins: "啟用基於電子郵箱的 Mozilla Persona 帳號驗證登入"
allow_import: "允許導入資料這將替換全站資料。除非你計畫導入資料否則請保持設置為false"
active_user_rate_limit_secs: "更新“最後一次見到”資料的頻率,單位為秒"

View file

@ -113,9 +113,6 @@ users:
default: false
github_client_id: ''
github_client_secret: ''
enable_persona_logins:
client: true
default: false
enforce_global_nicknames: false
discourse_org_access_key: ''
invite_expiry_days: 4

View file

@ -6,5 +6,4 @@ require_dependency 'auth/facebook_authenticator'
require_dependency 'auth/open_id_authenticator'
require_dependency 'auth/github_authenticator'
require_dependency 'auth/twitter_authenticator'
require_dependency 'auth/persona_authenticator'
require_dependency 'auth/cas_authenticator'

View file

@ -1,25 +0,0 @@
class Auth::PersonaAuthenticator < Auth::Authenticator
def name
"persona"
end
# TODO twitter provides all sorts of extra info, like website/bio etc.
# it may be worth considering pulling some of it in.
def after_authenticate(auth_token)
result = Auth::Result.new
result.email = email = auth_token[:info][:email]
result.email_valid = true
result.user = User.find_by_email(email)
result
end
def register_middleware(omniauth)
omniauth.provider :browser_id,
:name => "persona"
end
end