mattdm
(Matthew Miller)
11 Gennaio 2021, 8:57pm
1
I would prefer to not give a global API key to the wordpress plugin. I don’t want a compromise in the wordpress site to result in user accounts deleted (or edited, or logged out). However, limiting the scopes by guesswork seems to give weird results (like it can’t load subcategories).
What scopes does this actually need to work?
4 Mi Piace
Falco
(Falco)
11 Gennaio 2021, 10:24pm
2
With the Wordpress pre-dating the Admin API scopes by several years I doubt it can work with it.
It’s an interesting feature request.
mattdm
(Matthew Miller)
11 Gennaio 2021, 10:37pm
3
I would really appreciate it. The global API key can do a lot of things, and we’re using our Discourse instance for more than just the blog comments, so it’d be nice to keep it scoped to just what it needs.
mattdm
(Matthew Miller)
11 Gennaio 2021, 11:29pm
4
Is such a feature request better in this category, or in features?
angus
(Angus McLeod)
12 Gennaio 2021, 7:36am
5
I’ve been thinking the same thing! (I currently maintain the plugin). This is the right category to raise it.
I’ll discuss it with @simon and get back to you.
3 Mi Piace
mattdm
(Matthew Miller)
11 Dicembre 2021, 5:47pm
6
@angus Questo è andato da qualche parte? Vorremmo usarlo su uno dei nostri siti WordPress dove abbiamo un insieme di utenti con accesso amministrativo meno che strettamente controllato, e non voglio che questo diventi un’escalation verso l’accesso amministrativo completo sul nostro sito Discourse.
angus
(Angus McLeod)
14 Dicembre 2021, 5:55am
7
Ehi Matt, grazie per avermi ricordato. Ti darò una risposta completa entro la fine della settimana.
1 Mi Piace
angus
(Angus McLeod)
20 Dicembre 2021, 2:15am
8
@mattdm Un aggiornamento su questo. Sto preparando modifiche che ti consentiranno di generare una chiave API con ambiti specifici per il set di funzionalità del plugin WP Discourse che stai utilizzando.
Ciò richiederà modifiche al core di Discourse, quindi è soggetto ad approvazione. Ti terrò aggiornato questa settimana mentre creo una PR.
2 Mi Piace
angus
(Angus McLeod)
20 Dicembre 2021, 9:50am
9
@mattdm Aggiornamento: ci sono due PR in bozza che cercano di affrontare questo problema. Come accennato, l’approccio dovrà essere approvato prima. Note più esplicative sul PR di 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 Mi Piace
mattdm
(Matthew Miller)
8 Aprile 2022, 6:35pm
10
Sembra che si sia bloccato. Vorrei utilizzare questo plugin per Fedora Magazine, che per sua natura ha una politica di accesso piuttosto aperta, ancora più del Fedora Community Blog con cui lo stiamo utilizzando attualmente. Ci sono novità, per caso?
angus
(Angus McLeod)
9 Aprile 2022, 10:03am
11
Grazie per il sollecito @mattdm , e buon tempismo dato che l’ho segnato sul calendario per riprenderlo la prossima settimana, ora che ci sono stati alcuni sviluppi nel PR di Discourse. Ti darò un aggiornamento la prossima settimana.
1 Mi Piace
angus
(Angus McLeod)
18 Aprile 2022, 1:07pm
12
Solo una nota: la parte di Discourse è stata inviata per la revisione (cioè rimossa dalla bozza).
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.
Una volta che sarà unita, la parte di WP Discourse potrà essere unita e rilasciata.
2 Mi Piace
angus
(Angus McLeod)
24 Maggio 2022, 4:34pm
13
@mattdm Gli scope granulari sono ora rilasciati in WP Discourse 2.4.3 . Se sei sull’ultima versione di Discourse e sull’ultima versione del plugin sarai in grado di usarli. Pubblicherò una guida completa su come usarli più avanti nella settimana.
modifica Ecco la guida!
6 Mi Piace
system
(system)
Chiuso
23 Giugno 2022, 4:35pm
14
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.