Skip to content

Commit 3778ca2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add receives_permissions_from field to Roles API (#3464)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent a799ab4 commit 3778ca2

File tree

12 files changed

+154
-6
lines changed

12 files changed

+154
-6
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49931,6 +49931,18 @@ components:
4993149931
description: The name of the role. The name is neither unique nor a stable
4993249932
identifier of the role.
4993349933
type: string
49934+
receives_permissions_from:
49935+
description: 'The managed role from which this role automatically inherits
49936+
new permissions.
49937+
49938+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49939+
Role", or "Datadog Read Only Role".
49940+
49941+
If empty or not specified, the role does not automatically inherit permissions
49942+
from any managed role.'
49943+
items:
49944+
type: string
49945+
type: array
4993449946
user_count:
4993549947
description: Number of users with that role.
4993649948
format: int64
@@ -49956,6 +49968,18 @@ components:
4995649968
description: Name of the new role that is cloned.
4995749969
example: cloned-role
4995849970
type: string
49971+
receives_permissions_from:
49972+
description: 'The managed role from which this role automatically inherits
49973+
new permissions.
49974+
49975+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49976+
Role", or "Datadog Read Only Role".
49977+
49978+
If empty or not specified, the role does not automatically inherit permissions
49979+
from any managed role.'
49980+
items:
49981+
type: string
49982+
type: array
4995949983
required:
4996049984
- name
4996149985
type: object
@@ -49984,6 +50008,18 @@ components:
4998450008
description: Name of the role.
4998550009
example: developers
4998650010
type: string
50011+
receives_permissions_from:
50012+
description: 'The managed role from which this role automatically inherits
50013+
new permissions.
50014+
50015+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
50016+
Role", or "Datadog Read Only Role".
50017+
50018+
If empty or not specified, the role does not automatically inherit permissions
50019+
from any managed role.'
50020+
items:
50021+
type: string
50022+
type: array
4998750023
required:
4998850024
- name
4998950025
type: object
@@ -50105,6 +50141,18 @@ components:
5010550141
name:
5010650142
description: Name of the role.
5010750143
type: string
50144+
receives_permissions_from:
50145+
description: 'The managed role from which this role automatically inherits
50146+
new permissions.
50147+
50148+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
50149+
Role", or "Datadog Read Only Role".
50150+
50151+
If empty or not specified, the role does not automatically inherit permissions
50152+
from any managed role.'
50153+
items:
50154+
type: string
50155+
type: array
5010850156
user_count:
5010950157
description: The user count.
5011050158
format: int32
@@ -105571,7 +105619,12 @@ tags:
105571105619

105572105620
read access on a specific log index to a role can be done in Datadog from the
105573105621

105574-
[Pipelines page](https://app.datadoghq.com/logs/pipelines).'
105622+
[Pipelines page](https://app.datadoghq.com/logs/pipelines).
105623+
105624+
105625+
Roles can also be managed in bulk through the Datadog UI, which provides
105626+
105627+
the capability to assign a single permission to multiple roles simultaneously.'
105575105628
name: Roles
105576105629
- description: Auto-generated tag Rum Audience Management
105577105630
name: Rum Audience Management

features/v2/roles.feature

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Feature: Roles
66
account assets can be granted to roles in the Datadog application without
77
using this API. For example, granting read access on a specific log index
88
to a role can be done in Datadog from the [Pipelines
9-
page](https://app.datadoghq.com/logs/pipelines).
9+
page](https://app.datadoghq.com/logs/pipelines). Roles can also be
10+
managed in bulk through the Datadog UI, which provides the capability to
11+
assign a single permission to multiple roles simultaneously.
1012

1113
Background:
1214
Given a valid "apiKeyAuth" key in the system
@@ -64,7 +66,7 @@ Feature: Roles
6466
Scenario: Create a new role by cloning an existing role returns "Not found" response
6567
Given new "CloneRole" request
6668
And request contains "role_id" parameter from "REPLACE.ME"
67-
And body with value {"data": {"attributes": {"name": "cloned-role"}, "type": "roles"}}
69+
And body with value {"data": {"attributes": {"name": "cloned-role", "receives_permissions_from": []}, "type": "roles"}}
6870
When the request is sent
6971
Then the response status is 404 Not found
7072

@@ -81,14 +83,14 @@ Feature: Roles
8183
@generated @skip @team:DataDog/aaa-core-access
8284
Scenario: Create role returns "Bad Request" response
8385
Given new "CreateRole" request
84-
And body with value {"data": {"attributes": {"name": "developers"}, "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
86+
And body with value {"data": {"attributes": {"name": "developers", "receives_permissions_from": []}, "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
8587
When the request is sent
8688
Then the response status is 400 Bad Request
8789

8890
@generated @skip @team:DataDog/aaa-core-access
8991
Scenario: Create role returns "OK" response
9092
Given new "CreateRole" request
91-
And body with value {"data": {"attributes": {"name": "developers"}, "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
93+
And body with value {"data": {"attributes": {"name": "developers", "receives_permissions_from": []}, "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
9294
When the request is sent
9395
Then the response status is 200 OK
9496

@@ -335,6 +337,6 @@ Feature: Roles
335337
Scenario: Update a role returns "Unprocessable Entity" response
336338
Given new "UpdateRole" request
337339
And request contains "role_id" parameter from "REPLACE.ME"
338-
And body with value {"data": {"attributes": {}, "id": "00000000-0000-1111-0000-000000000000", "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
340+
And body with value {"data": {"attributes": {"receives_permissions_from": []}, "id": "00000000-0000-1111-0000-000000000000", "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
339341
When the request is sent
340342
Then the response status is 422 Unprocessable Entity

services/auth_n_mappings/src/v2/models/RoleAttributes.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ export class RoleAttributes {
1616
* The name of the role. The name is neither unique nor a stable identifier of the role.
1717
*/
1818
"name"?: string;
19+
/**
20+
* The managed role from which this role automatically inherits new permissions.
21+
* Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
22+
* If empty or not specified, the role does not automatically inherit permissions from any managed role.
23+
*/
24+
"receivesPermissionsFrom"?: Array<string>;
1925
/**
2026
* Number of users with that role.
2127
*/
@@ -49,6 +55,10 @@ export class RoleAttributes {
4955
baseName: "name",
5056
type: "string",
5157
},
58+
receivesPermissionsFrom: {
59+
baseName: "receives_permissions_from",
60+
type: "Array<string>",
61+
},
5262
userCount: {
5363
baseName: "user_count",
5464
type: "number",

services/key_management/src/v2/models/RoleAttributes.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ export class RoleAttributes {
1616
* The name of the role. The name is neither unique nor a stable identifier of the role.
1717
*/
1818
"name"?: string;
19+
/**
20+
* The managed role from which this role automatically inherits new permissions.
21+
* Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
22+
* If empty or not specified, the role does not automatically inherit permissions from any managed role.
23+
*/
24+
"receivesPermissionsFrom"?: Array<string>;
1925
/**
2026
* Number of users with that role.
2127
*/
@@ -49,6 +55,10 @@ export class RoleAttributes {
4955
baseName: "name",
5056
type: "string",
5157
},
58+
receivesPermissionsFrom: {
59+
baseName: "receives_permissions_from",
60+
type: "Array<string>",
61+
},
5262
userCount: {
5363
baseName: "user_count",
5464
type: "number",

services/logs_archives/src/v2/models/RoleAttributes.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ export class RoleAttributes {
1616
* The name of the role. The name is neither unique nor a stable identifier of the role.
1717
*/
1818
"name"?: string;
19+
/**
20+
* The managed role from which this role automatically inherits new permissions.
21+
* Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
22+
* If empty or not specified, the role does not automatically inherit permissions from any managed role.
23+
*/
24+
"receivesPermissionsFrom"?: Array<string>;
1925
/**
2026
* Number of users with that role.
2127
*/
@@ -49,6 +55,10 @@ export class RoleAttributes {
4955
baseName: "name",
5056
type: "string",
5157
},
58+
receivesPermissionsFrom: {
59+
baseName: "receives_permissions_from",
60+
type: "Array<string>",
61+
},
5262
userCount: {
5363
baseName: "user_count",
5464
type: "number",

services/roles/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ in the Datadog application without using this API. For example, granting
1111
read access on a specific log index to a role can be done in Datadog from the
1212
[Pipelines page](https://app.datadoghq.com/logs/pipelines).
1313

14+
Roles can also be managed in bulk through the Datadog UI, which provides
15+
the capability to assign a single permission to multiple roles simultaneously.
16+
1417
## Navigation
1518

1619
- [Installation](#installation)

services/roles/src/v2/models/RoleAttributes.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ export class RoleAttributes {
1616
* The name of the role. The name is neither unique nor a stable identifier of the role.
1717
*/
1818
"name"?: string;
19+
/**
20+
* The managed role from which this role automatically inherits new permissions.
21+
* Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
22+
* If empty or not specified, the role does not automatically inherit permissions from any managed role.
23+
*/
24+
"receivesPermissionsFrom"?: Array<string>;
1925
/**
2026
* Number of users with that role.
2127
*/
@@ -49,6 +55,10 @@ export class RoleAttributes {
4955
baseName: "name",
5056
type: "string",
5157
},
58+
receivesPermissionsFrom: {
59+
baseName: "receives_permissions_from",
60+
type: "Array<string>",
61+
},
5262
userCount: {
5363
baseName: "user_count",
5464
type: "number",

services/roles/src/v2/models/RoleCloneAttributes.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export class RoleCloneAttributes {
88
* Name of the new role that is cloned.
99
*/
1010
"name": string;
11+
/**
12+
* The managed role from which this role automatically inherits new permissions.
13+
* Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
14+
* If empty or not specified, the role does not automatically inherit permissions from any managed role.
15+
*/
16+
"receivesPermissionsFrom"?: Array<string>;
1117
/**
1218
* A container for additional, undeclared properties.
1319
* This is a holder for any undeclared properties as specified with
@@ -28,6 +34,10 @@ export class RoleCloneAttributes {
2834
type: "string",
2935
required: true,
3036
},
37+
receivesPermissionsFrom: {
38+
baseName: "receives_permissions_from",
39+
type: "Array<string>",
40+
},
3141
additionalProperties: {
3242
baseName: "additionalProperties",
3343
type: "{ [key: string]: any; }",

services/roles/src/v2/models/RoleCreateAttributes.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ export class RoleCreateAttributes {
1616
* Name of the role.
1717
*/
1818
"name": string;
19+
/**
20+
* The managed role from which this role automatically inherits new permissions.
21+
* Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
22+
* If empty or not specified, the role does not automatically inherit permissions from any managed role.
23+
*/
24+
"receivesPermissionsFrom"?: Array<string>;
1925
/**
2026
* A container for additional, undeclared properties.
2127
* This is a holder for any undeclared properties as specified with
@@ -46,6 +52,10 @@ export class RoleCreateAttributes {
4652
type: "string",
4753
required: true,
4854
},
55+
receivesPermissionsFrom: {
56+
baseName: "receives_permissions_from",
57+
type: "Array<string>",
58+
},
4959
additionalProperties: {
5060
baseName: "additionalProperties",
5161
type: "{ [key: string]: any; }",

services/roles/src/v2/models/RoleUpdateAttributes.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ export class RoleUpdateAttributes {
1616
* Name of the role.
1717
*/
1818
"name"?: string;
19+
/**
20+
* The managed role from which this role automatically inherits new permissions.
21+
* Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
22+
* If empty or not specified, the role does not automatically inherit permissions from any managed role.
23+
*/
24+
"receivesPermissionsFrom"?: Array<string>;
1925
/**
2026
* The user count.
2127
*/
@@ -49,6 +55,10 @@ export class RoleUpdateAttributes {
4955
baseName: "name",
5056
type: "string",
5157
},
58+
receivesPermissionsFrom: {
59+
baseName: "receives_permissions_from",
60+
type: "Array<string>",
61+
},
5262
userCount: {
5363
baseName: "user_count",
5464
type: "number",

0 commit comments

Comments
 (0)