Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[Confirm] Add proxy for fetching jobs from GraphQL API" #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions conf/config-example
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,3 @@ define('SM_API_URL', '');
define('SM_USERNAME', '');
define('SM_PASSWORD', '');
define('SM_MEMCACHE_PREFIX', '');

define('CONFIRM_API_CONFIG', []);
define('CONFIRM_LAYER_CONFIG', []);
44 changes: 0 additions & 44 deletions web/confirm.php

This file was deleted.

24 changes: 2 additions & 22 deletions web/fns.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,6 @@ function get_alloy_token() {
return $token;
}

function get_confirm_cfg() {
$url = get('url', 'https://[a-z.]+');
$cfg = CONFIRM_API_CONFIG[$url];
if (!$cfg) {
print EMPTY_RESULT;
exit;
}
return $cfg;
}

function get_confirm_layer_cfg($layer) {
$url = get('url', 'https://[a-z.]+');
$cfg = CONFIRM_LAYER_CONFIG[$url][$layer];
if (!$cfg) {
print EMPTY_RESULT;
exit;
}
return $cfg;
}

function get($id, $regex, $default = null) {
$var = isset($_GET[$id]) ? $_GET[$id] : '';
if ($var && preg_match('#^' . $regex . '$#', $var)) {
Expand All @@ -55,14 +35,14 @@ function get($id, $regex, $default = null) {
return $default;
}

function make_request($url, $token, $params, $auth_type = "Bearer") {
function make_request($url, $token, $params) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
"Authorization: $auth_type $token",
"Authorization: Bearer $token",
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
Expand Down