Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60208,6 +60208,41 @@ components:
$ref: "#/components/schemas/MaxSessionDurationUpdateData"
required: [data]
type: object
McpCrossAppAccessIssuerUrlType:
description: Data type of an MCP Cross-App Access issuer URL update.
enum: [org_config]
example: org_config
type: string
x-enum-varnames:
- ORG_CONFIG
McpCrossAppAccessIssuerUrlUpdateAttributes:
description: Attributes for the MCP Cross-App Access issuer URL update request.
properties:
issuer_url:
description: |-
The Okta OIDC issuer URL for MCP Cross-App Access, for example
`https://your-subdomain.okta.com`. Provide an empty string to unset
the issuer URL and opt the organization out of MCP Cross-App Access.
example: https://your-subdomain.okta.com
type: string
required: [issuer_url]
type: object
McpCrossAppAccessIssuerUrlUpdateData:
description: The data object for an MCP Cross-App Access issuer URL update request.
properties:
attributes:
$ref: "#/components/schemas/McpCrossAppAccessIssuerUrlUpdateAttributes"
type:
$ref: "#/components/schemas/McpCrossAppAccessIssuerUrlType"
required: [type, attributes]
type: object
McpCrossAppAccessIssuerUrlUpdateRequest:
description: A request to update the MCP Cross-App Access issuer URL for an organization.
properties:
data:
$ref: "#/components/schemas/McpCrossAppAccessIssuerUrlUpdateData"
required: [data]
type: object
McpScanRequest:
description: The top-level request object for submitting an MCP SCA dependency scan.
properties:
Expand Down Expand Up @@ -154159,6 +154194,52 @@ paths:
operator: OR
permissions:
- org_management
/api/v2/login/org_configs/mcp_cross_app_access_issuer_url:
put:
description: |-
Update the Okta OIDC issuer URL used for MCP Cross-App Access (XAA)
for the current organization. The URL must be a bare Okta issuer such
as `https://your-subdomain.okta.com` (no path, port, query, or fragment).
Provide an empty string to unset the issuer URL and opt the organization
out of MCP Cross-App Access.
operationId: UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
issuer_url: https://your-subdomain.okta.com
type: org_config
schema:
$ref: "#/components/schemas/McpCrossAppAccessIssuerUrlUpdateRequest"
required: true
responses:
"204":
description: No Content
"400":
$ref: "#/components/responses/BadRequestResponse"
"401":
$ref: "#/components/responses/UnauthorizedResponse"
"403":
$ref: "#/components/responses/ForbiddenResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- org_management
summary: Update the MCP Cross-App Access issuer URL
tags: [Organizations]
"x-permission":
operator: OR
permissions:
- org_management
x-unstable: |-
**Note**: This endpoint is in Preview and may change in the future. It is not yet recommended for production use.
/api/v2/logs:
post:
description: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Update the MCP Cross-App Access issuer URL returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_organizations::OrganizationsAPI;
use datadog_api_client::datadogV2::model::McpCrossAppAccessIssuerUrlType;
use datadog_api_client::datadogV2::model::McpCrossAppAccessIssuerUrlUpdateAttributes;
use datadog_api_client::datadogV2::model::McpCrossAppAccessIssuerUrlUpdateData;
use datadog_api_client::datadogV2::model::McpCrossAppAccessIssuerUrlUpdateRequest;

#[tokio::main]
async fn main() {
let body =
McpCrossAppAccessIssuerUrlUpdateRequest::new(McpCrossAppAccessIssuerUrlUpdateData::new(
McpCrossAppAccessIssuerUrlUpdateAttributes::new(
"https://your-subdomain.okta.com".to_string(),
),
McpCrossAppAccessIssuerUrlType::ORG_CONFIG,
));
let mut configuration = datadog::Configuration::new();
configuration
.set_unstable_operation_enabled("v2.UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl", true);
let api = OrganizationsAPI::with_config(configuration);
let resp = api
.update_login_org_configs_mcp_cross_app_access_issuer_url(body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
4 changes: 4 additions & 0 deletions src/datadog/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,10 @@ impl Default for Configuration {
("v2.update_form".to_owned(), false),
("v2.upsert_and_publish_form_version".to_owned(), false),
("v2.upsert_form_version".to_owned(), false),
(
"v2.update_login_org_configs_mcp_cross_app_access_issuer_url".to_owned(),
false,
),
("v2.update_org_saml_configurations".to_owned(), false),
("v2.get_governance_control".to_owned(), false),
("v2.list_governance_controls".to_owned(), false),
Expand Down
164 changes: 164 additions & 0 deletions src/datadogV2/api/api_organizations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ pub enum UpdateLoginOrgConfigsMaxSessionDurationError {
UnknownValue(serde_json::Value),
}

/// UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrlError is a struct for typed errors of method [`OrganizationsAPI::update_login_org_configs_mcp_cross_app_access_issuer_url`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrlError {
APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
UnknownValue(serde_json::Value),
}

/// UpdateOrgConfigError is a struct for typed errors of method [`OrganizationsAPI::update_org_config`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -1074,6 +1082,162 @@ impl OrganizationsAPI {
}
}

/// Update the Okta OIDC issuer URL used for MCP Cross-App Access (XAA)
/// for the current organization. The URL must be a bare Okta issuer such
/// as `<https://your-subdomain.okta.com`> (no path, port, query, or fragment).
/// Provide an empty string to unset the issuer URL and opt the organization
/// out of MCP Cross-App Access.
pub async fn update_login_org_configs_mcp_cross_app_access_issuer_url(
&self,
body: crate::datadogV2::model::McpCrossAppAccessIssuerUrlUpdateRequest,
) -> Result<(), datadog::Error<UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrlError>> {
match self
.update_login_org_configs_mcp_cross_app_access_issuer_url_with_http_info(body)
.await
{
Ok(_) => Ok(()),
Err(err) => Err(err),
}
}

/// Update the Okta OIDC issuer URL used for MCP Cross-App Access (XAA)
/// for the current organization. The URL must be a bare Okta issuer such
/// as `<https://your-subdomain.okta.com`> (no path, port, query, or fragment).
/// Provide an empty string to unset the issuer URL and opt the organization
/// out of MCP Cross-App Access.
pub async fn update_login_org_configs_mcp_cross_app_access_issuer_url_with_http_info(
&self,
body: crate::datadogV2::model::McpCrossAppAccessIssuerUrlUpdateRequest,
) -> Result<
datadog::ResponseContent<()>,
datadog::Error<UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrlError>,
> {
let local_configuration = &self.config;
let operation_id = "v2.update_login_org_configs_mcp_cross_app_access_issuer_url";
if local_configuration.is_unstable_operation_enabled(operation_id) {
warn!("Using unstable operation {operation_id}");
} else {
let local_error = datadog::UnstableOperationDisabledError {
msg: "Operation 'v2.update_login_org_configs_mcp_cross_app_access_issuer_url' is not enabled".to_string(),
};
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
}

let local_client = &self.client;

let local_uri_str = format!(
"{}/api/v2/login/org_configs/mcp_cross_app_access_issuer_url",
local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::PUT, local_uri_str.as_str());

// build headers
let mut headers = HeaderMap::new();
headers.insert("Content-Type", HeaderValue::from_static("application/json"));
headers.insert("Accept", HeaderValue::from_static("*/*"));

// build user agent
match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
Err(e) => {
log::warn!("Failed to parse user agent header: {e}, falling back to default");
headers.insert(
reqwest::header::USER_AGENT,
HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
)
}
};

// build auth
if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
headers.insert(
"DD-API-KEY",
HeaderValue::from_str(local_key.key.as_str())
.expect("failed to parse DD-API-KEY header"),
);
};
if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
headers.insert(
"DD-APPLICATION-KEY",
HeaderValue::from_str(local_key.key.as_str())
.expect("failed to parse DD-APPLICATION-KEY header"),
);
};

// build body parameters
let output = Vec::new();
let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
if body.serialize(&mut ser).is_ok() {
if let Some(content_encoding) = headers.get("Content-Encoding") {
match content_encoding.to_str().unwrap_or_default() {
"gzip" => {
let mut enc = GzEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
local_req_builder = local_req_builder.body(buf);
}
Err(e) => return Err(datadog::Error::Io(e)),
}
}
"deflate" => {
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
local_req_builder = local_req_builder.body(buf);
}
Err(e) => return Err(datadog::Error::Io(e)),
}
}
#[cfg(feature = "zstd")]
"zstd1" => {
let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
local_req_builder = local_req_builder.body(buf);
}
Err(e) => return Err(datadog::Error::Io(e)),
}
}
_ => {
local_req_builder = local_req_builder.body(ser.into_inner());
}
}
} else {
local_req_builder = local_req_builder.body(ser.into_inner());
}
}

local_req_builder = local_req_builder.headers(headers);
let local_req = local_req_builder.build()?;
log::debug!("request content: {:?}", local_req.body());
let local_resp = local_client.execute(local_req).await?;

let local_status = local_resp.status();
let local_content = local_resp.text().await?;
log::debug!("response content: {}", local_content);

if !local_status.is_client_error() && !local_status.is_server_error() {
Ok(datadog::ResponseContent {
status: local_status,
content: local_content,
entity: None,
})
} else {
let local_entity: Option<UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrlError> =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
entity: local_entity,
};
Err(datadog::Error::ResponseError(local_error))
}
}

/// Update the value of a specific Org Config.
pub async fn update_org_config(
&self,
Expand Down
8 changes: 8 additions & 0 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6338,6 +6338,14 @@ pub mod model_max_session_duration_update_attributes;
pub use self::model_max_session_duration_update_attributes::MaxSessionDurationUpdateAttributes;
pub mod model_max_session_duration_type;
pub use self::model_max_session_duration_type::MaxSessionDurationType;
pub mod model_mcp_cross_app_access_issuer_url_update_request;
pub use self::model_mcp_cross_app_access_issuer_url_update_request::McpCrossAppAccessIssuerUrlUpdateRequest;
pub mod model_mcp_cross_app_access_issuer_url_update_data;
pub use self::model_mcp_cross_app_access_issuer_url_update_data::McpCrossAppAccessIssuerUrlUpdateData;
pub mod model_mcp_cross_app_access_issuer_url_update_attributes;
pub use self::model_mcp_cross_app_access_issuer_url_update_attributes::McpCrossAppAccessIssuerUrlUpdateAttributes;
pub mod model_mcp_cross_app_access_issuer_url_type;
pub use self::model_mcp_cross_app_access_issuer_url_type::McpCrossAppAccessIssuerUrlType;
pub mod model_content_encoding;
pub use self::model_content_encoding::ContentEncoding;
pub mod model_http_log_item;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[non_exhaustive]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum McpCrossAppAccessIssuerUrlType {
ORG_CONFIG,
UnparsedObject(crate::datadog::UnparsedObject),
}

impl ToString for McpCrossAppAccessIssuerUrlType {
fn to_string(&self) -> String {
match self {
Self::ORG_CONFIG => String::from("org_config"),
Self::UnparsedObject(v) => v.value.to_string(),
}
}
}

impl Serialize for McpCrossAppAccessIssuerUrlType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
match self {
Self::UnparsedObject(v) => v.serialize(serializer),
_ => serializer.serialize_str(self.to_string().as_str()),
}
}
}

impl<'de> Deserialize<'de> for McpCrossAppAccessIssuerUrlType {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
let s: String = String::deserialize(deserializer)?;
Ok(match s.as_str() {
"org_config" => Self::ORG_CONFIG,
_ => Self::UnparsedObject(crate::datadog::UnparsedObject {
value: serde_json::Value::String(s.into()),
}),
})
}
}
Loading
Loading