Skip to content

Commit eaf610e

Browse files
api-clients-generation-pipeline[bot]skarimoci.datadog-api-spec
authored
Add support for documenting auth bearer token (#2311)
* disable bearer auth * Regenerate client from commit 7a9d0200 of spec repo --------- Co-authored-by: Sherzod Karimov <[email protected]> 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 <[email protected]> Co-authored-by: skarimo <[email protected]>
1 parent 1e76fe1 commit eaf610e

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-12-10 21:05:11.810192",
8-
"spec_repo_commit": "1c4c91d4"
7+
"regenerated": "2024-12-11 14:25:06.215881",
8+
"spec_repo_commit": "7a9d0200"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-10 21:05:11.828443",
13-
"spec_repo_commit": "1c4c91d4"
12+
"regenerated": "2024-12-11 14:25:06.233821",
13+
"spec_repo_commit": "7a9d0200"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23427,6 +23427,12 @@ components:
2342723427
type: apiKey
2342823428
x-auth-id-alias: appKeyAuth
2342923429
x-env-name: DD_APP_KEY
23430+
bearerAuth:
23431+
in: header
23432+
name: Authorization
23433+
scheme: bearer
23434+
type: http
23435+
x-env-name: DD_BEARER_TOKEN
2343023436
info:
2343123437
contact:
2343223438

.generator/schemas/v2/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27751,6 +27751,12 @@ components:
2775127751
name: DD-APPLICATION-KEY
2775227752
type: apiKey
2775327753
x-env-name: DD_APP_KEY
27754+
bearerAuth:
27755+
in: header
27756+
name: Authorization
27757+
scheme: bearer
27758+
type: http
27759+
x-env-name: DD_BEARER_TOKEN
2775427760
info:
2775527761
contact:
2775627762

.generator/src/generator/templates/configuration.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class Configuration:
518518
"key": "Authorization",
519519
"value": self.get_basic_auth_token()
520520
}
521-
{%- elif schema.type == "http" and schema.scheme == "bearer" %}
521+
{# {%- elif schema.type == "http" and schema.scheme == "bearer" %}
522522
if self.access_token is not None:
523523
auth["{{name}}"] = {
524524
"type": "bearer",
@@ -529,6 +529,7 @@ class Configuration:
529529
"key": "Authorization",
530530
"value": "Bearer " + self.access_token
531531
}
532+
#}
532533
{%- elif schema.type == "oauth2" %}
533534
if self.access_token is not None:
534535
auth["AuthZ"] = {

0 commit comments

Comments
 (0)