Skip to content

Commit 0f6a0b7

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add missing persona_mapping endpoints (#3530)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 4454c60 commit 0f6a0b7

File tree

11 files changed

+989
-3
lines changed

11 files changed

+989
-3
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,14 @@ components:
929929
example: 10
930930
format: int64
931931
type: integer
932+
PersonaMappingID:
933+
description: The ID of the persona mapping
934+
example: c5c758c6-18c2-4484-ae3f-46b84128404a
935+
in: path
936+
name: persona_mapping_id
937+
required: true
938+
schema:
939+
type: string
932940
ProductName:
933941
description: Name of the product to be deleted, either `logs` or `rum`.
934942
in: path
@@ -1910,6 +1918,41 @@ components:
19101918
- account_identifier
19111919
- account_uuid
19121920
type: object
1921+
AWSCloudAuthPersonaMappingCreateAttributes:
1922+
description: Attributes for creating an AWS cloud authentication persona mapping
1923+
properties:
1924+
account_identifier:
1925+
description: Datadog account identifier (email or handle) mapped to the
1926+
AWS principal
1927+
example: test@test.com
1928+
type: string
1929+
arn_pattern:
1930+
description: AWS IAM ARN pattern to match for authentication
1931+
example: arn:aws:iam::123456789012:user/testuser
1932+
type: string
1933+
required:
1934+
- arn_pattern
1935+
- account_identifier
1936+
type: object
1937+
AWSCloudAuthPersonaMappingCreateData:
1938+
description: Data for creating an AWS cloud authentication persona mapping
1939+
properties:
1940+
attributes:
1941+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingCreateAttributes'
1942+
type:
1943+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingType'
1944+
required:
1945+
- type
1946+
- attributes
1947+
type: object
1948+
AWSCloudAuthPersonaMappingCreateRequest:
1949+
description: Request used to create an AWS cloud authentication persona mapping
1950+
properties:
1951+
data:
1952+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingCreateData'
1953+
required:
1954+
- data
1955+
type: object
19131956
AWSCloudAuthPersonaMappingDataResponse:
19141957
description: Data for AWS cloud authentication persona mapping response
19151958
properties:
@@ -1926,6 +1969,14 @@ components:
19261969
- type
19271970
- attributes
19281971
type: object
1972+
AWSCloudAuthPersonaMappingResponse:
1973+
description: Response containing a single AWS cloud authentication persona mapping
1974+
properties:
1975+
data:
1976+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingDataResponse'
1977+
required:
1978+
- data
1979+
type: object
19291980
AWSCloudAuthPersonaMappingType:
19301981
description: Type identifier for AWS cloud authentication persona mapping
19311982
enum:
@@ -77100,6 +77151,114 @@ paths:
7710077151
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
7710177152

7710277153
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
77154+
post:
77155+
description: Create an AWS cloud authentication persona mapping. This endpoint
77156+
associates an AWS IAM principal with a Datadog user.
77157+
operationId: CreateAWSCloudAuthPersonaMapping
77158+
requestBody:
77159+
content:
77160+
application/json:
77161+
schema:
77162+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingCreateRequest'
77163+
required: true
77164+
responses:
77165+
'201':
77166+
content:
77167+
application/json:
77168+
schema:
77169+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingResponse'
77170+
description: Created
77171+
'400':
77172+
content:
77173+
application/json:
77174+
schema:
77175+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77176+
description: Bad Request
77177+
'403':
77178+
content:
77179+
application/json:
77180+
schema:
77181+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77182+
description: Forbidden
77183+
'409':
77184+
content:
77185+
application/json:
77186+
schema:
77187+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77188+
description: Conflict
77189+
'429':
77190+
$ref: '#/components/responses/TooManyRequestsResponse'
77191+
summary: Create an AWS cloud authentication persona mapping
77192+
tags:
77193+
- Cloud Authentication
77194+
x-codegen-request-body-name: body
77195+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
77196+
77197+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
77198+
/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}:
77199+
delete:
77200+
description: Delete an AWS cloud authentication persona mapping by ID. This
77201+
removes the association between an AWS IAM principal and a Datadog user.
77202+
operationId: DeleteAWSCloudAuthPersonaMapping
77203+
parameters:
77204+
- $ref: '#/components/parameters/PersonaMappingID'
77205+
responses:
77206+
'204':
77207+
description: No Content
77208+
'403':
77209+
content:
77210+
application/json:
77211+
schema:
77212+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77213+
description: Forbidden
77214+
'404':
77215+
content:
77216+
application/json:
77217+
schema:
77218+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77219+
description: Not Found
77220+
'429':
77221+
$ref: '#/components/responses/TooManyRequestsResponse'
77222+
summary: Delete an AWS cloud authentication persona mapping
77223+
tags:
77224+
- Cloud Authentication
77225+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
77226+
77227+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
77228+
get:
77229+
description: Get a specific AWS cloud authentication persona mapping by ID.
77230+
This endpoint retrieves a single configured persona mapping that associates
77231+
an AWS IAM principal with a Datadog user.
77232+
operationId: GetAWSCloudAuthPersonaMapping
77233+
parameters:
77234+
- $ref: '#/components/parameters/PersonaMappingID'
77235+
responses:
77236+
'200':
77237+
content:
77238+
application/json:
77239+
schema:
77240+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingResponse'
77241+
description: OK
77242+
'403':
77243+
content:
77244+
application/json:
77245+
schema:
77246+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77247+
description: Forbidden
77248+
'404':
77249+
content:
77250+
application/json:
77251+
schema:
77252+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77253+
description: Not Found
77254+
'429':
77255+
$ref: '#/components/responses/TooManyRequestsResponse'
77256+
summary: Get an AWS cloud authentication persona mapping
77257+
tags:
77258+
- Cloud Authentication
77259+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
77260+
77261+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
7710377262
/api/v2/cloud_security_management/custom_frameworks:
7710477263
post:
7710577264
description: Create a custom framework.

features/v2/cloud_authentication.feature

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,73 @@ Feature: Cloud Authentication
77
Given a valid "apiKeyAuth" key in the system
88
And a valid "appKeyAuth" key in the system
99
And an instance of "CloudAuthentication" API
10-
And operation "ListAWSCloudAuthPersonaMappings" enabled
11-
And new "ListAWSCloudAuthPersonaMappings" request
10+
11+
@generated @skip @team:DataDog/team-aaaauthn
12+
Scenario: Create an AWS cloud authentication persona mapping returns "Bad Request" response
13+
Given operation "CreateAWSCloudAuthPersonaMapping" enabled
14+
And new "CreateAWSCloudAuthPersonaMapping" request
15+
And body with value {"data": {"attributes": {"account_identifier": "test@test.com", "arn_pattern": "arn:aws:iam::123456789012:user/testuser"}, "type": "aws_cloud_auth_config"}}
16+
When the request is sent
17+
Then the response status is 400 Bad Request
18+
19+
@generated @skip @team:DataDog/team-aaaauthn
20+
Scenario: Create an AWS cloud authentication persona mapping returns "Conflict" response
21+
Given operation "CreateAWSCloudAuthPersonaMapping" enabled
22+
And new "CreateAWSCloudAuthPersonaMapping" request
23+
And body with value {"data": {"attributes": {"account_identifier": "test@test.com", "arn_pattern": "arn:aws:iam::123456789012:user/testuser"}, "type": "aws_cloud_auth_config"}}
24+
When the request is sent
25+
Then the response status is 409 Conflict
26+
27+
@generated @skip @team:DataDog/team-aaaauthn
28+
Scenario: Create an AWS cloud authentication persona mapping returns "Created" response
29+
Given operation "CreateAWSCloudAuthPersonaMapping" enabled
30+
And new "CreateAWSCloudAuthPersonaMapping" request
31+
And body with value {"data": {"attributes": {"account_identifier": "test@test.com", "arn_pattern": "arn:aws:iam::123456789012:user/testuser"}, "type": "aws_cloud_auth_config"}}
32+
When the request is sent
33+
Then the response status is 201 Created
34+
35+
@generated @skip @team:DataDog/team-aaaauthn
36+
Scenario: Delete an AWS cloud authentication persona mapping returns "No Content" response
37+
Given operation "DeleteAWSCloudAuthPersonaMapping" enabled
38+
And new "DeleteAWSCloudAuthPersonaMapping" request
39+
And request contains "persona_mapping_id" parameter from "REPLACE.ME"
40+
When the request is sent
41+
Then the response status is 204 No Content
42+
43+
@generated @skip @team:DataDog/team-aaaauthn
44+
Scenario: Delete an AWS cloud authentication persona mapping returns "Not Found" response
45+
Given operation "DeleteAWSCloudAuthPersonaMapping" enabled
46+
And new "DeleteAWSCloudAuthPersonaMapping" request
47+
And request contains "persona_mapping_id" parameter from "REPLACE.ME"
48+
When the request is sent
49+
Then the response status is 404 Not Found
50+
51+
@generated @skip @team:DataDog/team-aaaauthn
52+
Scenario: Get an AWS cloud authentication persona mapping returns "Not Found" response
53+
Given operation "GetAWSCloudAuthPersonaMapping" enabled
54+
And new "GetAWSCloudAuthPersonaMapping" request
55+
And request contains "persona_mapping_id" parameter from "REPLACE.ME"
56+
When the request is sent
57+
Then the response status is 404 Not Found
58+
59+
@generated @skip @team:DataDog/team-aaaauthn
60+
Scenario: Get an AWS cloud authentication persona mapping returns "OK" response
61+
Given operation "GetAWSCloudAuthPersonaMapping" enabled
62+
And new "GetAWSCloudAuthPersonaMapping" request
63+
And request contains "persona_mapping_id" parameter from "REPLACE.ME"
64+
When the request is sent
65+
Then the response status is 200 OK
1266

1367
@generated @skip @team:DataDog/team-aaaauthn
1468
Scenario: List AWS cloud authentication persona mappings returns "Bad Request" response
69+
Given operation "ListAWSCloudAuthPersonaMappings" enabled
70+
And new "ListAWSCloudAuthPersonaMappings" request
1571
When the request is sent
1672
Then the response status is 400 Bad Request
1773

1874
@generated @skip @team:DataDog/team-aaaauthn
1975
Scenario: List AWS cloud authentication persona mappings returns "OK" response
76+
Given operation "ListAWSCloudAuthPersonaMappings" enabled
77+
And new "ListAWSCloudAuthPersonaMappings" request
2078
When the request is sent
2179
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,31 @@
10601060
"type": "safe"
10611061
}
10621062
},
1063+
"CreateAWSCloudAuthPersonaMapping": {
1064+
"tag": "Cloud Authentication",
1065+
"undo": {
1066+
"operationId": "DeleteAWSCloudAuthPersonaMapping",
1067+
"parameters": [
1068+
{
1069+
"name": "persona_mapping_id",
1070+
"source": "data.id"
1071+
}
1072+
],
1073+
"type": "unsafe"
1074+
}
1075+
},
1076+
"DeleteAWSCloudAuthPersonaMapping": {
1077+
"tag": "Cloud Authentication",
1078+
"undo": {
1079+
"type": "idempotent"
1080+
}
1081+
},
1082+
"GetAWSCloudAuthPersonaMapping": {
1083+
"tag": "Cloud Authentication",
1084+
"undo": {
1085+
"type": "safe"
1086+
}
1087+
},
10631088
"CreateCustomFramework": {
10641089
"tag": "Security Monitoring",
10651090
"undo": {

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3969,6 +3969,27 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
39693969
"CloudAuthenticationApi.V2.ListAWSCloudAuthPersonaMappings": {
39703970
operationResponseType: "AWSCloudAuthPersonaMappingsResponse",
39713971
},
3972+
"CloudAuthenticationApi.V2.CreateAWSCloudAuthPersonaMapping": {
3973+
body: {
3974+
type: "AWSCloudAuthPersonaMappingCreateRequest",
3975+
format: "",
3976+
},
3977+
operationResponseType: "AWSCloudAuthPersonaMappingResponse",
3978+
},
3979+
"CloudAuthenticationApi.V2.GetAWSCloudAuthPersonaMapping": {
3980+
personaMappingId: {
3981+
type: "string",
3982+
format: "",
3983+
},
3984+
operationResponseType: "AWSCloudAuthPersonaMappingResponse",
3985+
},
3986+
"CloudAuthenticationApi.V2.DeleteAWSCloudAuthPersonaMapping": {
3987+
personaMappingId: {
3988+
type: "string",
3989+
format: "",
3990+
},
3991+
operationResponseType: "{}",
3992+
},
39723993
"SecurityMonitoringApi.V2.CreateCustomFramework": {
39733994
body: {
39743995
type: "CreateCustomFrameworkRequest",

0 commit comments

Comments
 (0)