Skip to content

Commit 1935e23

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI documentation for cloud-auth-config service (DataDog#2938)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 1e2cd8a commit 1935e23

11 files changed

Lines changed: 709 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,6 +1834,65 @@ components:
18341834
required:
18351835
- role_name
18361836
type: object
1837+
AWSCloudAuthPersonaMappingAttributesResponse:
1838+
description: Attributes for AWS cloud authentication persona mapping response
1839+
properties:
1840+
account_identifier:
1841+
description: Datadog account identifier (email or handle) mapped to the
1842+
AWS principal
1843+
example: test@test.com
1844+
type: string
1845+
account_uuid:
1846+
description: Datadog account UUID
1847+
example: 12bbdc5c-5966-47e0-8733-285f9e44bcf4
1848+
type: string
1849+
arn_pattern:
1850+
description: AWS IAM ARN pattern to match for authentication
1851+
example: arn:aws:iam::123456789012:user/testuser
1852+
type: string
1853+
required:
1854+
- arn_pattern
1855+
- account_identifier
1856+
- account_uuid
1857+
type: object
1858+
AWSCloudAuthPersonaMappingDataResponse:
1859+
description: Data for AWS cloud authentication persona mapping response
1860+
properties:
1861+
attributes:
1862+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingAttributesResponse'
1863+
id:
1864+
description: Unique identifier for the persona mapping
1865+
example: c5c758c6-18c2-4484-ae3f-46b84128404a
1866+
type: string
1867+
type:
1868+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingType'
1869+
required:
1870+
- id
1871+
- type
1872+
- attributes
1873+
type: object
1874+
AWSCloudAuthPersonaMappingType:
1875+
description: Type identifier for AWS cloud authentication persona mapping
1876+
enum:
1877+
- aws_cloud_auth_config
1878+
example: aws_cloud_auth_config
1879+
type: string
1880+
x-enum-varnames:
1881+
- AWS_CLOUD_AUTH_CONFIG
1882+
AWSCloudAuthPersonaMappingsData:
1883+
description: List of AWS cloud authentication persona mappings
1884+
items:
1885+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingDataResponse'
1886+
type: array
1887+
AWSCloudAuthPersonaMappingsResponse:
1888+
description: Response containing a list of AWS cloud authentication persona
1889+
mappings
1890+
properties:
1891+
data:
1892+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingsData'
1893+
required:
1894+
- data
1895+
type: object
18371896
AWSCredentials:
18381897
description: The definition of `AWSCredentials` object.
18391898
oneOf:
@@ -74551,6 +74610,39 @@ paths:
7455174610
permissions:
7455274611
- ci_visibility_read
7455374612
- test_optimization_read
74613+
/api/v2/cloud_auth/aws/persona_mapping:
74614+
get:
74615+
description: List all AWS cloud authentication persona mappings. This endpoint
74616+
retrieves all configured persona mappings that associate AWS IAM principals
74617+
with Datadog users.
74618+
operationId: ListAWSCloudAuthPersonaMappings
74619+
responses:
74620+
'200':
74621+
content:
74622+
application/json:
74623+
schema:
74624+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingsResponse'
74625+
description: OK
74626+
'400':
74627+
content:
74628+
application/json:
74629+
schema:
74630+
$ref: '#/components/schemas/JSONAPIErrorResponse'
74631+
description: Bad Request
74632+
'403':
74633+
content:
74634+
application/json:
74635+
schema:
74636+
$ref: '#/components/schemas/JSONAPIErrorResponse'
74637+
description: Forbidden
74638+
'429':
74639+
$ref: '#/components/responses/TooManyRequestsResponse'
74640+
summary: List AWS cloud authentication persona mappings
74641+
tags:
74642+
- Cloud Authentication
74643+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
74644+
74645+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
7455474646
/api/v2/cloud_security_management/custom_frameworks:
7455574647
post:
7455674648
description: Create a custom framework.
@@ -104331,6 +104423,9 @@ tags:
104331104423
Management page](https://docs.datadoghq.com/service_management/case_management/)
104332104424
for more information.
104333104425
name: Case Management Type
104426+
- description: Configure AWS cloud authentication mappings for persona and intake
104427+
authentication through the Datadog API.
104428+
name: Cloud Authentication
104334104429
- description: The Cloud Cost Management API allows you to set up, edit, and delete
104335104430
Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query
104336104431
your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List AWS cloud authentication persona mappings returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_aws_cloud_auth_persona_mappings".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CloudAuthenticationAPI.new
8+
p api_instance.list_aws_cloud_auth_persona_mappings()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@endpoint(cloud-authentication) @endpoint(cloud-authentication-v2)
2+
Feature: Cloud Authentication
3+
Configure AWS cloud authentication mappings for persona and intake
4+
authentication through the Datadog API.
5+
6+
Background:
7+
Given a valid "apiKeyAuth" key in the system
8+
And a valid "appKeyAuth" key in the system
9+
And an instance of "CloudAuthentication" API
10+
And operation "ListAWSCloudAuthPersonaMappings" enabled
11+
And new "ListAWSCloudAuthPersonaMappings" request
12+
13+
@generated @skip @team:DataDog/team-aaaauthn
14+
Scenario: List AWS cloud authentication persona mappings returns "Bad Request" response
15+
When the request is sent
16+
Then the response status is 400 Bad Request
17+
18+
@generated @skip @team:DataDog/team-aaaauthn
19+
Scenario: List AWS cloud authentication persona mappings returns "OK" response
20+
When the request is sent
21+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,12 @@
10141014
"type": "safe"
10151015
}
10161016
},
1017+
"ListAWSCloudAuthPersonaMappings": {
1018+
"tag": "Cloud Authentication",
1019+
"undo": {
1020+
"type": "safe"
1021+
}
1022+
},
10171023
"CreateCustomFramework": {
10181024
"tag": "Security Monitoring",
10191025
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def initialize
215215
"v2.link_jira_issue_to_case": false,
216216
"v2.move_case_to_project": false,
217217
"v2.unlink_jira_issue": false,
218+
"v2.list_aws_cloud_auth_persona_mappings": false,
218219
"v2.activate_content_pack": false,
219220
"v2.cancel_threat_hunting_job": false,
220221
"v2.convert_job_result_to_signal": false,

lib/datadog_api_client/inflector.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,10 @@ def overrides
12341234
"v2.aws_auth_config" => "AWSAuthConfig",
12351235
"v2.aws_auth_config_keys" => "AWSAuthConfigKeys",
12361236
"v2.aws_auth_config_role" => "AWSAuthConfigRole",
1237+
"v2.aws_cloud_auth_persona_mapping_attributes_response" => "AWSCloudAuthPersonaMappingAttributesResponse",
1238+
"v2.aws_cloud_auth_persona_mapping_data_response" => "AWSCloudAuthPersonaMappingDataResponse",
1239+
"v2.aws_cloud_auth_persona_mappings_response" => "AWSCloudAuthPersonaMappingsResponse",
1240+
"v2.aws_cloud_auth_persona_mapping_type" => "AWSCloudAuthPersonaMappingType",
12371241
"v2.aws_credentials" => "AWSCredentials",
12381242
"v2.aws_credentials_update" => "AWSCredentialsUpdate",
12391243
"v2.aws_cur_config" => "AwsCURConfig",
@@ -5315,6 +5319,7 @@ def overrides
53155319
"v2.case_management_type_api" => "CaseManagementTypeAPI",
53165320
"v2.ci_visibility_pipelines_api" => "CIVisibilityPipelinesAPI",
53175321
"v2.ci_visibility_tests_api" => "CIVisibilityTestsAPI",
5322+
"v2.cloud_authentication_api" => "CloudAuthenticationAPI",
53185323
"v2.cloud_cost_management_api" => "CloudCostManagementAPI",
53195324
"v2.cloud_network_monitoring_api" => "CloudNetworkMonitoringAPI",
53205325
"v2.cloudflare_integration_api" => "CloudflareIntegrationAPI",
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'cgi'
17+
18+
module DatadogAPIClient::V2
19+
class CloudAuthenticationAPI
20+
attr_accessor :api_client
21+
22+
def initialize(api_client = DatadogAPIClient::APIClient.default)
23+
@api_client = api_client
24+
end
25+
26+
# List AWS cloud authentication persona mappings.
27+
#
28+
# @see #list_aws_cloud_auth_persona_mappings_with_http_info
29+
def list_aws_cloud_auth_persona_mappings(opts = {})
30+
data, _status_code, _headers = list_aws_cloud_auth_persona_mappings_with_http_info(opts)
31+
data
32+
end
33+
34+
# List AWS cloud authentication persona mappings.
35+
#
36+
# List all AWS cloud authentication persona mappings. This endpoint retrieves all configured persona mappings that associate AWS IAM principals with Datadog users.
37+
#
38+
# @param opts [Hash] the optional parameters
39+
# @return [Array<(AWSCloudAuthPersonaMappingsResponse, Integer, Hash)>] AWSCloudAuthPersonaMappingsResponse data, response status code and response headers
40+
def list_aws_cloud_auth_persona_mappings_with_http_info(opts = {})
41+
unstable_enabled = @api_client.config.unstable_operations["v2.list_aws_cloud_auth_persona_mappings".to_sym]
42+
if unstable_enabled
43+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_aws_cloud_auth_persona_mappings")
44+
else
45+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_aws_cloud_auth_persona_mappings"))
46+
end
47+
48+
if @api_client.config.debugging
49+
@api_client.config.logger.debug 'Calling API: CloudAuthenticationAPI.list_aws_cloud_auth_persona_mappings ...'
50+
end
51+
# resource path
52+
local_var_path = '/api/v2/cloud_auth/aws/persona_mapping'
53+
54+
# query parameters
55+
query_params = opts[:query_params] || {}
56+
57+
# header parameters
58+
header_params = opts[:header_params] || {}
59+
# HTTP header 'Accept' (if needed)
60+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61+
62+
# form parameters
63+
form_params = opts[:form_params] || {}
64+
65+
# http body (model)
66+
post_body = opts[:debug_body]
67+
68+
# return_type
69+
return_type = opts[:debug_return_type] || 'AWSCloudAuthPersonaMappingsResponse'
70+
71+
# auth_names
72+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
73+
74+
new_options = opts.merge(
75+
:operation => :list_aws_cloud_auth_persona_mappings,
76+
:header_params => header_params,
77+
:query_params => query_params,
78+
:form_params => form_params,
79+
:body => post_body,
80+
:auth_names => auth_names,
81+
:return_type => return_type,
82+
:api_version => "V2"
83+
)
84+
85+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
86+
if @api_client.config.debugging
87+
@api_client.config.logger.debug "API called: CloudAuthenticationAPI#list_aws_cloud_auth_persona_mappings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88+
end
89+
return data, status_code, headers
90+
end
91+
end
92+
end

0 commit comments

Comments
 (0)