angus
(Angus McLeod)
8 نوفمبر 2021، 6:10ص
22
لاحظ أنني قمت بإنشاء مسودة طلب سحب محدثة بنهج جديد (تتضمن التغييرات المطلوبة من قبل @david في محاولتي الأخيرة). كما ذكرت في التعليقات على طلب السحب، أتطلع إلى الانتهاء منه في وقت ما هذا الأسبوع.
main ← angusmcleod:group_membership_via_authentication
opened 06:06AM - 08 Nov 21 UTC
Update on #12446.
@davidtaylorhq A draft for an update on the associated grou… p membership work. It's been rebased, brought in line with the latest changes and updated in the ways explained below. Let me know if you're onboard with the approach so far. I'll finish it off next weekend.
### Authentication and group retrieval
I've removed the secondary auth stuff, added a google-hd-specific boolean setting, and moved the group retrieval into a new google oauth2 omniauth strategy. I've made a new folder and added a spec for the strategy (something new in the codebase) as I thought it deserved a spec (which is also included). If we add in secondary auth to this strategy that too will need a spec. Some of the existing discourse omniauth strategies, e.g. Discord, may benefit from being seperated out and tested too.
### Group Provision and UI
As suggested, I've added a ``provides_groups?`` to the ``Auth::Authenticator``. Using this approach led to a new groups guardian method to use at the various group CRUD points. Speaking of which, I've added in support for group_associated_group creation in group creation (i.e. ``/g/custom/new``). Supporting it in both ``new`` and ``manage`` (update) also led to adding a new site attribute ``can_associate_groups``. I attempted to make this more group-route specific, however this leads to various clumsy workarounds to determine whether an admin can associate groups in ``/g/custom/new``. The site attribute approach proved the simplest and most performant (i.e. fewer ajax calls).
### Data model
I've made one change to the data model so far, namely to use ``after_commit`` hooks rather than ``after_create``/``after_destroy`` as using those hooks leads to duplicate record creation in ``Admin::GroupsController`` ``create``. I've yet to deal with the edge case you pointed out, i.e. multiple UserAssociatedGroups which link to the same group.
3 إعجابات
mattdm
(Matthew Miller)
8 نوفمبر 2021، 2:57م
23
حتى لا أتحمس بلا داعٍ - هل هذا يعني “جوجل”… وهل سيعمل أيضًا مع تسجيل الدخول الموحد OAuth2 غير التابع لجوجل؟
إعجابَين (2)
angus
(Angus McLeod)
8 نوفمبر 2021، 3:01م
24
إنه نظام عام، ولكن ستكون حالة الاستخدام الأولى المدعومة هي المجموعات في مساحة عمل Google. بمجرد أن يصبح النظام جاهزًا، لن يكون إضافة دعم لموفّرين إضافيين صعبًا للغاية.
5 إعجابات
angus
(Angus McLeod)
22 نوفمبر 2021، 6:06ص
25
لاحظ أن طلب السحب هذا تم نقله من مسودة إلى منشور خلال عطلة نهاية الأسبوع (أي أنه جاهز للمراجعة مرة أخرى).
main ← angusmcleod:group_membership_via_authentication
opened 06:06AM - 08 Nov 21 UTC
Update on #12446.
@davidtaylorhq A draft for an update on the associated grou… p membership work. It's been rebased, brought in line with the latest changes and updated in the ways explained below. Let me know if you're onboard with the approach so far. I'll finish it off next weekend.
### Authentication and group retrieval
I've removed the secondary auth stuff, added a google-hd-specific boolean setting, and moved the group retrieval into a new google oauth2 omniauth strategy. I've made a new folder and added a spec for the strategy (something new in the codebase) as I thought it deserved a spec (which is also included). If we add in secondary auth to this strategy that too will need a spec. Some of the existing discourse omniauth strategies, e.g. Discord, may benefit from being seperated out and tested too.
### Group Provision and UI
As suggested, I've added a ``provides_groups?`` to the ``Auth::Authenticator``. Using this approach led to a new groups guardian method to use at the various group CRUD points. Speaking of which, I've added in support for group_associated_group creation in group creation (i.e. ``/g/custom/new``). Supporting it in both ``new`` and ``manage`` (update) also led to adding a new site attribute ``can_associate_groups``. I attempted to make this more group-route specific, however this leads to various clumsy workarounds to determine whether an admin can associate groups in ``/g/custom/new``. The site attribute approach proved the simplest and most performant (i.e. fewer ajax calls).
### Data model
I've made one change to the data model so far, namely to use ``after_commit`` hooks rather than ``after_create``/``after_destroy`` as using those hooks leads to duplicate record creation in ``Admin::GroupsController`` ``create``. I've yet to deal with the edge case you pointed out, i.e. multiple UserAssociatedGroups which link to the same group.
5 إعجابات
david
(David Taylor)
9 ديسمبر 2021، 12:32م
26
لقد قمت للتو بدمج طلب السحب هذا - شكرًا جزيلاً على كل عملك هنا @angus ! متحمس لرؤية كيف سيتم استخدام هذا وتوسيعه في المستقبل!
لقد قمت بوضع علامة “تجريبي” على إعداد الموقع في الوقت الحالي، لمنحنا بعض الوقت لاختباره والتأكد من أن كل شيء يعمل بسلاسة. بمجرد أن نكون واثقين، وبعد أن نضيف الدعم في عدد قليل من موفري المصادقة الإضافيين، سأحرص على إنشاء موضوع #feature:announcements لهذه الميزة.
8 إعجابات
angus
(Angus McLeod)
9 ديسمبر 2021، 1:44م
27
رائع!
شكراً لك ديفيد. لم يكن ليحدث هذا بدون دعمك. يسعدني المساعدة في إضافة موفري خدمة إضافيين.
6 إعجابات
mattdm
(Matthew Miller)
9 ديسمبر 2021، 2:18م
28
نعم! شكراً للجميع. نخطط لاستخدام هذا على نطاق واسع في فيدورا بمجرد أن يعمل مع oauth2.
5 إعجابات
أنا متحمس أيضًا لتوفره لتسجيلات الدخول غير التابعة لـ Google OAuth2/OpenID… هل هناك أي تحديث حول ما إذا كان / متى سيكون هذا الخيار متاحًا؟
5 إعجابات
david
(David Taylor)
11 مارس 2022، 11:49ص
30
ليس لدينا جدول زمني محدد، ولكن بالتأكيد pr-welcome إذا رغب أي شخص في تقديم تصحيح
5 إعجابات
نتطلع إلى هذا أيضًا! حالة الاستخدام بالنسبة لنا هي سحب عضوية المجموعة من Keycloak عند المصادقة.
8 إعجابات
أقوم حاليًا باستضافة Discourse بنفسي واستخدام Authentik كموفر الهوية الخاص بي للمصادقة. ما أود تحقيقه هو مزامنة مجموعات المستخدمين تلقائيًا من Authentik مع مجموعات محددة في Discourse عند تسجيل الدخول.
ولكن.. أريد التأكد من أن المستخدمين المحليين الذين يسجلون عبر عملية التسجيل المحلية في Discourse لا يتم تعيينهم إلى هذه المجموعات المحددة وبدلاً من ذلك يتبعون تقدم مستوى الثقة العادي.
إعجابَين (2)
bsoares
(Ben Soares)
10 سبتمبر 2025، 4:42م
33
مرحباً!
لقد قمنا بترحيل المصادقة لدينا من Atlassian Crowd (الذي لم يعد مدعوماً في Discourse) إلى OpenID Connect (عبر Keycloak) وأردنا استخدام رمز تعيين مجموعات Crowd الذي ساهمنا به منذ بضع سنوات في إضافة discourse-openid-connect.
لدينا تغييرات في التعليمات البرمجية تعمل وتسمح بتكوين خرائط بين مجموعات OpenID Connect ومجموعات Discourse وقمنا بوضعها في طلب سحب FEATURE: Openid connect group maps by benzoid · Pull Request #34763 · discourse/discourse · GitHub .
نأمل أن يتم النظر في دمجها وسنكون على استعداد لإضافة توثيق أو اختبارات (إذا كان يمكن توجيهي إلى دليل للاختبارات - لست مبرمج Ruby أصلياً (بعد)!).
بن
3 إعجابات