diff --git a/.apigentools-info b/.apigentools-info index b982b327dbc..0021a872438 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:03.161482", - "spec_repo_commit": "1c4c91d4" + "regenerated": "2024-12-11 14:25:08.994300", + "spec_repo_commit": "7a9d0200" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-10 21:05:03.180223", - "spec_repo_commit": "1c4c91d4" + "regenerated": "2024-12-11 14:25:09.012979", + "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 cd2b926b198..6537e03408d 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 d765d01bf04..8b55ec7ed38 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/ApiClient.j2 b/.generator/src/generator/templates/ApiClient.j2 index b104f9f6abc..9a8c33b0476 100644 --- a/.generator/src/generator/templates/ApiClient.j2 +++ b/.generator/src/generator/templates/ApiClient.j2 @@ -261,16 +261,19 @@ public class ApiClient { authentications = new HashMap(); Authentication auth = null; {%- for name, schema in specs.v2.components.securitySchemes.items() %} + {%- if schema.type == "oauth2" %} if (authMap != null) { auth = authMap.get("{{ name }}"); } - {%- if schema.type == "oauth2" %} if (auth instanceof OAuth) { authentications.put("{{ name }}", auth); } else { authentications.put("{{ name }}", new OAuth(basePath, "{{ schema.flows.authorizationCode.tokenUrl }}")); } - {%- else %} + {%- elif schema.type == "apiKey" %} + if (authMap != null) { + auth = authMap.get("{{ name }}"); + } if (auth instanceof {{ schema.type|upperfirst ~ "Auth" }}) { authentications.put("{{ name }}", auth); } else {