mattdm
(Matthew Miller)
11 يناير 2021، 8:57م
1
أفضل عدم منح مفتاح API عام لإضافة WordPress. لا أريد أن يؤدي اختراق موقع WordPress إلى حذف حسابات المستخدمين (أو تعديلها أو تسجيل خروجهم). ومع ذلك، يبدو أن تقييد النطاقات بالتخمين يعطي نتائج غريبة (مثل عدم قدرته على تحميل الفئات الفرعية).
ما هي النطاقات المطلوبة فعليًا لكي تعمل هذه الإضافة؟
4 إعجابات
Falco
(Falco)
11 يناير 2021، 10:24م
2
بما أن ووردبريس يسبق نطاقات واجهة برمجة التطبيقات الإدارية بسنوات، فأنا أشك في قدرته على العمل معها.
إنه طلب ميزة مثير للاهتمام.
mattdm
(Matthew Miller)
11 يناير 2021، 10:37م
3
سأكون ممتناً جداً لذلك. يمكن لمفتاح API العالمي القيام بالعديد من الأمور، ونستخدم مثيل Discourse الخاص بنا لأكثر من مجرد تعليقات المدونة، لذا سيكون من الجيد تقييد نطاقه بما يحتاج إليه فقط.
mattdm
(Matthew Miller)
11 يناير 2021، 11:29م
4
هل من الأفضل تقديم طلب ميزة من هذا النوع في هذه الفئة أم في قسم الميزات؟
angus
(Angus McLeod)
12 يناير 2021، 7:36ص
5
لقد كنت أفكر في الأمر نفسه! (أقوم حالياً بصيانة هذه الإضافة). هذا هو التصنيف الصحيح لرفع هذه المسألة.
سأناقش الأمر مع @simon وسأعود إليك بالرد.
3 إعجابات
mattdm
(Matthew Miller)
11 ديسمبر 2021، 5:47م
6
@angus هل ذهب هذا إلى أي مكان؟ نود استخدام هذا على أحد مواقع ووردبريس الخاصة بنا حيث لدينا مجموعة من المستخدمين الذين لديهم وصول المسؤول، ولا أريد أن يكون هذا تصعيدًا إلى وصول المسؤول الكامل على موقع Discourse الخاص بنا.
angus
(Angus McLeod)
14 ديسمبر 2021، 5:55ص
7
مرحباً مات، شكراً على متابعتك لهذا الأمر. سأقدم لك رداً كاملاً بحلول نهاية الأسبوع.
إعجاب واحد (1)
angus
(Angus McLeod)
20 ديسمبر 2021، 2:15ص
8
@mattdm تحديث بخصوص هذا. أقوم بإعداد تغييرات ستسمح لك بإنشاء مفتاح API بنطاقات محددة لمجموعة الميزات الخاصة بإضافة WP Discourse التي تستخدمها.
سيتطلب هذا تغييرات في Discourse الأساسي، لذا فهو يخضع للموافقة. سأبقيك على اطلاع هذا الأسبوع بينما أقوم بإنشاء طلب سحب (PR).
إعجابَين (2)
angus
(Angus McLeod)
20 ديسمبر 2021، 9:50ص
9
@mattdm تحديث: هناك طلبان لسحب الميزات (PRs) قيد الإعداد لمعالجة هذا الأمر. كما ذكرنا، سيحتاج النهج إلى الموافقة أولاً. ملاحظات توضيحية إضافية على طلب السحب الخاص بـ discourse/discourse.
main ← angusmcleod:fix_wordpress_scopes
opened 09:46AM - 20 Dec 21 UTC
I'm looking to add granular API key usage for the WP Discourse plugin. This invo… lves:
- Updating the "wordpress" default mappings to reflect the actions being used by the plugin, grouped by the feature-set they relate to (note that the existing "wordpress" action in the "topic" resource only relates to comment retrieval in the plugin, and is somewhat confusing in its current state).
- Adding a ``session/scopes`` endpoint, which returns the scopes associated with the api key in the request.
This is the companion PR on the plugin, which will provide further context to this: https://github.com/discourse/wp-discourse/pull/431. See in particular [``validate_scopes``](https://github.com/discourse/wp-discourse/pull/431/files#diff-5fd9ce264afeb5f617119db36e34a2e5a33f605527ac6fa9ee761b8123f1a17eR185).
If this approach is acceptable, I'll do some more testing before moving this out of draft. Below are some Q/A explaining my thinking behind this.
### Why does the wordpress plugin need granular scopes?
Currently the plugin requires the use of a global key, but only uses a subset of the actions, creating more risk than necessary. [See for example](https://meta.discourse.org/t/what-scopes-exactly-does-the-wordpress-api-key-need/175812).
### Why group the scopes by feature set?
This is how people use the plugin. Some use only SSO, some only publishing, some without comments etc. If a user is not using SSO they should be able to use a key that doesn't include the ``admin/user`` actions SSO requires.
Currently the "publishing" feature set cannot be totally disabled in the plugin (hence the "(required)" in the action description), however the ability to disable it (and just use SSO) may be added.
### Why add a ``session/scopes`` endpoint?
The WP Discourse plugin currently sends a request to ``/users/:username`` to test its connection to Discourse. This may be successful even if the allowed scopes are insufficient for how the plugin is configured.
A scopes endpoint tells the API consumer both whether the connection is successful and what scopes their key has. There's similar implementations in other APIs, e.g [Sendgrid](https://docs.sendgrid.com/api-reference/api-key-permissions/retrieve-a-list-of-scopes-for-which-this-user-has-access).
### Why add the ``scopes`` endpoint to the session controller?
The endpoint could go in a few different places. I figured it belonged there as essentially you're asking about the scopes in the session created when the api-authenticated request is made.
### Why not use a ``tokeninfo`` endpoint?
``tokeninfo`` endpoints are part of the OAuth 2.0 spec, which is not what we're dealing with here. Using it may be confusing.
main ← angusmcleod:granular_api_key_support
opened 09:16AM - 20 Dec 21 UTC
- Wordpress 6.0 support
- Granular API Key support (backwards compatible)
- Di… scourseConnect copy fix
- Add wpdc_publish_body filter
إعجابَين (2)
mattdm
(Matthew Miller)
8 أبريل 2022، 6:35م
10
يبدو أن هذا قد توقف. أود استخدام هذا المكون الإضافي لمجلة Fedora، والتي تتمتع بسياسة وصول مفتوحة جدًا بحكم تصميمها - أكثر من مدونة مجتمع Fedora التي نستخدمها حاليًا. هل هناك أي أخبار، بالصدفة؟
angus
(Angus McLeod)
9 أبريل 2022، 10:03ص
11
شكراً على التنبيه @mattdm ، والتوقيت مناسب حيث أن لدي هذا في تقويمي لاستئنافه الأسبوع المقبل الآن بعد أن كان هناك بعض التحرك في طلب السحب الخاص بـ Discourse. سأقدم لك تحديثًا حول هذا الأسبوع المقبل.
إعجاب واحد (1)
angus
(Angus McLeod)
18 أبريل 2022، 1:07م
12
ملاحظة فقط بأن جزء Discourse من هذا قد تم تقديمه للمراجعة (أي تم نقله من المسودة).
main ← angusmcleod:fix_wordpress_scopes
opened 09:46AM - 20 Dec 21 UTC
I'm looking to add granular API key usage for the WP Discourse plugin. This invo… lves:
- Updating the "wordpress" default mappings to reflect the actions being used by the plugin, grouped by the feature-set they relate to (note that the existing "wordpress" action in the "topic" resource only relates to comment retrieval in the plugin, and is somewhat confusing in its current state).
- Adding a ``session/scopes`` endpoint, which returns the scopes associated with the api key in the request.
This is the companion PR on the plugin, which will provide further context to this: https://github.com/discourse/wp-discourse/pull/431. See in particular [``validate_scopes``](https://github.com/discourse/wp-discourse/pull/431/files#diff-5fd9ce264afeb5f617119db36e34a2e5a33f605527ac6fa9ee761b8123f1a17eR185).
If this approach is acceptable, I'll do some more testing before moving this out of draft. Below are some Q/A explaining my thinking behind this.
### Why does the wordpress plugin need granular scopes?
Currently the plugin requires the use of a global key, but only uses a subset of the actions, creating more risk than necessary. [See for example](https://meta.discourse.org/t/what-scopes-exactly-does-the-wordpress-api-key-need/175812).
### Why group the scopes by feature set?
This is how people use the plugin. Some use only SSO, some only publishing, some without comments etc. If a user is not using SSO they should be able to use a key that doesn't include the ``admin/user`` actions SSO requires.
Currently the "publishing" feature set cannot be totally disabled in the plugin (hence the "(required)" in the action description), however the ability to disable it (and just use SSO) may be added.
### Why add a ``session/scopes`` endpoint?
The WP Discourse plugin currently sends a request to ``/users/:username`` to test its connection to Discourse. This may be successful even if the allowed scopes are insufficient for how the plugin is configured.
A scopes endpoint tells the API consumer both whether the connection is successful and what scopes their key has. There's similar implementations in other APIs, e.g [Sendgrid](https://docs.sendgrid.com/api-reference/api-key-permissions/retrieve-a-list-of-scopes-for-which-this-user-has-access).
### Why add the ``scopes`` endpoint to the session controller?
The endpoint could go in a few different places. I figured it belonged there as essentially you're asking about the scopes in the session created when the api-authenticated request is made.
### Why not use a ``tokeninfo`` endpoint?
``tokeninfo`` endpoints are part of the OAuth 2.0 spec, which is not what we're dealing with here. Using it may be confusing.
بمجرد دمج ذلك، يمكن دمج وإصدار جزء WP Discourse .
إعجابَين (2)
angus
(Angus McLeod)
24 مايو 2022، 4:34م
13
@mattdm تم إصدار النطاقات التفصيلية الآن في WP Discourse 2.4.3 . إذا كنت تستخدم أحدث إصدار من Discourse وأحدث إصدار من المكون الإضافي، فستتمكن من استخدامها. سأقوم بنشر دليل كامل حول كيفية استخدامها لاحقًا هذا الأسبوع.
تعديل هذا هو الدليل!
6 إعجابات
system
(system)
تم إغلاقه في
23 يونيو 2022، 4:35م
14
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.