Add helper `needs_api_tokens()`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with helpers.php and the existing Formats\GitHub, Formats\Twitter, and Formats\Facebook matches_host methods. Decide whether the helper should return service names or credential names, as the issue offers both options. Done means needs_api_tokens($url) identifies the required tokens for those services and returns an empty result for other URLs.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Might it be a good idea to add this helper function to helpers.php, now that there are 3 silo's that need API keys?
function needs_api_tokens($url) {
if(Formats\GitHub::matches_host($url)) return 'github';
if(Formats\Twitter::matches_host($url)) return 'twitter';
if(Formats\Facebook::matches_host($url)) return 'facebook';
return false;
}
Instead of these strings, we can also return an array of the credentials we expect.
function needs_api_tokens($url) {
if(Formats\GitHub::matches_host($url)) return ['github_access_token'];
if(Formats\Twitter::matches_host($url)) return ['twitter_api_key','twitter_api_secret','twitter_access_token','twitter_access_token_secret'];
if(Formats\Facebook::matches_host($url)) return ['facebook_app_id','facebook_app_secret'];
return [];
}
- Lingua principale
- PHP
- Stelle
- 96
- Fork
- 17
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aaronpk/XRay
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 54/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di aaronpk/XRay
Issue simili
-
[Sync EN] Pdo\Pgsql: document session state reset on persistent connections (PHP 8.6) (#6084)Forse già presa @lacatoire l’ha presa oggi. Apertasync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Potential Bug To Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
matomo-org/matomo#25740 ·
I maintainer di solito rispondono entro 1 giorno
-
[Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
WordPress/ai#1386 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
E2E setup scripts seed the legacy `payment_request` settings keys instead of `express_checkout`Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
woocommerce/woocommerce-gateway-stripe#6201 ·
I maintainer di solito rispondono entro 2 giorni
-
bug status: unverified
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno