mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
add github app client id/secret
This commit is contained in:
parent
970e053cf3
commit
9e6a7a55f4
3 changed files with 9 additions and 4 deletions
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
$config = [];
|
$config = [];
|
||||||
// $config[Config::GITHUB_KEY] = '';
|
// $config[Config::GITHUB_KEY] = '';
|
||||||
// $config[Config::GITHUB_DEVELOPER_CREDITS_CLIENT_ID] = '';
|
// $config[Config::GITHUB_APP_CLIENT_ID] = ''; //optional, increases API rate limit
|
||||||
// $config[Config::GITHUB_DEVELOPER_CREDITS_CLIENT_SECRET] = '';
|
// $config[Config::GITHUB_APP_CLIENT_SECRET] = '';
|
||||||
// $config[Config::LBRY_API_SERVER] = '';
|
// $config[Config::LBRY_API_SERVER] = '';
|
||||||
// $config[Config::MAILCHIMP_KEY] = '';
|
// $config[Config::MAILCHIMP_KEY] = '';
|
||||||
// $config[Config::ASANA_KEY] = '';
|
// $config[Config::ASANA_KEY] = '';
|
||||||
|
|
5
lib/thirdparty/Github.class.php
vendored
5
lib/thirdparty/Github.class.php
vendored
|
@ -95,6 +95,11 @@ class Github
|
||||||
public static function get($endpoint, array $params = [], $cache = true)
|
public static function get($endpoint, array $params = [], $cache = true)
|
||||||
{
|
{
|
||||||
$twoHoursInSeconds = 7200;
|
$twoHoursInSeconds = 7200;
|
||||||
|
if (Config::get(Config::GITHUB_APP_CLIENT_ID) && Config::get(Config::GITHUB_APP_CLIENT_SECRET))
|
||||||
|
{
|
||||||
|
$params['client_id'] = Config::get(Config::GITHUB_APP_CLIENT_ID);
|
||||||
|
$params['client_secret'] = Config::Get(Config::GITHUB_APP_CLIENT_SECRET);
|
||||||
|
}
|
||||||
return CurlWithCache::get(
|
return CurlWithCache::get(
|
||||||
'https://api.github.com' . $endpoint . '?' . http_build_query($params),
|
'https://api.github.com' . $endpoint . '?' . http_build_query($params),
|
||||||
[],
|
[],
|
||||||
|
|
|
@ -7,8 +7,8 @@ class Config
|
||||||
//Constant to help with managing strings
|
//Constant to help with managing strings
|
||||||
const IS_PROD = "is_prod";
|
const IS_PROD = "is_prod";
|
||||||
const GITHUB_KEY = "github_key";
|
const GITHUB_KEY = "github_key";
|
||||||
const GITHUB_DEVELOPER_CREDITS_CLIENT_ID = "github_developer_credits_client_id";
|
const GITHUB_APP_CLIENT_ID = "github_app_client_id";
|
||||||
const GITHUB_DEVELOPER_CREDITS_CLIENT_SECRET = "github_developer_credits_client_secret";
|
const GITHUB_APP_CLIENT_SECRET = "github_app_client_secret";
|
||||||
const LBRY_API_SERVER = "lbry_api_server";
|
const LBRY_API_SERVER = "lbry_api_server";
|
||||||
const MAILCHIMP_KEY = "mailchimp_key";
|
const MAILCHIMP_KEY = "mailchimp_key";
|
||||||
const ASANA_KEY = "asana_key";
|
const ASANA_KEY = "asana_key";
|
||||||
|
|
Loading…
Add table
Reference in a new issue