Skip to content

Commit 94c276d

Browse files
api-clients-generation-pipeline[bot]skarimoci.datadog-api-spec
authored
Sync OpenAPI specification for (spec-v1-dashboard_sharing.yaml) (#2546)
* handle multiple auth * Regenerate client from commit 0becaa3 of spec repo --------- Co-authored-by: skarimo <[email protected]> Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent e795920 commit 94c276d

File tree

5 files changed

+40
-9
lines changed

5 files changed

+40
-9
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "671ba51",
3-
"generated": "2025-07-16 20:16:53.066"
2+
"spec_repo_commit": "0becaa3",
3+
"generated": "2025-07-17 13:13:07.458"
44
}

.generator/schemas/v1/openapi.yaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25773,6 +25773,10 @@ paths:
2577325773
appKeyAuth: []
2577425774
- AuthZ:
2577525775
- dashboards_public_share
25776+
- AuthZ:
25777+
- dashboards_embed_share
25778+
- AuthZ:
25779+
- dashboards_invite_share
2577625780
summary: Create a shared dashboard
2577725781
tags:
2577825782
- Dashboards
@@ -25781,6 +25785,8 @@ paths:
2578125785
operator: OR
2578225786
permissions:
2578325787
- dashboards_public_share
25788+
- dashboards_embed_share
25789+
- dashboards_invite_share
2578425790
/api/v1/dashboard/public/{token}:
2578525791
delete:
2578625792
description: Revoke the public URL for a dashboard (rendering it private) associated
@@ -25819,13 +25825,19 @@ paths:
2581925825
appKeyAuth: []
2582025826
- AuthZ:
2582125827
- dashboards_public_share
25828+
- AuthZ:
25829+
- dashboards_embed_share
25830+
- AuthZ:
25831+
- dashboards_invite_share
2582225832
summary: Revoke a shared dashboard URL
2582325833
tags:
2582425834
- Dashboards
2582525835
x-permission:
2582625836
operator: OR
2582725837
permissions:
2582825838
- dashboards_public_share
25839+
- dashboards_embed_share
25840+
- dashboards_invite_share
2582925841
get:
2583025842
description: Fetch an existing shared dashboard's sharing metadata associated
2583125843
with the specified token.
@@ -25936,6 +25948,10 @@ paths:
2593625948
appKeyAuth: []
2593725949
- AuthZ:
2593825950
- dashboards_public_share
25951+
- AuthZ:
25952+
- dashboards_embed_share
25953+
- AuthZ:
25954+
- dashboards_invite_share
2593925955
summary: Update a shared dashboard
2594025956
tags:
2594125957
- Dashboards
@@ -25944,6 +25960,8 @@ paths:
2594425960
operator: OR
2594525961
permissions:
2594625962
- dashboards_public_share
25963+
- dashboards_embed_share
25964+
- dashboards_invite_share
2594725965
/api/v1/dashboard/public/{token}/invitation:
2594825966
delete:
2594925967
description: Revoke previously sent invitation emails and active sessions used
@@ -25991,15 +26009,15 @@ paths:
2599126009
- apiKeyAuth: []
2599226010
appKeyAuth: []
2599326011
- AuthZ:
25994-
- dashboards_public_share
26012+
- dashboards_invite_share
2599526013
summary: Revoke shared dashboard invitations
2599626014
tags:
2599726015
- Dashboards
2599826016
x-codegen-request-body-name: body
2599926017
x-permission:
2600026018
operator: OR
2600126019
permissions:
26002-
- dashboards_public_share
26020+
- dashboards_invite_share
2600326021
get:
2600426022
description: Describe the invitations that exist for the given shared dashboard
2600526023
(paginated).
@@ -26050,14 +26068,14 @@ paths:
2605026068
- apiKeyAuth: []
2605126069
appKeyAuth: []
2605226070
- AuthZ:
26053-
- dashboards_public_share
26071+
- dashboards_invite_share
2605426072
summary: Get all invitations for a shared dashboard
2605526073
tags:
2605626074
- Dashboards
2605726075
x-permission:
2605826076
operator: OR
2605926077
permissions:
26060-
- dashboards_public_share
26078+
- dashboards_invite_share
2606126079
post:
2606226080
description: Send emails to specified email addresses containing links to access
2606326081
a given authenticated shared dashboard. Email addresses must already belong
@@ -26115,15 +26133,15 @@ paths:
2611526133
- apiKeyAuth: []
2611626134
appKeyAuth: []
2611726135
- AuthZ:
26118-
- dashboards_public_share
26136+
- dashboards_invite_share
2611926137
summary: Send shared dashboard invitation email
2612026138
tags:
2612126139
- Dashboards
2612226140
x-codegen-request-body-name: body
2612326141
x-permission:
2612426142
operator: OR
2612526143
permissions:
26126-
- dashboards_public_share
26144+
- dashboards_invite_share
2612726145
/api/v1/dashboard/{dashboard_id}:
2612826146
delete:
2612926147
description: Delete a dashboard using the specified ID.

.generator/src/generator/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def cli(specs, output):
5151
env.globals["get_default"] = openapi.get_default
5252
env.globals["get_container"] = openapi.get_container
5353
env.globals["get_type_at_path"] = openapi.get_type_at_path
54+
env.globals["get_security_names"] = openapi.get_security_names
5455

5556
api_j2 = env.get_template("api.j2")
5657
model_j2 = env.get_template("model.j2")

.generator/src/generator/openapi.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,3 +502,15 @@ def get_type_at_path(operation, attribute_path):
502502
for attr in attribute_path.split("."):
503503
content = content["properties"][attr]
504504
return get_name(content.get("items"))
505+
506+
507+
def get_security_names(security):
508+
if security is None:
509+
return []
510+
511+
auth_names = set()
512+
for auth in security:
513+
for key in auth.keys() if isinstance(auth, dict) else [auth]:
514+
auth_names.add(key)
515+
516+
return list(auth_names)

.generator/src/generator/templates/api.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ module {{ module_name }}::{{ version|upper }}
195195

196196
# auth_names
197197
{%- set authMethods = operation.security if "security" in operation else openapi.security %}
198-
auth_names = opts[:debug_auth_names] || [{% for auth in (authMethods or []) %}:{{ ", :".join(auth.keys()) }}{%- if not loop.last %}, {% endif %}{% endfor %}]
198+
auth_names = opts[:debug_auth_names] || [{% for auth in get_security_names(authMethods)|sort %}:{{ auth }}{%- if not loop.last %}, {% endif %}{% endfor %}]
199199

200200
new_options = opts.merge(
201201
:operation => :{{ operation.operationId|snake_case }},

0 commit comments

Comments
 (0)