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

critical patch to only allow admin to set registry settings #5

Merged
merged 1 commit into from
Jul 19, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading