Skip to content

Commit

Permalink
Add support for documenting auth bearer token (#2311)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
4 people authored Dec 11, 2024
1 parent 1e76fe1 commit eaf610e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
6 changes: 6 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
Expand Down
6 changes: 6 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
Expand Down
3 changes: 2 additions & 1 deletion .generator/src/generator/templates/configuration.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"] = {
Expand Down

0 comments on commit eaf610e

Please sign in to comment.