Skip to content

Commit 75d55a3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add missing persona_mapping endpoints (#3531)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 083cf7d commit 75d55a3

15 files changed

+1078
-4
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.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Create an AWS cloud authentication persona mapping returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createAWSCloudAuthPersonaMapping"] = true;
9+
const apiInstance = new v2.CloudAuthenticationApi(configuration);
10+
11+
const params: v2.CloudAuthenticationApiCreateAWSCloudAuthPersonaMappingRequest =
12+
{
13+
body: {
14+
data: {
15+
attributes: {
16+
accountIdentifier: "test@test.com",
17+
arnPattern: "arn:aws:iam::123456789012:user/testuser",
18+
},
19+
type: "aws_cloud_auth_config",
20+
},
21+
},
22+
};
23+
24+
apiInstance
25+
.createAWSCloudAuthPersonaMapping(params)
26+
.then((data: v2.AWSCloudAuthPersonaMappingResponse) => {
27+
console.log(
28+
"API called successfully. Returned data: " + JSON.stringify(data)
29+
);
30+
})
31+
.catch((error: any) => console.error(error));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Delete an AWS cloud authentication persona mapping returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteAWSCloudAuthPersonaMapping"] = true;
9+
const apiInstance = new v2.CloudAuthenticationApi(configuration);
10+
11+
const params: v2.CloudAuthenticationApiDeleteAWSCloudAuthPersonaMappingRequest =
12+
{
13+
personaMappingId: "persona_mapping_id",
14+
};
15+
16+
apiInstance
17+
.deleteAWSCloudAuthPersonaMapping(params)
18+
.then((data: any) => {
19+
console.log(
20+
"API called successfully. Returned data: " + JSON.stringify(data)
21+
);
22+
})
23+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get an AWS cloud authentication persona mapping returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getAWSCloudAuthPersonaMapping"] = true;
9+
const apiInstance = new v2.CloudAuthenticationApi(configuration);
10+
11+
const params: v2.CloudAuthenticationApiGetAWSCloudAuthPersonaMappingRequest = {
12+
personaMappingId: "persona_mapping_id",
13+
};
14+
15+
apiInstance
16+
.getAWSCloudAuthPersonaMapping(params)
17+
.then((data: v2.AWSCloudAuthPersonaMappingResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3959,6 +3959,27 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
39593959
"v2.ListAWSCloudAuthPersonaMappings": {
39603960
"operationResponseType": "AWSCloudAuthPersonaMappingsResponse",
39613961
},
3962+
"v2.CreateAWSCloudAuthPersonaMapping": {
3963+
"body": {
3964+
"type": "AWSCloudAuthPersonaMappingCreateRequest",
3965+
"format": "",
3966+
},
3967+
"operationResponseType": "AWSCloudAuthPersonaMappingResponse",
3968+
},
3969+
"v2.GetAWSCloudAuthPersonaMapping": {
3970+
"personaMappingId": {
3971+
"type": "string",
3972+
"format": "",
3973+
},
3974+
"operationResponseType": "AWSCloudAuthPersonaMappingResponse",
3975+
},
3976+
"v2.DeleteAWSCloudAuthPersonaMapping": {
3977+
"personaMappingId": {
3978+
"type": "string",
3979+
"format": "",
3980+
},
3981+
"operationResponseType": "{}",
3982+
},
39623983
"v2.CreateCustomFramework": {
39633984
"body": {
39643985
"type": "CreateCustomFrameworkRequest",

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

0 commit comments

Comments
 (0)