Skip to content

Commit 1c2648a

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

14 files changed

Lines changed: 1043 additions & 2 deletions

.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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Create an AWS cloud authentication persona mapping returns "Created" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_aws_cloud_auth_persona_mapping".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CloudAuthenticationAPI.new
8+
9+
body = DatadogAPIClient::V2::AWSCloudAuthPersonaMappingCreateRequest.new({
10+
data: DatadogAPIClient::V2::AWSCloudAuthPersonaMappingCreateData.new({
11+
attributes: DatadogAPIClient::V2::AWSCloudAuthPersonaMappingCreateAttributes.new({
12+
account_identifier: "test@test.com",
13+
arn_pattern: "arn:aws:iam::123456789012:user/testuser",
14+
}),
15+
type: DatadogAPIClient::V2::AWSCloudAuthPersonaMappingType::AWS_CLOUD_AUTH_CONFIG,
16+
}),
17+
})
18+
p api_instance.create_aws_cloud_auth_persona_mapping(body)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Delete an AWS cloud authentication persona mapping returns "No Content" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.delete_aws_cloud_auth_persona_mapping".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CloudAuthenticationAPI.new
8+
api_instance.delete_aws_cloud_auth_persona_mapping("persona_mapping_id")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get an AWS cloud authentication persona mapping returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_aws_cloud_auth_persona_mapping".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CloudAuthenticationAPI.new
8+
p api_instance.get_aws_cloud_auth_persona_mapping("persona_mapping_id")

features/scenarios_model_mapping.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,15 @@
14111411
"v2.SearchCIAppTestEvents" => {
14121412
"body" => "CIAppTestEventsRequest",
14131413
},
1414+
"v2.CreateAWSCloudAuthPersonaMapping" => {
1415+
"body" => "AWSCloudAuthPersonaMappingCreateRequest",
1416+
},
1417+
"v2.DeleteAWSCloudAuthPersonaMapping" => {
1418+
"persona_mapping_id" => "String",
1419+
},
1420+
"v2.GetAWSCloudAuthPersonaMapping" => {
1421+
"persona_mapping_id" => "String",
1422+
},
14141423
"v2.CreateCustomFramework" => {
14151424
"body" => "CreateCustomFrameworkRequest",
14161425
},

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": {

lib/datadog_api_client/configuration.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ def initialize
221221
"v2.get_change_request": false,
222222
"v2.update_change_request": false,
223223
"v2.update_change_request_decision": false,
224+
"v2.create_aws_cloud_auth_persona_mapping": false,
225+
"v2.delete_aws_cloud_auth_persona_mapping": false,
226+
"v2.get_aws_cloud_auth_persona_mapping": false,
224227
"v2.list_aws_cloud_auth_persona_mappings": false,
225228
"v2.activate_content_pack": false,
226229
"v2.cancel_threat_hunting_job": false,

lib/datadog_api_client/inflector.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,11 @@ def overrides
12351235
"v2.aws_auth_config_keys" => "AWSAuthConfigKeys",
12361236
"v2.aws_auth_config_role" => "AWSAuthConfigRole",
12371237
"v2.aws_cloud_auth_persona_mapping_attributes_response" => "AWSCloudAuthPersonaMappingAttributesResponse",
1238+
"v2.aws_cloud_auth_persona_mapping_create_attributes" => "AWSCloudAuthPersonaMappingCreateAttributes",
1239+
"v2.aws_cloud_auth_persona_mapping_create_data" => "AWSCloudAuthPersonaMappingCreateData",
1240+
"v2.aws_cloud_auth_persona_mapping_create_request" => "AWSCloudAuthPersonaMappingCreateRequest",
12381241
"v2.aws_cloud_auth_persona_mapping_data_response" => "AWSCloudAuthPersonaMappingDataResponse",
1242+
"v2.aws_cloud_auth_persona_mapping_response" => "AWSCloudAuthPersonaMappingResponse",
12391243
"v2.aws_cloud_auth_persona_mappings_response" => "AWSCloudAuthPersonaMappingsResponse",
12401244
"v2.aws_cloud_auth_persona_mapping_type" => "AWSCloudAuthPersonaMappingType",
12411245
"v2.aws_credentials" => "AWSCredentials",

0 commit comments

Comments
 (0)