From 401826d586ede5c0f8e17a488799fc6b0f57ac77 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 6 May 2026 21:19:09 +0000 Subject: [PATCH] Regenerate client from commit 71b45d2 of spec repo --- .generator/schemas/v2/openapi.yaml | 96 ++++++++++++ docs/datadog_api_client.v2.model.rst | 28 ++++ examples/v2/key-management/Validate.py | 14 ++ src/datadog_api_client/configuration.py | 1 + .../v2/api/key_management_api.py | 29 ++++ .../v2/model/validate_v2_attributes.py | 46 ++++++ .../v2/model/validate_v2_data.py | 54 +++++++ .../v2/model/validate_v2_response.py | 40 +++++ .../v2/model/validate_v2_type.py | 35 +++++ src/datadog_api_client/v2/models/__init__.py | 8 + tests/v2/features/key_management.feature | 146 ++++++++++++------ tests/v2/features/undo.json | 6 + 12 files changed, 456 insertions(+), 47 deletions(-) create mode 100644 examples/v2/key-management/Validate.py create mode 100644 src/datadog_api_client/v2/model/validate_v2_attributes.py create mode 100644 src/datadog_api_client/v2/model/validate_v2_data.py create mode 100644 src/datadog_api_client/v2/model/validate_v2_response.py create mode 100644 src/datadog_api_client/v2/model/validate_v2_type.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2dc5dce2c0..0cd9056664 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -81946,6 +81946,61 @@ components: description: The title of the event. example: "The event title" type: string + ValidateV2Attributes: + description: Attributes of the API key validation response. + properties: + api_key_id: + description: The UUID of the API key. + example: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6" + type: string + api_key_scopes: + description: List of scope names associated with the API key. + example: + - "remote_config_read" + items: + type: string + type: array + valid: + description: Whether the API key is valid. + example: true + type: boolean + required: + - valid + - api_key_scopes + - api_key_id + type: object + ValidateV2Data: + description: Data object containing the API key validation result. + properties: + attributes: + $ref: "#/components/schemas/ValidateV2Attributes" + id: + description: The UUID of the organization associated with the API key. + example: "550e8400-e29b-41d4-a716-446655440000" + type: string + type: + $ref: "#/components/schemas/ValidateV2Type" + required: + - id + - type + - attributes + type: object + ValidateV2Response: + description: Response for the API key validation endpoint. + properties: + data: + $ref: "#/components/schemas/ValidateV2Data" + required: + - data + type: object + ValidateV2Type: + description: Resource type for the API key validation response. + enum: + - validate_v2 + example: validate_v2 + type: string + x-enum-varnames: + - ValidateV2 ValidationError: description: Represents a single validation error, including a human-readable title and metadata. properties: @@ -144508,6 +144563,47 @@ paths: operator: OR permissions: - teams_read + /api/v2/validate: + get: + description: Check if the API key is valid. Returns the organization UUID, API key ID, and associated scopes. + operationId: Validate + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key_id: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6" + api_key_scopes: + - "remote_config_read" + valid: true + id: "550e8400-e29b-41d4-a716-446655440000" + type: "validate_v2" + schema: + $ref: "#/components/schemas/ValidateV2Response" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + summary: Validate API key + tags: + - Key Management + "x-permission": + operator: OPEN + permissions: [] + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/widgets/{experience_type}: get: description: |- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 42c68a74f1..39ff84fde4 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -36334,6 +36334,34 @@ datadog\_api\_client.v2.model.v2\_event\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.validate\_v2\_attributes module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.validate_v2_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.validate\_v2\_data module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.validate_v2_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.validate\_v2\_response module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.validate_v2_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.validate\_v2\_type module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.validate_v2_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.validation\_error module ------------------------------------------------------ diff --git a/examples/v2/key-management/Validate.py b/examples/v2/key-management/Validate.py new file mode 100644 index 0000000000..c1c678c3ac --- /dev/null +++ b/examples/v2/key-management/Validate.py @@ -0,0 +1,14 @@ +""" +Validate API key returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.key_management_api import KeyManagementApi + +configuration = Configuration() +configuration.unstable_operations["validate"] = True +with ApiClient(configuration) as api_client: + api_instance = KeyManagementApi(api_client) + response = api_instance.validate() + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 6e38061ac6..4744dd1e98 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -295,6 +295,7 @@ def __init__( "v2.update_llm_obs_experiment": False, "v2.update_llm_obs_project": False, "v2.anonymize_users": False, + "v2.validate": False, "v2.create_open_api": False, "v2.delete_open_api": False, "v2.get_open_api": False, diff --git a/src/datadog_api_client/v2/api/key_management_api.py b/src/datadog_api_client/v2/api/key_management_api.py index c47153cb4f..40ed341758 100644 --- a/src/datadog_api_client/v2/api/key_management_api.py +++ b/src/datadog_api_client/v2/api/key_management_api.py @@ -27,6 +27,7 @@ from datadog_api_client.v2.model.personal_access_token_create_request import PersonalAccessTokenCreateRequest from datadog_api_client.v2.model.personal_access_token_response import PersonalAccessTokenResponse from datadog_api_client.v2.model.personal_access_token_update_request import PersonalAccessTokenUpdateRequest +from datadog_api_client.v2.model.validate_v2_response import ValidateV2Response class KeyManagementApi: @@ -622,6 +623,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._validate_endpoint = _Endpoint( + settings={ + "response_type": (ValidateV2Response,), + "auth": ["apiKeyAuth"], + "endpoint_path": "/api/v2/validate", + "operation_id": "validate", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + def create_api_key( self, body: APIKeyCreateRequest, @@ -1145,3 +1162,15 @@ def update_personal_access_token( kwargs["body"] = body return self._update_personal_access_token_endpoint.call_with_http_info(**kwargs) + + def validate( + self, + ) -> ValidateV2Response: + """Validate API key. + + Check if the API key is valid. Returns the organization UUID, API key ID, and associated scopes. + + :rtype: ValidateV2Response + """ + kwargs: Dict[str, Any] = {} + return self._validate_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/validate_v2_attributes.py b/src/datadog_api_client/v2/model/validate_v2_attributes.py new file mode 100644 index 0000000000..3fa24625b1 --- /dev/null +++ b/src/datadog_api_client/v2/model/validate_v2_attributes.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ValidateV2Attributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "api_key_id": (str,), + "api_key_scopes": ([str],), + "valid": (bool,), + } + + attribute_map = { + "api_key_id": "api_key_id", + "api_key_scopes": "api_key_scopes", + "valid": "valid", + } + + def __init__(self_, api_key_id: str, api_key_scopes: List[str], valid: bool, **kwargs): + """ + Attributes of the API key validation response. + + :param api_key_id: The UUID of the API key. + :type api_key_id: str + + :param api_key_scopes: List of scope names associated with the API key. + :type api_key_scopes: [str] + + :param valid: Whether the API key is valid. + :type valid: bool + """ + super().__init__(kwargs) + + self_.api_key_id = api_key_id + self_.api_key_scopes = api_key_scopes + self_.valid = valid diff --git a/src/datadog_api_client/v2/model/validate_v2_data.py b/src/datadog_api_client/v2/model/validate_v2_data.py new file mode 100644 index 0000000000..c34c7bff8e --- /dev/null +++ b/src/datadog_api_client/v2/model/validate_v2_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.validate_v2_attributes import ValidateV2Attributes + from datadog_api_client.v2.model.validate_v2_type import ValidateV2Type + + +class ValidateV2Data(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.validate_v2_attributes import ValidateV2Attributes + from datadog_api_client.v2.model.validate_v2_type import ValidateV2Type + + return { + "attributes": (ValidateV2Attributes,), + "id": (str,), + "type": (ValidateV2Type,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ValidateV2Attributes, id: str, type: ValidateV2Type, **kwargs): + """ + Data object containing the API key validation result. + + :param attributes: Attributes of the API key validation response. + :type attributes: ValidateV2Attributes + + :param id: The UUID of the organization associated with the API key. + :type id: str + + :param type: Resource type for the API key validation response. + :type type: ValidateV2Type + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/validate_v2_response.py b/src/datadog_api_client/v2/model/validate_v2_response.py new file mode 100644 index 0000000000..9a0abe87d6 --- /dev/null +++ b/src/datadog_api_client/v2/model/validate_v2_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.validate_v2_data import ValidateV2Data + + +class ValidateV2Response(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.validate_v2_data import ValidateV2Data + + return { + "data": (ValidateV2Data,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ValidateV2Data, **kwargs): + """ + Response for the API key validation endpoint. + + :param data: Data object containing the API key validation result. + :type data: ValidateV2Data + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/validate_v2_type.py b/src/datadog_api_client/v2/model/validate_v2_type.py new file mode 100644 index 0000000000..11d2dce6cd --- /dev/null +++ b/src/datadog_api_client/v2/model/validate_v2_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ValidateV2Type(ModelSimple): + """ + Resource type for the API key validation response. + + :param value: If omitted defaults to "validate_v2". Must be one of ["validate_v2"]. + :type value: str + """ + + allowed_values = { + "validate_v2", + } + ValidateV2: ClassVar["ValidateV2Type"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ValidateV2Type.ValidateV2 = ValidateV2Type("validate_v2") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 576e9666c6..71d33be0d1 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -7407,6 +7407,10 @@ from datadog_api_client.v2.model.v2_event_attributes import V2EventAttributes from datadog_api_client.v2.model.v2_event_attributes_attributes import V2EventAttributesAttributes from datadog_api_client.v2.model.v2_event_response import V2EventResponse +from datadog_api_client.v2.model.validate_v2_attributes import ValidateV2Attributes +from datadog_api_client.v2.model.validate_v2_data import ValidateV2Data +from datadog_api_client.v2.model.validate_v2_response import ValidateV2Response +from datadog_api_client.v2.model.validate_v2_type import ValidateV2Type from datadog_api_client.v2.model.validation_error import ValidationError from datadog_api_client.v2.model.validation_error_meta import ValidationErrorMeta from datadog_api_client.v2.model.validation_response import ValidationResponse @@ -12701,6 +12705,10 @@ "V2EventAttributes", "V2EventAttributesAttributes", "V2EventResponse", + "ValidateV2Attributes", + "ValidateV2Data", + "ValidateV2Response", + "ValidateV2Type", "ValidationError", "ValidationErrorMeta", "ValidationResponse", diff --git a/tests/v2/features/key_management.feature b/tests/v2/features/key_management.feature index 365c53ed7c..3be38cccd5 100644 --- a/tests/v2/features/key_management.feature +++ b/tests/v2/features/key_management.feature @@ -9,19 +9,20 @@ Feature: Key Management Background: Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system And an instance of "KeyManagement" API @generated @skip @team:DataDog/credentials-management Scenario: Create a personal access token returns "Bad Request" response - Given new "CreatePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "CreatePersonalAccessToken" request And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "My Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Create a personal access token returns "Created" response - Given new "CreatePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "CreatePersonalAccessToken" request And body with value {"data": {"type": "personal_access_tokens", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read"], "expires_at": "{{ timeISO('now+365d') }}"}}} When the request is sent Then the response status is 201 Created @@ -32,14 +33,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Create an API key returns "Bad Request" response - Given new "CreateAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateAPIKey" request And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "type": "api_keys"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Create an API key returns "Created" response - Given new "CreateAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateAPIKey" request And body with value {"data": {"type": "api_keys", "attributes": {"name": "{{ unique }}"}}} When the request is sent Then the response status is 201 Created @@ -48,7 +51,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Create an Application key with scopes for current user returns "Created" response - Given new "CreateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateCurrentUserApplicationKey" request And body with value {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}}} When the request is sent Then the response status is 201 Created @@ -57,14 +61,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Create an application key for current user returns "Bad Request" response - Given new "CreateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateCurrentUserApplicationKey" request And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "type": "application_keys"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Create an application key for current user returns "Created" response - Given new "CreateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateCurrentUserApplicationKey" request And body with value {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}"}}} When the request is sent Then the response status is 201 Created @@ -73,7 +79,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Delete an API key returns "No Content" response - Given there is a valid "api_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "api_key" in the system And new "DeleteAPIKey" request And request contains "api_key_id" parameter from "api_key.data.id" When the request is sent @@ -81,14 +88,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Delete an API key returns "Not Found" response - Given new "DeleteAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "DeleteAPIKey" request And request contains "api_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Delete an application key owned by current user returns "No Content" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "DeleteCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -96,14 +105,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Delete an application key owned by current user returns "Not Found" response - Given new "DeleteCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "DeleteCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Delete an application key returns "No Content" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "DeleteApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -111,14 +122,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Delete an application key returns "Not Found" response - Given new "DeleteApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "DeleteApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/credentials-management Scenario: Edit an API key returns "Bad Request" response - Given new "UpdateAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateAPIKey" request And request contains "api_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "api_keys"}} When the request is sent @@ -126,7 +139,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an API key returns "Not Found" response - Given new "UpdateAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateAPIKey" request And request contains "api_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "api_keys"}} When the request is sent @@ -134,7 +148,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Edit an API key returns "OK" response - Given there is a valid "api_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "api_key" in the system And new "UpdateAPIKey" request And request contains "api_key_id" parameter from "api_key.data.id" And body with value {"data": {"type": "api_keys", "id": "{{ api_key.data.id }}", "attributes": {"name": "{{ unique }}"}}} @@ -146,7 +161,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key owned by current user returns "Bad Request" response - Given new "UpdateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -154,7 +170,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key owned by current user returns "Not Found" response - Given new "UpdateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -162,7 +179,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Edit an application key owned by current user returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "UpdateCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" And body with value {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ application_key.data.attributes.name }}-updated"}}} @@ -174,7 +192,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key returns "Bad Request" response - Given new "UpdateApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -182,7 +201,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key returns "Not Found" response - Given new "UpdateApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -190,7 +210,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Edit an application key returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "UpdateApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" And body with value {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ application_key.data.attributes.name }}-updated"}}} @@ -202,14 +223,16 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Get API key returns "Not Found" response - Given new "GetAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "GetAPIKey" request And request contains "api_key_id" parameter with value "invalidId" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get API key returns "OK" response - Given there is a valid "api_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "api_key" in the system And new "GetAPIKey" request And request contains "api_key_id" parameter from "api_key.data.id" When the request is sent @@ -220,14 +243,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get a personal access token returns "Not Found" response - Given new "GetPersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "GetPersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get a personal access token returns "OK" response - Given there is a valid "personal_access_token" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "personal_access_token" in the system And new "GetPersonalAccessToken" request And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent @@ -237,13 +262,15 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all API keys returns "Bad Request" response - Given new "ListAPIKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListAPIKeys" request When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Get all API keys returns "OK" response - Given there is a valid "api_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "api_key" in the system And new "ListAPIKeys" request And request contains "filter" parameter from "api_key.data.attributes.name" When the request is sent @@ -253,19 +280,22 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "Bad Request" response - Given new "ListCurrentUserApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListCurrentUserApplicationKeys" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "Not Found" response - Given new "ListCurrentUserApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListCurrentUserApplicationKeys" request When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "OK" response - Given new "ListCurrentUserApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListCurrentUserApplicationKeys" request When the request is sent Then the response status is 200 OK And the response "data[0].type" is equal to "application_keys" @@ -273,19 +303,22 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys returns "Bad Request" response - Given new "ListApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListApplicationKeys" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys returns "Not Found" response - Given new "ListApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListApplicationKeys" request When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get all application keys returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "ListApplicationKeys" request When the request is sent Then the response status is 200 OK @@ -294,13 +327,15 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all personal access tokens returns "Bad Request" response - Given new "ListPersonalAccessTokens" request + Given a valid "appKeyAuth" key in the system + And new "ListPersonalAccessTokens" request When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Get all personal access tokens returns "OK" response - Given there is a valid "personal_access_token" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "personal_access_token" in the system And new "ListPersonalAccessTokens" request When the request is sent Then the response status is 200 OK @@ -308,21 +343,24 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get an application key returns "Bad Request" response - Given new "GetApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "GetApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Get an application key returns "Not Found" response - Given new "GetApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "GetApplicationKey" request And request contains "app_key_id" parameter with value "invalidId" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get an application key returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "GetApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -333,14 +371,16 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Get one application key owned by current user returns "Not Found" response - Given new "GetCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "GetCurrentUserApplicationKey" request And request contains "app_key_id" parameter with value "incorrectId" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get one application key owned by current user returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "GetCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -353,7 +393,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Revoke a personal access token returns "No Content" response - Given there is a valid "personal_access_token" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "personal_access_token" in the system And new "RevokePersonalAccessToken" request And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent @@ -361,14 +402,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Revoke a personal access token returns "Not Found" response - Given new "RevokePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "RevokePersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Bad Request" response - Given new "UpdatePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "UpdatePersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent @@ -376,7 +419,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Not Found" response - Given new "UpdatePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "UpdatePersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent @@ -384,10 +428,18 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Update a personal access token returns "OK" response - Given there is a valid "personal_access_token" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "personal_access_token" in the system And new "UpdatePersonalAccessToken" request And request contains "pat_id" parameter from "personal_access_token.data.id" And body with value {"data": {"type": "personal_access_tokens", "id": "{{ personal_access_token.data.id }}", "attributes": {"name": "{{ unique }}-updated"}}} When the request is sent Then the response status is 200 OK And the response "data.attributes.name" is equal to "{{ unique }}-updated" + + @generated @skip @team:DataDog/identity-platform + Scenario: Validate API key returns "OK" response + Given operation "Validate" enabled + And new "Validate" request + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index d5a8323e27..9882d3a1b7 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -7140,6 +7140,12 @@ "type": "safe" } }, + "Validate": { + "tag": "Key Management", + "undo": { + "type": "safe" + } + }, "SearchWidgets": { "tag": "Widgets", "undo": {