Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 0 additions & 17 deletions .babelrc

This file was deleted.

24 changes: 23 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,26 @@ RABBITMQ_SSL=true
RABBITMQ_SSL_CAFILE=/certs/rabbit/ca-osf.pem
RABBITMQ_SSL_LOCALCERT=/certs/rabbit/client-cert-osf.pem
RABBITMQ_SSL_LOCALKEY=/certs/rabbit/client-key-osf.pem
RABBITMQ_SSL_VERIFY_PEER=false
RABBITMQ_SSL_VERIFY_PEER=false

# 3rd party idps

FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=
FACEBOOK_REDIRECT_URI=/auth/login/facebook/callback

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=/auth/login/google/callback

APPLE_CLIENT_ID=
APPLE_CLIENT_SECRET=
APPLE_REDIRECT_URI=/auth/login/apple/callback

LINKEDIN_CLIENT_ID=
LINKEDIN_CLIENT_SECRET=
LINKEDIN_REDIRECT_URI=/auth/login/linkedin/callback

OTP_DEFAULT_LIFETIME=600
OTP_DEFAULT_LENGTH=6
APP_HOME_PAGE_INFO_TEXT=""
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ routes.txt
model.sql
.phpunit.result.cache
!/public/web.config
/public/assets/dist/
/public/assets/login.js
/public/assets/css/login.css
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v12.19.0
14 changes: 5 additions & 9 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
run: playbooks/openstackid-release-branch/run.yaml
post-run: playbooks/openstackid-release-branch/post.yaml
timeout: 1800
# OpenStackID needs MYSQL 5.7.x and will fail with newer MYSQL, Bionic has Java 5.7.x.
nodeset: ubuntu-bionic
nodeset: ubuntu-focal

- job:
# This is included into the osf/openstackid release pipeline from the
Expand All @@ -15,29 +14,26 @@
run: playbooks/openstackid-release-master/run.yaml
post-run: playbooks/openstackid-release-master/post.yaml
timeout: 1800
# OpenStackID needs MYSQL 5.7.x and will fail with newer MYSQL, Bionic has Java 5.7.x.
nodeset: ubuntu-bionic
nodeset: ubuntu-focal

- job:
name: openstackid-unittests
run: playbooks/openstackid-unittests/run.yaml
timeout: 1800
# OpenStackID needs MYSQL 5.7.x and will fail with newer MYSQL, Bionic has Java 5.7.x.
nodeset: ubuntu-bionic

nodeset: ubuntu-focal

- project:
name: osf/openstackid
check:
jobs:
- openstackid-unittests
- opendev-tox-docs:
nodeset: ubuntu-bionic
nodeset: ubuntu-focal
gate:
jobs:
- openstackid-unittests
- opendev-tox-docs:
nodeset: ubuntu-bionic
nodeset: ubuntu-focal
post:
jobs:
- openstackid-release-branch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,27 @@ final class RebuildUserSpammerEstimator extends Command
public function handle()
{
try {
$is_enabled = boolval(Config::get("jobs.spam_processing_enabled"));
if(!$is_enabled){
return;
}

$connections = Config::get('database.connections', []);
$db = $connections['openstackid'] ?? [];
$host = $db['host'] ?? '';
$database = $db['database'] ?? '';
$username = $db['username'] ?? '';
$password = $db['password'] ?? '';

$command = sprintf(
'%s/app/Console/Commands/SpammerProcess/estimator_build.sh "%s" "%s" "%s" "%s" "%s"',
base_path(),
$command = [sprintf('%s/app/Console/Commands/SpammerProcess/estimator_build.sh', base_path()),
base_path() . '/app/Console/Commands/SpammerProcess',
$host,
$username,
$password,
$database
);
];

Log::debug(sprintf("RebuildUserSpammerEstimator::handle running command %s", $command));
Log::debug(sprintf("RebuildUserSpammerEstimator::handle running command %s", implode(" ", $command)));

$process = new Process($command);
$process->setTimeout(PHP_INT_MAX);
Expand Down
12 changes: 7 additions & 5 deletions app/Console/Commands/SpammerProcess/UserSpammerProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,26 @@ public function __construct(IUserRepository $user_repository)
public function handle()
{
try {
$is_enabled = boolval(Config::get("jobs.spam_processing_enabled"));
if(!$is_enabled){
return;
}
$connections = Config::get('database.connections', []);
$db = $connections['openstackid'] ?? [];
$host = $db['host'] ?? '';
$database = $db['database'] ?? '';
$username = $db['username'] ?? '';
$password = $db['password'] ?? '';

$command = sprintf(
'%s/app/Console/Commands/SpammerProcess/estimator_process.sh "%s" "%s" "%s" "%s" "%s"',
base_path(),
$command = [sprintf('%s/app/Console/Commands/SpammerProcess/estimator_process.sh',base_path()),
base_path() . '/app/Console/Commands/SpammerProcess',
$host,
$username,
$password,
$database
);
];

Log::debug(sprintf("UserSpammerProcessor::handle running command %s", $command));
Log::debug(sprintf("UserSpammerProcessor::handle running command %s", implode(" ",$command)));

$process = new Process($command);
$process->setTimeout(PHP_INT_MAX);
Expand Down
8 changes: 4 additions & 4 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('idp:oauth2-clean')->dailyAt("02:30")->withoutOverlapping();
$schedule->command('idp:openid-clean')->dailyAt("03:30")->withoutOverlapping();
$schedule->command('idp:oauth2-clean')->dailyAt("02:30")->withoutOverlapping()->onOneServer();
$schedule->command('idp:openid-clean')->dailyAt("03:30")->withoutOverlapping()->onOneServer();
// user spammer
$schedule->command('user-spam:rebuild')->dailyAt("02:30")->withoutOverlapping();
$schedule->command('user-spam:process')->dailyAt("03:30")->withoutOverlapping();
$schedule->command('user-spam:rebuild')->dailyAt("02:30")->withoutOverlapping()->onOneServer();
$schedule->command('user-spam:process')->dailyAt("03:30")->withoutOverlapping()->onOneServer();
}
}
6 changes: 3 additions & 3 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
use Exception;
use Throwable;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
Expand Down Expand Up @@ -45,7 +45,7 @@ class Handler extends ExceptionHandler
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
public function report(Throwable $e)
{
parent::report($e);
}
Expand All @@ -57,7 +57,7 @@ public function report(Exception $e)
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
public function render($request, Throwable $e)
{
return parent::render($request, $e);
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use App\libs\Auth\Repositories\IBannedIPRepository;
use App\libs\Auth\Repositories\IGroupRepository;
use Auth\Repositories\IUserRepository;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\View;
Expand Down Expand Up @@ -385,7 +385,7 @@ public function editEndpoint($id){
if(is_null($endpoint)) return Response::view('errors.404', [], 404);
$user = $this->auth_service->getCurrentUser();
$selected_scopes = [];
$list = $endpoint->getScopes();
$list = $endpoint->getScope();
foreach($list as $selected_scope){
$selected_scopes[] = $selected_scope->getId();
}
Expand Down Expand Up @@ -493,7 +493,7 @@ public function listServerConfig(){

public function saveServerConfig(){

$values = Input::all();
$values = Request::all();

$rules = array
(
Expand Down
11 changes: 3 additions & 8 deletions app/Http/Controllers/Api/APICRUDController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@
* limitations under the License.
**/
use App\Http\Controllers\Api\JsonController;
use App\Http\Utils\PagingConstants;
use App\ModelSerializers\SerializerRegistry;
use App\Services\IBaseService;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use models\utils\IBaseRepository;
use utils\Filter;
use utils\FilterParser;
use utils\OrderParser;
use utils\PagingInfo;
use Utils\Services\ILogService;
use Exception;
use models\exceptions\ValidationException;
Expand Down Expand Up @@ -84,7 +79,7 @@ public function get($id)

return $this->ok(SerializerRegistry::getInstance()->getSerializer($entity, $this->serializerType())->serialize
(
Input::get("expand", '')
Request::input("expand", '')
));
}
catch (EntityNotFoundException $ex2)
Expand Down Expand Up @@ -181,7 +176,7 @@ protected abstract function getCreatePayloadValidationRules():array;
* @return array
*/
protected function getCreatePayload():array{
return Input::All();
return Request::All();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Api/ApiBannedIPController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use models\exceptions\ValidationException;
use Utils\Services\IBannedIPService;
use Utils\Services\ILogService;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Request;
use Exception;
/**
* Class ApiBannedIPController
Expand Down Expand Up @@ -54,7 +54,7 @@ public function get($id)
{
try {

$ip = Input::get("ip", null);
$ip = Request::input("ip", null);
if (!is_null($ip)) {
$banned_ip = $this->repository->getByIp(strval($ip));
} else {
Expand Down Expand Up @@ -89,7 +89,7 @@ public function delete($id = null)
{
try {
if (is_null($id)) {
$ip = Input::get("ip", null);
$ip = Request::input("ip", null);
} else {
$banned_ip = $this->repository->getById($id);
$ip = $banned_ip->getIp();
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Api/AsymmetricKeyApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@

use App\Http\Controllers\APICRUDController;
use OAuth2\Services\IAsymmetricKeyService;
use models\exceptions\EntityNotFoundException;
use Utils\Services\ILogService;
use OAuth2\Repositories\IAsymmetricKeyRepository;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Request;
use Exception;
/**
* Class AsymmetricKeyApiController
Expand Down
Loading