Skip to content

Commit 2441202

Browse files
api-clients-generation-pipeline[bot]skarimoci.datadog-api-spec
authored
Sync OpenAPI specification for (spec-v1-dashboard_sharing.yaml) (#2711)
* 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 b2ea1b4 commit 2441202

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:17:06.657"
2+
"spec_repo_commit": "0becaa3",
3+
"generated": "2025-07-17 13:13:12.456"
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
@@ -58,6 +58,7 @@ def cli(specs, output):
5858
env.globals["type_to_python"] = openapi.type_to_python
5959
env.globals["get_default"] = openapi.get_default
6060
env.globals["get_type_at_path"] = openapi.get_type_at_path
61+
env.globals["get_security_names"] = openapi.get_security_names
6162

6263
api_j2 = env.get_template("api.j2")
6364
apis_j2 = env.get_template("apis.j2")

.generator/src/generator/openapi.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,3 +649,15 @@ def get_type_at_path(operation, attribute_path):
649649
for attr in attribute_path.split("."):
650650
content = content["properties"][attr]
651651
return get_type_for_items(content)
652+
653+
654+
def get_security_names(security):
655+
if security is None:
656+
return []
657+
658+
auth_names = set()
659+
for auth in security:
660+
for key in auth.keys() if isinstance(auth, dict) else [auth]:
661+
auth_names.add(key)
662+
663+
return list(auth_names)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class {{ classname }}:
3939
"response_type": {% if returnType %}({{ returnType }},){% else %}None{% endif %},
4040
{%- set authMethods = operation.security if "security" in operation else openapi.security %}
4141
"auth": [
42-
{%- for auth in (authMethods or []) %}"{{ '", "'.join(auth.keys()) }}"{%- if not loop.last %}, {% endif %}{%- endfor %}],
42+
{%- for auth in get_security_names(authMethods)|sort %}"{{ auth }}"{%- if not loop.last %}, {% endif %}{%- endfor %}],
4343
"endpoint_path": "{{ path }}",
4444
"operation_id": "{{ operation.operationId|safe_snake_case }}",
4545
"http_method": "{{httpMethod}}",

0 commit comments

Comments
 (0)