Skip to content

Commit 6ebb928

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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+422
-386
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:18:04.073"
2+
"spec_repo_commit": "0becaa3",
3+
"generated": "2025-07-17 13:14:04.846"
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
@@ -62,6 +62,7 @@ def cli(specs, output):
6262
env.globals["get_container"] = openapi.get_container
6363
env.globals["get_container_type"] = openapi.get_container_type
6464
env.globals["get_type_at_path"] = openapi.get_type_at_path
65+
env.globals["get_security_names"] = openapi.get_security_names
6566

6667
api_j2 = env.get_template("api/api.j2")
6768
model_j2 = env.get_template("model/model.j2")

.generator/src/generator/openapi.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,18 @@ def generate_value(schema, use_random=False, prefix=None):
620620
raise TypeError(f"Unknown type: {spec['type']}")
621621

622622

623+
def get_security_names(security):
624+
if security is None:
625+
return []
626+
627+
auth_names = set()
628+
for auth in security:
629+
for key in auth.keys() if isinstance(auth, dict) else [auth]:
630+
auth_names.add(key)
631+
632+
return list(auth_names)
633+
634+
623635
class Schema:
624636
def __init__(self, spec, value=None, keys=None):
625637
self.spec = spec

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,12 @@ export class {{ className }}RequestFactory extends BaseAPIRequestFactory {
138138
{%- if authMethods %}
139139

140140
// Apply auth methods
141-
applySecurityAuthentication(_config, requestContext, [{% for authMethod in authMethods|reverse %}{%- for name in authMethod %}"{{ name }}"{% if loop.nextitem %}, {% endif %}{% endfor %}{% if loop.nextitem %}, {% endif %}{% endfor %}]);
141+
{%- set authMethods = operation.security if "security" in operation else openapi.security %}
142+
applySecurityAuthentication(_config, requestContext, [
143+
{%- for name in get_security_names(authMethods)|sort %}
144+
"{{ name }}",
145+
{%- endfor %}
146+
]);
142147
{%- endif %}
143148

144149
return requestContext;

packages/datadog-api-client-v1/apis/DashboardListsApi.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export class DashboardListsApiRequestFactory extends BaseAPIRequestFactory {
5656

5757
// Apply auth methods
5858
applySecurityAuthentication(_config, requestContext, [
59-
"AuthZ",
6059
"apiKeyAuth",
6160
"appKeyAuth",
61+
"AuthZ",
6262
]);
6363

6464
return requestContext;
@@ -90,9 +90,9 @@ export class DashboardListsApiRequestFactory extends BaseAPIRequestFactory {
9090

9191
// Apply auth methods
9292
applySecurityAuthentication(_config, requestContext, [
93-
"AuthZ",
9493
"apiKeyAuth",
9594
"appKeyAuth",
95+
"AuthZ",
9696
]);
9797

9898
return requestContext;
@@ -124,9 +124,9 @@ export class DashboardListsApiRequestFactory extends BaseAPIRequestFactory {
124124

125125
// Apply auth methods
126126
applySecurityAuthentication(_config, requestContext, [
127-
"AuthZ",
128127
"apiKeyAuth",
129128
"appKeyAuth",
129+
"AuthZ",
130130
]);
131131

132132
return requestContext;
@@ -149,9 +149,9 @@ export class DashboardListsApiRequestFactory extends BaseAPIRequestFactory {
149149

150150
// Apply auth methods
151151
applySecurityAuthentication(_config, requestContext, [
152-
"AuthZ",
153152
"apiKeyAuth",
154153
"appKeyAuth",
154+
"AuthZ",
155155
]);
156156

157157
return requestContext;
@@ -200,9 +200,9 @@ export class DashboardListsApiRequestFactory extends BaseAPIRequestFactory {
200200

201201
// Apply auth methods
202202
applySecurityAuthentication(_config, requestContext, [
203-
"AuthZ",
204203
"apiKeyAuth",
205204
"appKeyAuth",
205+
"AuthZ",
206206
]);
207207

208208
return requestContext;

packages/datadog-api-client-v1/apis/DashboardsApi.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
6363

6464
// Apply auth methods
6565
applySecurityAuthentication(_config, requestContext, [
66-
"AuthZ",
6766
"apiKeyAuth",
6867
"appKeyAuth",
68+
"AuthZ",
6969
]);
7070

7171
return requestContext;
@@ -105,9 +105,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
105105

106106
// Apply auth methods
107107
applySecurityAuthentication(_config, requestContext, [
108-
"AuthZ",
109108
"apiKeyAuth",
110109
"appKeyAuth",
110+
"AuthZ",
111111
]);
112112

113113
return requestContext;
@@ -139,9 +139,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
139139

140140
// Apply auth methods
141141
applySecurityAuthentication(_config, requestContext, [
142-
"AuthZ",
143142
"apiKeyAuth",
144143
"appKeyAuth",
144+
"AuthZ",
145145
]);
146146

147147
return requestContext;
@@ -181,9 +181,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
181181

182182
// Apply auth methods
183183
applySecurityAuthentication(_config, requestContext, [
184-
"AuthZ",
185184
"apiKeyAuth",
186185
"appKeyAuth",
186+
"AuthZ",
187187
]);
188188

189189
return requestContext;
@@ -215,9 +215,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
215215

216216
// Apply auth methods
217217
applySecurityAuthentication(_config, requestContext, [
218-
"AuthZ",
219218
"apiKeyAuth",
220219
"appKeyAuth",
220+
"AuthZ",
221221
]);
222222

223223
return requestContext;
@@ -266,9 +266,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
266266

267267
// Apply auth methods
268268
applySecurityAuthentication(_config, requestContext, [
269-
"AuthZ",
270269
"apiKeyAuth",
271270
"appKeyAuth",
271+
"AuthZ",
272272
]);
273273

274274
return requestContext;
@@ -300,9 +300,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
300300

301301
// Apply auth methods
302302
applySecurityAuthentication(_config, requestContext, [
303-
"AuthZ",
304303
"apiKeyAuth",
305304
"appKeyAuth",
305+
"AuthZ",
306306
]);
307307

308308
return requestContext;
@@ -334,9 +334,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
334334

335335
// Apply auth methods
336336
applySecurityAuthentication(_config, requestContext, [
337-
"AuthZ",
338337
"apiKeyAuth",
339338
"appKeyAuth",
339+
"AuthZ",
340340
]);
341341

342342
return requestContext;
@@ -386,9 +386,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
386386

387387
// Apply auth methods
388388
applySecurityAuthentication(_config, requestContext, [
389-
"AuthZ",
390389
"apiKeyAuth",
391390
"appKeyAuth",
391+
"AuthZ",
392392
]);
393393

394394
return requestContext;
@@ -445,9 +445,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
445445

446446
// Apply auth methods
447447
applySecurityAuthentication(_config, requestContext, [
448-
"AuthZ",
449448
"apiKeyAuth",
450449
"appKeyAuth",
450+
"AuthZ",
451451
]);
452452

453453
return requestContext;
@@ -487,9 +487,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
487487

488488
// Apply auth methods
489489
applySecurityAuthentication(_config, requestContext, [
490-
"AuthZ",
491490
"apiKeyAuth",
492491
"appKeyAuth",
492+
"AuthZ",
493493
]);
494494

495495
return requestContext;
@@ -538,9 +538,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
538538

539539
// Apply auth methods
540540
applySecurityAuthentication(_config, requestContext, [
541-
"AuthZ",
542541
"apiKeyAuth",
543542
"appKeyAuth",
543+
"AuthZ",
544544
]);
545545

546546
return requestContext;
@@ -589,9 +589,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
589589

590590
// Apply auth methods
591591
applySecurityAuthentication(_config, requestContext, [
592-
"AuthZ",
593592
"apiKeyAuth",
594593
"appKeyAuth",
594+
"AuthZ",
595595
]);
596596

597597
return requestContext;
@@ -640,9 +640,9 @@ export class DashboardsApiRequestFactory extends BaseAPIRequestFactory {
640640

641641
// Apply auth methods
642642
applySecurityAuthentication(_config, requestContext, [
643-
"AuthZ",
644643
"apiKeyAuth",
645644
"appKeyAuth",
645+
"AuthZ",
646646
]);
647647

648648
return requestContext;

0 commit comments

Comments
 (0)