mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 12:31:54 +00:00
Update Lighthouse show key response
This commit is contained in:
@@ -5593,7 +5593,7 @@ class TestLighthouseConfigViewSet:
|
||||
reverse("lighthouseconfig-show-key", kwargs={"pk": config_id})
|
||||
)
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.json()["data"]["api_key"] == expected_api_key
|
||||
assert response.json()["data"]["attributes"]["api_key"] == expected_api_key
|
||||
|
||||
def test_lighthouse_config_filters(
|
||||
self, authenticated_client, lighthouse_config_fixture
|
||||
|
||||
@@ -13,9 +13,7 @@ from config.settings.social_login import (
|
||||
GITHUB_OAUTH_CALLBACK_URL,
|
||||
GOOGLE_OAUTH_CALLBACK_URL,
|
||||
)
|
||||
from cryptography.fernet import Fernet
|
||||
from dj_rest_auth.registration.views import SocialLoginView
|
||||
from django.conf import settings
|
||||
from django.conf import settings as django_settings
|
||||
from django.contrib.postgres.aggregates import ArrayAgg
|
||||
from django.contrib.postgres.search import SearchQuery
|
||||
@@ -2884,7 +2882,10 @@ class LighthouseConfigViewSet(BaseRLSViewSet):
|
||||
status=status.HTTP_400_BAD_REQUEST,
|
||||
)
|
||||
return Response(
|
||||
{"api_key": decrypted_key},
|
||||
data={
|
||||
"type": "lighthouse-config",
|
||||
"attributes": {"api_key": decrypted_key},
|
||||
},
|
||||
status=status.HTTP_200_OK,
|
||||
)
|
||||
except Exception as e:
|
||||
|
||||
@@ -41,7 +41,7 @@ export const getAIKey = async (): Promise<string> => {
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
return data.data.api_key;
|
||||
return data.data.attributes.api_key;
|
||||
};
|
||||
|
||||
export const createLighthouseConfig = async (config: {
|
||||
|
||||
Reference in New Issue
Block a user