Skip to content

Commit

Permalink
critical patch to only allow admin to set registry settings
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Jul 19, 2024
1 parent bf3e355 commit 6035b1c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/registry-bridge",
"version": "0.0.5",
"version": "0.0.6",
"description": "Internal Bridge between Fleetbase API and Extensions Registry",
"keywords": [
"fleetbase-extension",
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Registry Bridge",
"version": "0.0.5",
"version": "0.0.6",
"description": "Internal Bridge between Fleetbase API and Extensions Registry",
"repository": "https://github.com/fleetbase/registry-bridge",
"license": "AGPL-3.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/registry-bridge-engine",
"version": "0.0.5",
"version": "0.0.6",
"description": "Internal Bridge between Fleetbase API and Extensions Registry",
"fleetbase": {
"route": "extensions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Fleetbase\RegistryBridge\Http\Controllers\Internal\v1;

use Fleetbase\Exceptions\FleetbaseRequestValidationException;
use Fleetbase\Http\Requests\AdminRequest;
use Fleetbase\Models\Setting;
use Fleetbase\RegistryBridge\Http\Controllers\RegistryBridgeController;
use Fleetbase\RegistryBridge\Http\Requests\CreateRegistryExtensionRequest;
Expand Down Expand Up @@ -262,9 +263,11 @@ public function downloadBundle(RegistryExtensionActionRequest $request)
* This method fetches the current registry host and token from the configuration
* settings or environment variables and returns them in a JSON response.
*
* @param AdminRequest $request the incoming HTTP request containing the new host and token
*
* @return \Illuminate\Http\JsonResponse a JSON response containing the registry host and token
*/
public function getConfig()
public function getConfig(AdminRequest $request)
{
$registryHost = config('registry-bridge.registry.host', env('REGISTRY_HOST', 'https://registry.fleetbase.io'));
$registryToken = config('registry-bridge.registry.token', env('REGISTRY_TOKEN'));
Expand All @@ -282,11 +285,11 @@ public function getConfig()
* If no input is provided, it uses the current configuration values or environment variables.
* The updated configuration is then saved in the settings and returned in a JSON response.
*
* @param Request $request the incoming HTTP request containing the new host and token
* @param AdminRequest $request the incoming HTTP request containing the new host and token
*
* @return \Illuminate\Http\JsonResponse a JSON response containing the updated registry host and token
*/
public function saveConfig(Request $request)
public function saveConfig(AdminRequest $request)
{
$currentRegistryHost = config('registry-bridge.registry.host', env('REGISTRY_HOST', 'https://registry.fleetbase.io'));
$currentRegistryToken = config('registry-bridge.registry.token', env('REGISTRY_TOKEN'));
Expand Down

0 comments on commit 6035b1c

Please sign in to comment.