Skip to content

Commit

Permalink
Merge branch 'release-v6'
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed May 19, 2023
2 parents bcaab7c + d50e45b commit 699c4fd
Show file tree
Hide file tree
Showing 59 changed files with 1,021 additions and 820 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ tools/docker/containers/mysql/docker.sql

tests/Browser/ExampleTest.php
app/Console/Commands/Redcentric.php
.env.sage
1 change: 1 addition & 0 deletions .idea/IXP-Manager.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .phpstorm.meta.php/laravel.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -2618,6 +2618,10 @@
]));


override(\Illuminate\Foundation\Testing\Concerns\InteractsWithContainer::mock(0), map(["" => "@&\Mockery\MockInterface"]));
override(\Illuminate\Foundation\Testing\Concerns\InteractsWithContainer::partialMock(0), map(["" => "@&\Mockery\MockInterface"]));
override(\Illuminate\Foundation\Testing\Concerns\InteractsWithContainer::instance(0), type(1));
override(\Illuminate\Foundation\Testing\Concerns\InteractsWithContainer::spy(0), map(["" => "@&\Mockery\MockInterface"]));
override(\Illuminate\Support\Arr::add(0), type(0));
override(\Illuminate\Support\Arr::except(0), type(0));
override(\Illuminate\Support\Arr::first(0), elementType(0));
Expand Down
12 changes: 6 additions & 6 deletions _ide_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -9627,12 +9627,12 @@ public static function createFromBase($request)
* Clones a request and overrides some of its parameters.
*
* @return static
* @param array $query The GET parameters
* @param array $request The POST parameters
* @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
* @param array $cookies The COOKIE parameters
* @param array $files The FILES parameters
* @param array $server The SERVER parameters
* @param array|null $query The GET parameters
* @param array|null $request The POST parameters
* @param array|null $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
* @param array|null $cookies The COOKIE parameters
* @param array|null $files The FILES parameters
* @param array|null $server The SERVER parameters
* @return static
* @static
*/
Expand Down
29 changes: 28 additions & 1 deletion app/Http/Controllers/RouterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ public function store( StoreRouter $r ): RedirectResponse
return Redirect::to( route( 'router@create' ) )->withInput( $r->all() );
}

Router::create( $r->all() );
$router = Router::create( $r->all() );

$this->checkASN32( $router );

AlertContainer::push( 'Router created.', Alert::SUCCESS );
return Redirect::to( route( "router@list" ) );
}
Expand Down Expand Up @@ -181,6 +184,9 @@ public function edit( Router $router ): View
public function update( StoreRouter $r, Router $router ): RedirectResponse
{
$router->update( $r->all() );

$this->checkASN32( $router );

AlertContainer::push( 'Router updated.', Alert::SUCCESS );
return Redirect::to( route( "router@list" ) );
}
Expand Down Expand Up @@ -214,4 +220,25 @@ public function delete( Router $router): RedirectResponse
AlertContainer::push( 'Router deleted.', Alert::SUCCESS );
return Redirect::to( route( "router@list" ) );
}

/**
* Warning about asn32's with route servers.
*
*
*
* @param Router $router
* @return void
*/
private function checkASN32( Router $router )
{
if( $router->type == Router::TYPE_ROUTE_SERVER && $router->asn > 65535 ) {
AlertContainer::push( 'You are strongly advised to use / request a dedicated 16-bit ASN from your RIR '
. 'for route server use and in our experience, all RIRs understand this and accommodate it. The route server '
. 'configurations will support an asn32 but to our knowledge, this has never been used in production. '
. 'Also, withouot an asn16, you will be unable to offer your members standard community based filtering. ',
Alert::WARNING
);
}
}

}
2 changes: 1 addition & 1 deletion app/Http/Requests/StoreRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function rules(): array
'operating_system_version' => 'nullable|string|max:255',
'mgmt_host' => 'required|string|max:255',
'api_type' => 'required|integer|in:' . implode( ',', array_keys( Router::$API_TYPES ) ),
'api' => ( $this->api_type !== Router::API_TYPE_NONE ? 'url|required|regex:/.*[^\/]$/' : '' ),
'api' => ( $this->api_type != Router::API_TYPE_NONE ? 'url|required|regex:/.*[^\/]$/' : '' ),
'lg_access' => 'integer' . ( $this->api ? '|required|in:' . implode( ',', array_keys( User::$PRIVILEGES_ALL ) ) : '' ),
];
}
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Aggregators/ContactGroupAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @property int $limited_to
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\Contact[] $contacts
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\Contact> $contacts
* @property-read int|null $contacts_count
* @method static Builder|ContactGroupAggregator newModelQuery()
* @method static Builder|ContactGroupAggregator newQuery()
Expand Down
48 changes: 24 additions & 24 deletions app/Models/Aggregators/CustomerAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,58 +76,58 @@
* @property int $peeringdb_oauth
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\AtlasMeasurement[] $AtlasMeasurementsDest
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\AtlasMeasurement> $AtlasMeasurementsDest
* @property-read int|null $atlas_measurements_dest_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\AtlasMeasurement[] $AtlasMeasurementsSource
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\AtlasMeasurement> $AtlasMeasurementsSource
* @property-read int|null $atlas_measurements_source_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\AtlasProbe[] $AtlasProbes
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\AtlasProbe> $AtlasProbes
* @property-read int|null $atlas_probes_count
* @property-read \IXP\Models\CompanyBillingDetail|null $companyBillingDetail
* @property-read \IXP\Models\CompanyRegisteredDetail|null $companyRegisteredDetail
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\ConsoleServerConnection[] $consoleServerConnections
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\ConsoleServerConnection> $consoleServerConnections
* @property-read int|null $console_server_connections_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\Contact[] $contacts
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\Contact> $contacts
* @property-read int|null $contacts_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\CustomerEquipment[] $customerEquipments
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\CustomerEquipment> $customerEquipments
* @property-read int|null $customer_equipments_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\CustomerNote[] $customerNotes
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\CustomerNote> $customerNotes
* @property-read int|null $customer_notes_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\CustomerToUser[] $customerToUser
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\CustomerToUser> $customerToUser
* @property-read int|null $customer_to_user_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\DocstoreCustomerDirectory[] $docstoreCustomerDirectories
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\DocstoreCustomerDirectory> $docstoreCustomerDirectories
* @property-read int|null $docstore_customer_directories_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\DocstoreCustomerFile[] $docstoreCustomerFiles
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\DocstoreCustomerFile> $docstoreCustomerFiles
* @property-read int|null $docstore_customer_files_count
* @property-read \IXP\Models\IrrdbConfig|null $irrdbConfig
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\IrrdbPrefix[] $irrdbPrefixes
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\IrrdbPrefix> $irrdbPrefixes
* @property-read int|null $irrdb_prefixes_count
* @property-read \IXP\Models\Logo|null $logo
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\PatchPanelPortHistory[] $patchPanelPortHistories
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\PatchPanelPortHistory> $patchPanelPortHistories
* @property-read int|null $patch_panel_port_histories_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\PatchPanelPort[] $patchPanelPorts
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\PatchPanelPort> $patchPanelPorts
* @property-read int|null $patch_panel_ports_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\RouteServerFilter[] $peerRouteServerFilters
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\RouteServerFilter> $peerRouteServerFilters
* @property-read int|null $peer_route_server_filters_count
* @property-read \Illuminate\Database\Eloquent\Collection|PeeringManager[] $peers
* @property-read \Illuminate\Database\Eloquent\Collection<int, PeeringManager> $peers
* @property-read int|null $peers_count
* @property-read \Illuminate\Database\Eloquent\Collection|PeeringManager[] $peersWith
* @property-read \Illuminate\Database\Eloquent\Collection<int, PeeringManager> $peersWith
* @property-read int|null $peers_with_count
* @property-read Customer|null $resellerObject
* @property-read \Illuminate\Database\Eloquent\Collection|Customer[] $resoldCustomers
* @property-read \Illuminate\Database\Eloquent\Collection<int, Customer> $resoldCustomers
* @property-read int|null $resold_customers_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\RouteServerFilter[] $routeServerFilters
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\RouteServerFilter> $routeServerFilters
* @property-read int|null $route_server_filters_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\RsPrefix[] $rsPrefixes
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\RsPrefix> $rsPrefixes
* @property-read int|null $rs_prefixes_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\CustomerTag[] $tags
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\CustomerTag> $tags
* @property-read int|null $tags_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\TrafficDaily[] $trafficDailies
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\TrafficDaily> $trafficDailies
* @property-read int|null $traffic_dailies_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\User[] $users
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\User> $users
* @property-read int|null $users_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\VirtualInterface[] $virtualInterfaces
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\VirtualInterface> $virtualInterfaces
* @property-read int|null $virtual_interfaces_count
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\VlanInterface[] $vlanInterfaces
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\VlanInterface> $vlanInterfaces
* @property-read int|null $vlan_interfaces_count
* @method static Builder|Customer active()
* @method static Builder|Customer addressesForVlan(int $vlanid, int $cust, int $protocol)
Expand Down
8 changes: 4 additions & 4 deletions app/Models/Aggregators/PatchPanelPortAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
*
* @property-read \IXP\Models\Customer|null $customer
* @property-read PatchPanelPort|null $duplexMasterPort
* @property-read Collection|PatchPanelPort[] $duplexSlavePorts
* @property-read Collection<int, PatchPanelPort> $duplexSlavePorts
* @property-read int|null $duplex_slave_ports_count
* @property-read \IXP\Models\PatchPanel|null $patchPanel
* @property-read Collection|\IXP\Models\PatchPanelPortFile[] $patchPanelPortFiles
* @property-read Collection<int, \IXP\Models\PatchPanelPortFile> $patchPanelPortFiles
* @property-read int|null $patch_panel_port_files_count
* @property-read Collection|\IXP\Models\PatchPanelPortFile[] $patchPanelPortFilesPublic
* @property-read Collection<int, \IXP\Models\PatchPanelPortFile> $patchPanelPortFilesPublic
* @property-read int|null $patch_panel_port_files_public_count
* @property-read Collection|\IXP\Models\PatchPanelPortHistory[] $patchPanelPortHistories
* @property-read Collection<int, \IXP\Models\PatchPanelPortHistory> $patchPanelPortHistories
* @property-read int|null $patch_panel_port_histories_count
* @property-read \IXP\Models\SwitchPort|null $switchPort
* @method static Builder|PatchPanelPort masterPort()
Expand Down
6 changes: 6 additions & 0 deletions app/Models/Aggregators/RouterAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* IXP\Models\Aggregators\RouterAggregator
*
* @property int $id
* @property int|null $pair_id
* @property int $vlan_id
* @property string $handle
* @property int $protocol
Expand All @@ -50,7 +51,9 @@
* @property bool $bgp_lc
* @property string $template
* @property bool $skip_md5
* @property string|null $last_update_started
* @property \Illuminate\Support\Carbon|null $last_updated
* @property int $pause_updates
* @property bool $rpki
* @property string|null $software_version
* @property string|null $operating_system
Expand All @@ -76,12 +79,15 @@
* @method static Builder|RouterAggregator whereCreatedAt($value)
* @method static Builder|RouterAggregator whereHandle($value)
* @method static Builder|RouterAggregator whereId($value)
* @method static Builder|RouterAggregator whereLastUpdateStarted($value)
* @method static Builder|RouterAggregator whereLastUpdated($value)
* @method static Builder|RouterAggregator whereLgAccess($value)
* @method static Builder|RouterAggregator whereMgmtHost($value)
* @method static Builder|RouterAggregator whereName($value)
* @method static Builder|RouterAggregator whereOperatingSystem($value)
* @method static Builder|RouterAggregator whereOperatingSystemVersion($value)
* @method static Builder|RouterAggregator wherePairId($value)
* @method static Builder|RouterAggregator wherePauseUpdates($value)
* @method static Builder|RouterAggregator wherePeeringIp($value)
* @method static Builder|RouterAggregator whereProtocol($value)
* @method static Builder|RouterAggregator whereQuarantine($value)
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Aggregators/SwitcherAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \IXP\Models\Cabinet|null $cabinet
* @property-read \Illuminate\Database\Eloquent\Collection|\IXP\Models\ConsoleServerConnection[] $consoleServerConnections
* @property-read \Illuminate\Database\Eloquent\Collection<int, \IXP\Models\ConsoleServerConnection> $consoleServerConnections
* @property-read int|null $console_server_connections_count
* @property-read Infrastructure|null $infrastructureModel
* @property-read \Illuminate\Database\Eloquent\Collection|SwitchPort[] $switchPorts
* @property-read \Illuminate\Database\Eloquent\Collection<int, SwitchPort> $switchPorts
* @property-read int|null $switch_ports_count
* @property-read \IXP\Models\Vendor|null $vendor
* @method static Builder|SwitcherAggregator newModelQuery()
Expand Down
Loading

0 comments on commit 699c4fd

Please sign in to comment.