Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #249 from pacoorozco/issue-248
Browse files Browse the repository at this point in the history
Upgrade to Laravel 9.x
  • Loading branch information
pacoorozco authored Jun 13, 2022
2 parents 76d2c10 + 0f1c2f6 commit bc0f2b8
Show file tree
Hide file tree
Showing 45 changed files with 2,836 additions and 2,918 deletions.
5 changes: 0 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

# Trusted proxies configuration
# @see 'config/trustedproxy.php' to know how to configure these trusted proxies.
TRUSTED_PROXIES=
TRUSTED_HEADERS=

# -----[ DO NOT TOUCH BELOW THIS POINT ]-----
#
BROADCAST_DRIVER=log
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this

## Unreleased

## 1.2.0 - 2022-06-13


### Changed
- **Important**: This application has upgraded to [Laravel 9.x](https://laravel.com/docs). ([#248][i248])

### Removed
- Support for configuring environment variables for [Trusted Proxies](https://laravel.com/docs/9.x/requests#configuring-trusted-proxies). You can't configure it neither from the `.env` nor `trustedproxies.php`.

[i248]: https://github.com/pacoorozco/probind/issues/248

## 1.1.0 - 2022-04-06

### Added
Expand Down
27 changes: 8 additions & 19 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
<?php
/**
* SSH Access Manager - SSH keys management solution.
*
* Copyright (c) 2017 - 2020 by Paco Orozco <paco@pacoorozco.info>
*
* This file is part of some open source application.
*
* Licensed under GNU General Public License 3.0.
* Some rights reserved. See LICENSE, AUTHORS.
*
* @author Paco Orozco <paco@pacoorozco.info>
* @copyright 2017 - 2020 Paco Orozco
* @license GPL-3.0 <http://spdx.org/licenses/GPL-3.0>
*
* @link https://github.com/pacoorozco/ssham
*/

namespace App\Http\Middleware;

use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;

class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string|null
* @var array<int, string>|string|null
*/
protected $proxies;

Expand All @@ -35,5 +19,10 @@ class TrustProxies extends Middleware
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB;
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}
12 changes: 7 additions & 5 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,20 @@ class AuthServiceProvider extends ServiceProvider
/**
* The policy mappings for the application.
*
* @var array
* Policies are discovered automatically using the Policy Auto-Discovery.
*
* @see https://laravel.com/docs/9.x/authorization#policy-auto-discovery
*
* @var array<class-string, class-string>
*/
protected $policies = [
'App\Models\Model' => 'App\Policies\ModelPolicy',
];
protected $policies = [];

/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
public function boot(): void
{
$this->registerPolicies();

Expand Down
4 changes: 4 additions & 0 deletions app/Rules/FullyQualifiedDomainName.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class FullyQualifiedDomainName implements Rule
{
public function passes($attribute, $value): bool
{
if ('.' === $value) {
return false;
}

return Validator::fullyQualifiedDomainName($value);
}

Expand Down
21 changes: 10 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,26 @@
"require": {
"php": "^8.0.2",
"badcow/dns": "^4.1.1",
"bensampo/laravel-enum": "^4.2.0",
"fideloper/proxy": "^4.4.1",
"bensampo/laravel-enum": "^5.3.0",
"fruitcake/laravel-cors": "^3.0.0",
"guilhermegonzaga/presenter": "^1.0.6",
"larapacks/setting": "^3.0.1",
"laravel/framework": "^8.83.6",
"laravel/framework": "^9.16.0",
"laravel/ui": "^3.4.5",
"laravelcollective/html": "^6.3.0",
"pacoorozco/openssh": "^0.2.1",
"phpseclib/phpseclib": "^3.0.13",
"spatie/laravel-activitylog": "^4.4.2",
"yajra/laravel-datatables-oracle": "^9.19.1"
"phpseclib/phpseclib": "^3.0.14",
"spatie/laravel-activitylog": "^4.5.3",
"yajra/laravel-datatables-oracle": "^10.0.7"
},
"require-dev": {
"brianium/paratest": "^6.4.4",
"doctrine/dbal": "^3.3.4",
"facade/ignition": "^2.17.5",
"fakerphp/faker": "^1.19",
"doctrine/dbal": "^3.3.6",
"spatie/laravel-ignition": "^1.2.3",
"fakerphp/faker": "^1.19.0",
"mockery/mockery": "^1.5.0",
"nunomaduro/collision": "^5.11.0",
"nunomaduro/larastan": "^1.0.3",
"nunomaduro/collision": "^6.2.0",
"nunomaduro/larastan": "^2.1.8",
"phpunit/phpunit": "^9.5.20"
},
"autoload": {
Expand Down
Loading

0 comments on commit bc0f2b8

Please sign in to comment.