From eaf610efd6ce5214d7901de47dffc69eaf316d29 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:57:43 -0500 Subject: [PATCH] Add support for documenting auth bearer token (#2311) * disable bearer auth * Regenerate client from commit 7a9d0200 of spec repo --------- Co-authored-by: Sherzod Karimov Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec Co-authored-by: skarimo <40482491+skarimo@users.noreply.github.com> --- .apigentools-info | 8 ++++---- .generator/schemas/v1/openapi.yaml | 6 ++++++ .generator/schemas/v2/openapi.yaml | 6 ++++++ .generator/src/generator/templates/configuration.j2 | 3 ++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 1ceba2bc9a..202a8fc6d9 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-10 21:05:11.810192", - "spec_repo_commit": "1c4c91d4" + "regenerated": "2024-12-11 14:25:06.215881", + "spec_repo_commit": "7a9d0200" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-10 21:05:11.828443", - "spec_repo_commit": "1c4c91d4" + "regenerated": "2024-12-11 14:25:06.233821", + "spec_repo_commit": "7a9d0200" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index cd2b926b19..6537e03408 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -23427,6 +23427,12 @@ components: type: apiKey x-auth-id-alias: appKeyAuth x-env-name: DD_APP_KEY + bearerAuth: + in: header + name: Authorization + scheme: bearer + type: http + x-env-name: DD_BEARER_TOKEN info: contact: email: support@datadoghq.com diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d765d01bf0..8b55ec7ed3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -27751,6 +27751,12 @@ components: name: DD-APPLICATION-KEY type: apiKey x-env-name: DD_APP_KEY + bearerAuth: + in: header + name: Authorization + scheme: bearer + type: http + x-env-name: DD_BEARER_TOKEN info: contact: email: support@datadoghq.com diff --git a/.generator/src/generator/templates/configuration.j2 b/.generator/src/generator/templates/configuration.j2 index e1b44cfcf1..c261378471 100644 --- a/.generator/src/generator/templates/configuration.j2 +++ b/.generator/src/generator/templates/configuration.j2 @@ -518,7 +518,7 @@ class Configuration: "key": "Authorization", "value": self.get_basic_auth_token() } -{%- elif schema.type == "http" and schema.scheme == "bearer" %} +{# {%- elif schema.type == "http" and schema.scheme == "bearer" %} if self.access_token is not None: auth["{{name}}"] = { "type": "bearer", @@ -529,6 +529,7 @@ class Configuration: "key": "Authorization", "value": "Bearer " + self.access_token } +#} {%- elif schema.type == "oauth2" %} if self.access_token is not None: auth["AuthZ"] = {