From 26414d02d96fc7984ac6151b57f827ae61e28c64 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 24 Nov 2026 21:18:28 +0000 Subject: [PATCH] Regenerate client from commit d40ee3e of spec repo --- .generator/schemas/v2/openapi.yaml | 74 ++++++++- .../api/client/v2/api/FeatureFlagsApi.java | 23 ++- .../v2/model/CreateEnvironmentAttributes.java | 101 +++++++++++- .../v2/model/EnvironmentAttributes.java | 95 +++++++++++ .../EnvironmentSubjectAuthorizationState.java | 71 ++++++++ .../v2/model/FeatureFlagEnvironment.java | 95 ++++++++++- .../model/FeatureFlagEnvironmentListItem.java | 96 ++++++++++- .../v2/model/UpdateEnvironmentAttributes.java | 104 +++++++++++- .../api/client/v2/api/feature_flags.feature | 30 ++++ .../test-runner-data/manifest.json | 14 ++ ...provider-returns-bad-request-response.json | 37 +++++ ...provider-returns-bad-request-response.json | 55 +++++++ .../test-server-data/v2/feature-flags.json | 152 +++++++++++++++++- 13 files changed, 930 insertions(+), 17 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v2/model/EnvironmentSubjectAuthorizationState.java create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/create-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/update-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9e9835c3f78..044de9cc75b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -34360,6 +34360,15 @@ components: description: Indicates whether feature flag changes require approval in this environment. example: false type: boolean + subject_authorization_oidc_provider_id: + description: >- + The ID of a Custom OIDC provider, formatted as a nonzero UUID. Required when `subject_authorization_state` is `enabled`. If omitted or `null`, no provider is associated. A non-null ID must be registered in the current organization and site, even when subject authorization is disabled. An unregistered ID returns `400 Bad Request`, and an unavailable registry returns `503 Service Unavailable`. Saving does not verify provider eligibility or key publication. + example: "550e8400-e29b-41d4-a716-446655440003" + format: uuid + nullable: true + type: string + subject_authorization_state: + $ref: "#/components/schemas/EnvironmentSubjectAuthorizationState" required: - name - queries @@ -49837,6 +49846,15 @@ components: description: Indicates whether feature flag changes require approval in this environment. example: false type: boolean + subject_authorization_oidc_provider_id: + description: >- + The associated Custom OIDC provider ID, or `null` when no provider is associated. Disabled environments may retain a provider association. + example: "550e8400-e29b-41d4-a716-446655440003" + format: uuid + nullable: true + type: string + subject_authorization_state: + $ref: "#/components/schemas/EnvironmentSubjectAuthorizationState" updated_at: description: The timestamp when the environment was last updated. example: "2023-01-01T00:00:00Z" @@ -49853,6 +49871,17 @@ components: required: - data type: object + EnvironmentSubjectAuthorizationState: + description: >- + Whether assignment requests for this environment require subject authorization. Allowed values are `disabled` and `enabled`. Enabling requires a provider ID formatted as a nonzero UUID. If omitted on create, defaults to `disabled`. If omitted on update, the stored state is preserved. `null` is not accepted. This setting applies only to the current Datadog site and is not copied to other sites. Before you enable it, configure an eligible Custom OIDC provider in the same organization and site, and verify that the provider's keys are published. Assignment requests fail when the required verification configuration is unavailable. + enum: + - disabled + - enabled + example: disabled + type: string + x-enum-varnames: + - DISABLED + - ENABLED EnvironmentsPaginationMeta: description: Pagination metadata for environments. properties: @@ -62077,6 +62106,14 @@ components: type: boolean status: $ref: "#/components/schemas/FeatureFlagStatus" + subject_authorization_oidc_provider_id: + description: The environment's associated Custom OIDC provider ID, or `null` when no provider is associated. + example: "550e8400-e29b-41d4-a716-446655440003" + format: uuid + nullable: true + type: string + subject_authorization_state: + $ref: "#/components/schemas/EnvironmentSubjectAuthorizationState" required: - environment_id - status @@ -62142,6 +62179,14 @@ components: type: boolean status: $ref: "#/components/schemas/FeatureFlagStatus" + subject_authorization_oidc_provider_id: + description: The environment's associated Custom OIDC provider ID, or `null` when no provider is associated. + example: "550e8400-e29b-41d4-a716-446655440003" + format: uuid + nullable: true + type: string + subject_authorization_state: + $ref: "#/components/schemas/EnvironmentSubjectAuthorizationState" required: - environment_id - status @@ -158469,6 +158514,15 @@ components: Indicates whether feature flag changes require approval in this environment. If omitted, resets to false. Include the existing value to preserve it. example: true type: boolean + subject_authorization_oidc_provider_id: + description: >- + The ID of a Custom OIDC provider, formatted as a nonzero UUID. If omitted, the stored association is preserved. Set to `null` to clear the association, which is allowed only when the resulting `subject_authorization_state` is `disabled`. A new non-null ID must be registered in the current organization and site, even when subject authorization is disabled. An unregistered ID returns `400 Bad Request`, and an unavailable registry returns `503 Service Unavailable`. Omitted, cleared, and unchanged IDs skip this check, including when you enable a retained provider. An ID that matches the stored ID in a different format, such as different letter case, is treated as unchanged. Saving does not verify provider eligibility or key publication. + example: "550e8400-e29b-41d4-a716-446655440003" + format: uuid + nullable: true + type: string + subject_authorization_state: + $ref: "#/components/schemas/EnvironmentSubjectAuthorizationState" type: object UpdateEnvironmentData: description: Data for updating an environment. @@ -197690,7 +197744,9 @@ paths: - feature_flag_environment_config_read post: description: |- - Creates a new environment for organizing feature flags. + Creates an environment for organizing feature flags. A non-null subject authorization provider ID + must be registered in the current organization and site, even when authorization is disabled. An unknown + ID returns `400 Bad Request`; an unavailable registry returns `503 Service Unavailable`. operationId: CreateFeatureFlagsEnvironment requestBody: content: @@ -197725,6 +197781,8 @@ paths: - staging - canary require_feature_flag_approval: false + subject_authorization_oidc_provider_id: + subject_authorization_state: disabled id: 00000000-0000-0000-0000-000000000017 type: environments schema: @@ -197819,6 +197877,8 @@ paths: queries: - staging require_feature_flag_approval: false + subject_authorization_oidc_provider_id: + subject_authorization_state: disabled id: 00000000-0000-0000-0000-000000000018 type: environments schema: @@ -197855,14 +197915,14 @@ paths: Updates an environment's name, DD_ENV values, and settings. - Every request must include `name` and `queries`, even when changing only `observe_full_evaluation_data`. + Every request must include `name` and `queries`, even when changing only subject authorization or evaluation data settings. To preserve the current name and DD_ENV values, get the environment first and include those values in the request. Omitting `is_production` or `require_feature_flag_approval` resets that setting to `false`. - Include their current values to preserve them. Omitting `observe_full_evaluation_data` preserves its current value. + Include their current values to preserve them. Omitting `observe_full_evaluation_data` preserves its current value. Omitting either subject authorization field preserves its stored value. Set `subject_authorization_oidc_provider_id` to `null` to clear the association while subject authorization is disabled. The following requests return `400 Bad Request`: enabling subject authorization without a provider, an unrecognized `subject_authorization_state` value, a malformed or zero UUID provider ID, or an unregistered provider ID. If the provider registry is unavailable, a new provider ID returns `503 Service Unavailable`. Omitted, cleared, or unchanged provider IDs skip the registry check, including when enabling a retained provider. Saving does not verify provider eligibility or key publication, so a successful save does not mean the environment is ready for assignment requests. Concurrent policy changes return `409 Conflict`; reload the environment and retry. operationId: UpdateFeatureFlagsEnvironment parameters: - $ref: "#/components/parameters/environment_id" @@ -197901,6 +197961,8 @@ paths: - production - prod-us require_feature_flag_approval: true + subject_authorization_oidc_provider_id: + subject_authorization_state: disabled id: 00000000-0000-0000-0000-000000000019 type: environments schema: @@ -197924,6 +197986,12 @@ paths: schema: $ref: "#/components/schemas/APIErrorResponse" description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict "429": $ref: "#/components/responses/TooManyRequestsResponse" security: diff --git a/src/main/java/com/datadog/api/client/v2/api/FeatureFlagsApi.java b/src/main/java/com/datadog/api/client/v2/api/FeatureFlagsApi.java index 1f8ed7e484e..8e483a7e7fd 100644 --- a/src/main/java/com/datadog/api/client/v2/api/FeatureFlagsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/FeatureFlagsApi.java @@ -576,7 +576,10 @@ public CompletableFuture createFeatureFlagsEnvironmentAsync } /** - * Creates a new environment for organizing feature flags. + * Creates an environment for organizing feature flags. A non-null subject authorization provider + * ID must be registered in the current organization and site, even when authorization is + * disabled. An unknown ID returns 400 Bad Request; an unavailable registry returns + * 503 Service Unavailable. * * @param body (required) * @return ApiResponse<EnvironmentResponse> @@ -4428,12 +4431,23 @@ public CompletableFuture updateFeatureFlagsEnvironmentAsync * Updates an environment's name, DD_ENV values, and settings. * *

Every request must include name and queries, even when changing - * only observe_full_evaluation_data. To preserve the current name and DD_ENV values, - * get the environment first and include those values in the request. + * only subject authorization or evaluation data settings. To preserve the current name and DD_ENV + * values, get the environment first and include those values in the request. * *

Omitting is_production or require_feature_flag_approval resets * that setting to false. Include their current values to preserve them. Omitting - * observe_full_evaluation_data preserves its current value. + * observe_full_evaluation_data preserves its current value. Omitting either subject + * authorization field preserves its stored value. Set + * subject_authorization_oidc_provider_id to null to clear the association + * while subject authorization is disabled. The following requests return 400 Bad Request + * : enabling subject authorization without a provider, an unrecognized + * subject_authorization_state value, a malformed or zero UUID provider ID, or an + * unregistered provider ID. If the provider registry is unavailable, a new provider ID returns + * 503 Service Unavailable. Omitted, cleared, or unchanged provider IDs skip the + * registry check, including when enabling a retained provider. Saving does not verify provider + * eligibility or key publication, so a successful save does not mean the environment is ready for + * assignment requests. Concurrent policy changes return 409 Conflict; reload the + * environment and retry. * * @param environmentId The ID of the environment. (required) * @param body (required) @@ -4447,6 +4461,7 @@ public CompletableFuture updateFeatureFlagsEnvironmentAsync * 400 Bad Request - * 403 Forbidden - * 404 Not Found - + * 409 Conflict - * 429 Too many requests - * */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateEnvironmentAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateEnvironmentAttributes.java index 2caa69b64a2..0b39babdd12 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateEnvironmentAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateEnvironmentAttributes.java @@ -18,6 +18,8 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; /** Attributes for creating a new environment. */ @JsonPropertyOrder({ @@ -25,7 +27,9 @@ CreateEnvironmentAttributes.JSON_PROPERTY_NAME, CreateEnvironmentAttributes.JSON_PROPERTY_OBSERVE_FULL_EVALUATION_DATA, CreateEnvironmentAttributes.JSON_PROPERTY_QUERIES, - CreateEnvironmentAttributes.JSON_PROPERTY_REQUIRE_FEATURE_FLAG_APPROVAL + CreateEnvironmentAttributes.JSON_PROPERTY_REQUIRE_FEATURE_FLAG_APPROVAL, + CreateEnvironmentAttributes.JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID, + CreateEnvironmentAttributes.JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -48,6 +52,14 @@ public class CreateEnvironmentAttributes { "require_feature_flag_approval"; private Boolean requireFeatureFlagApproval = false; + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID = + "subject_authorization_oidc_provider_id"; + private JsonNullable subjectAuthorizationOidcProviderId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE = + "subject_authorization_state"; + private EnvironmentSubjectAuthorizationState subjectAuthorizationState; + public CreateEnvironmentAttributes() {} @JsonCreator @@ -173,6 +185,80 @@ public void setRequireFeatureFlagApproval(Boolean requireFeatureFlagApproval) { this.requireFeatureFlagApproval = requireFeatureFlagApproval; } + public CreateEnvironmentAttributes subjectAuthorizationOidcProviderId( + UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + return this; + } + + /** + * The ID of a Custom OIDC provider, formatted as a nonzero UUID. Required when + * subject_authorization_state is enabled. If omitted or null, no + * provider is associated. A non-null ID must be registered in the current organization and site, + * even when subject authorization is disabled. An unregistered ID returns 400 Bad Request + * , and an unavailable registry returns 503 Service Unavailable. Saving does + * not verify provider eligibility or key publication. + * + * @return subjectAuthorizationOidcProviderId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public UUID getSubjectAuthorizationOidcProviderId() { + return subjectAuthorizationOidcProviderId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSubjectAuthorizationOidcProviderId_JsonNullable() { + return subjectAuthorizationOidcProviderId; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + public void setSubjectAuthorizationOidcProviderId_JsonNullable( + JsonNullable subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = subjectAuthorizationOidcProviderId; + } + + public void setSubjectAuthorizationOidcProviderId(UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + } + + public CreateEnvironmentAttributes subjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + this.subjectAuthorizationState = subjectAuthorizationState; + this.unparsed |= !subjectAuthorizationState.isValid(); + return this; + } + + /** + * Whether assignment requests for this environment require subject authorization. Allowed values + * are disabled and enabled. Enabling requires a provider ID formatted + * as a nonzero UUID. If omitted on create, defaults to disabled. If omitted on + * update, the stored state is preserved. null is not accepted. This setting applies + * only to the current Datadog site and is not copied to other sites. Before you enable it, + * configure an eligible Custom OIDC provider in the same organization and site, and verify that + * the provider's keys are published. Assignment requests fail when the required verification + * configuration is unavailable. + * + * @return subjectAuthorizationState + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnvironmentSubjectAuthorizationState getSubjectAuthorizationState() { + return subjectAuthorizationState; + } + + public void setSubjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + if (!subjectAuthorizationState.isValid()) { + this.unparsed = true; + } + this.subjectAuthorizationState = subjectAuthorizationState; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -236,6 +322,11 @@ public boolean equals(Object o) { && Objects.equals(this.queries, createEnvironmentAttributes.queries) && Objects.equals( this.requireFeatureFlagApproval, createEnvironmentAttributes.requireFeatureFlagApproval) + && Objects.equals( + this.subjectAuthorizationOidcProviderId, + createEnvironmentAttributes.subjectAuthorizationOidcProviderId) + && Objects.equals( + this.subjectAuthorizationState, createEnvironmentAttributes.subjectAuthorizationState) && Objects.equals( this.additionalProperties, createEnvironmentAttributes.additionalProperties); } @@ -248,6 +339,8 @@ public int hashCode() { observeFullEvaluationData, queries, requireFeatureFlagApproval, + subjectAuthorizationOidcProviderId, + subjectAuthorizationState, additionalProperties); } @@ -264,6 +357,12 @@ public String toString() { sb.append(" requireFeatureFlagApproval: ") .append(toIndentedString(requireFeatureFlagApproval)) .append("\n"); + sb.append(" subjectAuthorizationOidcProviderId: ") + .append(toIndentedString(subjectAuthorizationOidcProviderId)) + .append("\n"); + sb.append(" subjectAuthorizationState: ") + .append(toIndentedString(subjectAuthorizationState)) + .append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/EnvironmentAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EnvironmentAttributes.java index 79a68a8dace..8d631e967b0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EnvironmentAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/EnvironmentAttributes.java @@ -19,6 +19,8 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; /** Attributes of an environment. */ @JsonPropertyOrder({ @@ -28,6 +30,8 @@ EnvironmentAttributes.JSON_PROPERTY_OBSERVE_FULL_EVALUATION_DATA, EnvironmentAttributes.JSON_PROPERTY_QUERIES, EnvironmentAttributes.JSON_PROPERTY_REQUIRE_FEATURE_FLAG_APPROVAL, + EnvironmentAttributes.JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID, + EnvironmentAttributes.JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE, EnvironmentAttributes.JSON_PROPERTY_UPDATED_AT }) @jakarta.annotation.Generated( @@ -54,6 +58,14 @@ public class EnvironmentAttributes { "require_feature_flag_approval"; private Boolean requireFeatureFlagApproval; + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID = + "subject_authorization_oidc_provider_id"; + private JsonNullable subjectAuthorizationOidcProviderId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE = + "subject_authorization_state"; + private EnvironmentSubjectAuthorizationState subjectAuthorizationState; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; private OffsetDateTime updatedAt; @@ -199,6 +211,76 @@ public void setRequireFeatureFlagApproval(Boolean requireFeatureFlagApproval) { this.requireFeatureFlagApproval = requireFeatureFlagApproval; } + public EnvironmentAttributes subjectAuthorizationOidcProviderId( + UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + return this; + } + + /** + * The associated Custom OIDC provider ID, or null when no provider is associated. + * Disabled environments may retain a provider association. + * + * @return subjectAuthorizationOidcProviderId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public UUID getSubjectAuthorizationOidcProviderId() { + return subjectAuthorizationOidcProviderId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSubjectAuthorizationOidcProviderId_JsonNullable() { + return subjectAuthorizationOidcProviderId; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + public void setSubjectAuthorizationOidcProviderId_JsonNullable( + JsonNullable subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = subjectAuthorizationOidcProviderId; + } + + public void setSubjectAuthorizationOidcProviderId(UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + } + + public EnvironmentAttributes subjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + this.subjectAuthorizationState = subjectAuthorizationState; + this.unparsed |= !subjectAuthorizationState.isValid(); + return this; + } + + /** + * Whether assignment requests for this environment require subject authorization. Allowed values + * are disabled and enabled. Enabling requires a provider ID formatted + * as a nonzero UUID. If omitted on create, defaults to disabled. If omitted on + * update, the stored state is preserved. null is not accepted. This setting applies + * only to the current Datadog site and is not copied to other sites. Before you enable it, + * configure an eligible Custom OIDC provider in the same organization and site, and verify that + * the provider's keys are published. Assignment requests fail when the required verification + * configuration is unavailable. + * + * @return subjectAuthorizationState + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnvironmentSubjectAuthorizationState getSubjectAuthorizationState() { + return subjectAuthorizationState; + } + + public void setSubjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + if (!subjectAuthorizationState.isValid()) { + this.unparsed = true; + } + this.subjectAuthorizationState = subjectAuthorizationState; + } + public EnvironmentAttributes updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; return this; @@ -284,6 +366,11 @@ public boolean equals(Object o) { && Objects.equals(this.queries, environmentAttributes.queries) && Objects.equals( this.requireFeatureFlagApproval, environmentAttributes.requireFeatureFlagApproval) + && Objects.equals( + this.subjectAuthorizationOidcProviderId, + environmentAttributes.subjectAuthorizationOidcProviderId) + && Objects.equals( + this.subjectAuthorizationState, environmentAttributes.subjectAuthorizationState) && Objects.equals(this.updatedAt, environmentAttributes.updatedAt) && Objects.equals(this.additionalProperties, environmentAttributes.additionalProperties); } @@ -297,6 +384,8 @@ public int hashCode() { observeFullEvaluationData, queries, requireFeatureFlagApproval, + subjectAuthorizationOidcProviderId, + subjectAuthorizationState, updatedAt, additionalProperties); } @@ -315,6 +404,12 @@ public String toString() { sb.append(" requireFeatureFlagApproval: ") .append(toIndentedString(requireFeatureFlagApproval)) .append("\n"); + sb.append(" subjectAuthorizationOidcProviderId: ") + .append(toIndentedString(subjectAuthorizationOidcProviderId)) + .append("\n"); + sb.append(" subjectAuthorizationState: ") + .append(toIndentedString(subjectAuthorizationState)) + .append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/EnvironmentSubjectAuthorizationState.java b/src/main/java/com/datadog/api/client/v2/model/EnvironmentSubjectAuthorizationState.java new file mode 100644 index 00000000000..a1840c3079c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EnvironmentSubjectAuthorizationState.java @@ -0,0 +1,71 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Whether assignment requests for this environment require subject authorization. Allowed values + * are disabled and enabled. Enabling requires a provider ID formatted as + * a nonzero UUID. If omitted on create, defaults to disabled. If omitted on update, + * the stored state is preserved. null is not accepted. This setting applies only to + * the current Datadog site and is not copied to other sites. Before you enable it, configure an + * eligible Custom OIDC provider in the same organization and site, and verify that the provider's + * keys are published. Assignment requests fail when the required verification configuration is + * unavailable. + */ +@JsonSerialize( + using = + EnvironmentSubjectAuthorizationState.EnvironmentSubjectAuthorizationStateSerializer.class) +public class EnvironmentSubjectAuthorizationState extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("disabled", "enabled")); + + public static final EnvironmentSubjectAuthorizationState DISABLED = + new EnvironmentSubjectAuthorizationState("disabled"); + public static final EnvironmentSubjectAuthorizationState ENABLED = + new EnvironmentSubjectAuthorizationState("enabled"); + + EnvironmentSubjectAuthorizationState(String value) { + super(value, allowedValues); + } + + public static class EnvironmentSubjectAuthorizationStateSerializer + extends StdSerializer { + public EnvironmentSubjectAuthorizationStateSerializer( + Class t) { + super(t); + } + + public EnvironmentSubjectAuthorizationStateSerializer() { + this(null); + } + + @Override + public void serialize( + EnvironmentSubjectAuthorizationState value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EnvironmentSubjectAuthorizationState fromValue(String value) { + return new EnvironmentSubjectAuthorizationState(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FeatureFlagEnvironment.java b/src/main/java/com/datadog/api/client/v2/model/FeatureFlagEnvironment.java index bdf9dddd778..fe231f9a4d0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FeatureFlagEnvironment.java +++ b/src/main/java/com/datadog/api/client/v2/model/FeatureFlagEnvironment.java @@ -35,7 +35,9 @@ FeatureFlagEnvironment.JSON_PROPERTY_OVERRIDE_VARIANT_ID, FeatureFlagEnvironment.JSON_PROPERTY_PENDING_SUGGESTION_ID, FeatureFlagEnvironment.JSON_PROPERTY_REQUIRE_FEATURE_FLAG_APPROVAL, - FeatureFlagEnvironment.JSON_PROPERTY_STATUS + FeatureFlagEnvironment.JSON_PROPERTY_STATUS, + FeatureFlagEnvironment.JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID, + FeatureFlagEnvironment.JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -83,6 +85,14 @@ public class FeatureFlagEnvironment { public static final String JSON_PROPERTY_STATUS = "status"; private FeatureFlagStatus status; + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID = + "subject_authorization_oidc_provider_id"; + private JsonNullable subjectAuthorizationOidcProviderId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE = + "subject_authorization_state"; + private EnvironmentSubjectAuthorizationState subjectAuthorizationState; + public FeatureFlagEnvironment() {} @JsonCreator @@ -436,6 +446,76 @@ public void setStatus(FeatureFlagStatus status) { this.status = status; } + public FeatureFlagEnvironment subjectAuthorizationOidcProviderId( + UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + return this; + } + + /** + * The environment's associated Custom OIDC provider ID, or null when no provider is + * associated. + * + * @return subjectAuthorizationOidcProviderId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public UUID getSubjectAuthorizationOidcProviderId() { + return subjectAuthorizationOidcProviderId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSubjectAuthorizationOidcProviderId_JsonNullable() { + return subjectAuthorizationOidcProviderId; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + public void setSubjectAuthorizationOidcProviderId_JsonNullable( + JsonNullable subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = subjectAuthorizationOidcProviderId; + } + + public void setSubjectAuthorizationOidcProviderId(UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + } + + public FeatureFlagEnvironment subjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + this.subjectAuthorizationState = subjectAuthorizationState; + this.unparsed |= !subjectAuthorizationState.isValid(); + return this; + } + + /** + * Whether assignment requests for this environment require subject authorization. Allowed values + * are disabled and enabled. Enabling requires a provider ID formatted + * as a nonzero UUID. If omitted on create, defaults to disabled. If omitted on + * update, the stored state is preserved. null is not accepted. This setting applies + * only to the current Datadog site and is not copied to other sites. Before you enable it, + * configure an eligible Custom OIDC provider in the same organization and site, and verify that + * the provider's keys are published. Assignment requests fail when the required verification + * configuration is unavailable. + * + * @return subjectAuthorizationState + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnvironmentSubjectAuthorizationState getSubjectAuthorizationState() { + return subjectAuthorizationState; + } + + public void setSubjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + if (!subjectAuthorizationState.isValid()) { + this.unparsed = true; + } + this.subjectAuthorizationState = subjectAuthorizationState; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -507,6 +587,11 @@ public boolean equals(Object o) { && Objects.equals( this.requireFeatureFlagApproval, featureFlagEnvironment.requireFeatureFlagApproval) && Objects.equals(this.status, featureFlagEnvironment.status) + && Objects.equals( + this.subjectAuthorizationOidcProviderId, + featureFlagEnvironment.subjectAuthorizationOidcProviderId) + && Objects.equals( + this.subjectAuthorizationState, featureFlagEnvironment.subjectAuthorizationState) && Objects.equals(this.additionalProperties, featureFlagEnvironment.additionalProperties); } @@ -526,6 +611,8 @@ public int hashCode() { pendingSuggestionId, requireFeatureFlagApproval, status, + subjectAuthorizationOidcProviderId, + subjectAuthorizationState, additionalProperties); } @@ -556,6 +643,12 @@ public String toString() { .append(toIndentedString(requireFeatureFlagApproval)) .append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" subjectAuthorizationOidcProviderId: ") + .append(toIndentedString(subjectAuthorizationOidcProviderId)) + .append("\n"); + sb.append(" subjectAuthorizationState: ") + .append(toIndentedString(subjectAuthorizationState)) + .append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/FeatureFlagEnvironmentListItem.java b/src/main/java/com/datadog/api/client/v2/model/FeatureFlagEnvironmentListItem.java index ed2d404d46b..9ea75b984a6 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FeatureFlagEnvironmentListItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/FeatureFlagEnvironmentListItem.java @@ -34,7 +34,9 @@ FeatureFlagEnvironmentListItem.JSON_PROPERTY_OVERRIDE_VARIANT_ID, FeatureFlagEnvironmentListItem.JSON_PROPERTY_PENDING_SUGGESTION_ID, FeatureFlagEnvironmentListItem.JSON_PROPERTY_REQUIRE_FEATURE_FLAG_APPROVAL, - FeatureFlagEnvironmentListItem.JSON_PROPERTY_STATUS + FeatureFlagEnvironmentListItem.JSON_PROPERTY_STATUS, + FeatureFlagEnvironmentListItem.JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID, + FeatureFlagEnvironmentListItem.JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -78,6 +80,14 @@ public class FeatureFlagEnvironmentListItem { public static final String JSON_PROPERTY_STATUS = "status"; private FeatureFlagStatus status; + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID = + "subject_authorization_oidc_provider_id"; + private JsonNullable subjectAuthorizationOidcProviderId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE = + "subject_authorization_state"; + private EnvironmentSubjectAuthorizationState subjectAuthorizationState; + public FeatureFlagEnvironmentListItem() {} @JsonCreator @@ -390,6 +400,76 @@ public void setStatus(FeatureFlagStatus status) { this.status = status; } + public FeatureFlagEnvironmentListItem subjectAuthorizationOidcProviderId( + UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + return this; + } + + /** + * The environment's associated Custom OIDC provider ID, or null when no provider is + * associated. + * + * @return subjectAuthorizationOidcProviderId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public UUID getSubjectAuthorizationOidcProviderId() { + return subjectAuthorizationOidcProviderId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSubjectAuthorizationOidcProviderId_JsonNullable() { + return subjectAuthorizationOidcProviderId; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + public void setSubjectAuthorizationOidcProviderId_JsonNullable( + JsonNullable subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = subjectAuthorizationOidcProviderId; + } + + public void setSubjectAuthorizationOidcProviderId(UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + } + + public FeatureFlagEnvironmentListItem subjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + this.subjectAuthorizationState = subjectAuthorizationState; + this.unparsed |= !subjectAuthorizationState.isValid(); + return this; + } + + /** + * Whether assignment requests for this environment require subject authorization. Allowed values + * are disabled and enabled. Enabling requires a provider ID formatted + * as a nonzero UUID. If omitted on create, defaults to disabled. If omitted on + * update, the stored state is preserved. null is not accepted. This setting applies + * only to the current Datadog site and is not copied to other sites. Before you enable it, + * configure an eligible Custom OIDC provider in the same organization and site, and verify that + * the provider's keys are published. Assignment requests fail when the required verification + * configuration is unavailable. + * + * @return subjectAuthorizationState + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnvironmentSubjectAuthorizationState getSubjectAuthorizationState() { + return subjectAuthorizationState; + } + + public void setSubjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + if (!subjectAuthorizationState.isValid()) { + this.unparsed = true; + } + this.subjectAuthorizationState = subjectAuthorizationState; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -467,6 +547,12 @@ public boolean equals(Object o) { this.requireFeatureFlagApproval, featureFlagEnvironmentListItem.requireFeatureFlagApproval) && Objects.equals(this.status, featureFlagEnvironmentListItem.status) + && Objects.equals( + this.subjectAuthorizationOidcProviderId, + featureFlagEnvironmentListItem.subjectAuthorizationOidcProviderId) + && Objects.equals( + this.subjectAuthorizationState, + featureFlagEnvironmentListItem.subjectAuthorizationState) && Objects.equals( this.additionalProperties, featureFlagEnvironmentListItem.additionalProperties); } @@ -486,6 +572,8 @@ public int hashCode() { pendingSuggestionId, requireFeatureFlagApproval, status, + subjectAuthorizationOidcProviderId, + subjectAuthorizationState, additionalProperties); } @@ -515,6 +603,12 @@ public String toString() { .append(toIndentedString(requireFeatureFlagApproval)) .append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" subjectAuthorizationOidcProviderId: ") + .append(toIndentedString(subjectAuthorizationOidcProviderId)) + .append("\n"); + sb.append(" subjectAuthorizationState: ") + .append(toIndentedString(subjectAuthorizationState)) + .append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateEnvironmentAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateEnvironmentAttributes.java index d901bf74260..11dcfd0aee4 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UpdateEnvironmentAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateEnvironmentAttributes.java @@ -17,6 +17,8 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; /** Attributes for updating an environment. */ @JsonPropertyOrder({ @@ -24,7 +26,9 @@ UpdateEnvironmentAttributes.JSON_PROPERTY_NAME, UpdateEnvironmentAttributes.JSON_PROPERTY_OBSERVE_FULL_EVALUATION_DATA, UpdateEnvironmentAttributes.JSON_PROPERTY_QUERIES, - UpdateEnvironmentAttributes.JSON_PROPERTY_REQUIRE_FEATURE_FLAG_APPROVAL + UpdateEnvironmentAttributes.JSON_PROPERTY_REQUIRE_FEATURE_FLAG_APPROVAL, + UpdateEnvironmentAttributes.JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID, + UpdateEnvironmentAttributes.JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -47,6 +51,14 @@ public class UpdateEnvironmentAttributes { "require_feature_flag_approval"; private Boolean requireFeatureFlagApproval; + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID = + "subject_authorization_oidc_provider_id"; + private JsonNullable subjectAuthorizationOidcProviderId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE = + "subject_authorization_state"; + private EnvironmentSubjectAuthorizationState subjectAuthorizationState; + public UpdateEnvironmentAttributes isProduction(Boolean isProduction) { this.isProduction = isProduction; return this; @@ -169,6 +181,83 @@ public void setRequireFeatureFlagApproval(Boolean requireFeatureFlagApproval) { this.requireFeatureFlagApproval = requireFeatureFlagApproval; } + public UpdateEnvironmentAttributes subjectAuthorizationOidcProviderId( + UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + return this; + } + + /** + * The ID of a Custom OIDC provider, formatted as a nonzero UUID. If omitted, the stored + * association is preserved. Set to null to clear the association, which is allowed + * only when the resulting subject_authorization_state is disabled. A + * new non-null ID must be registered in the current organization and site, even when subject + * authorization is disabled. An unregistered ID returns 400 Bad Request, and an + * unavailable registry returns 503 Service Unavailable. Omitted, cleared, and + * unchanged IDs skip this check, including when you enable a retained provider. An ID that + * matches the stored ID in a different format, such as different letter case, is treated as + * unchanged. Saving does not verify provider eligibility or key publication. + * + * @return subjectAuthorizationOidcProviderId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public UUID getSubjectAuthorizationOidcProviderId() { + return subjectAuthorizationOidcProviderId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSubjectAuthorizationOidcProviderId_JsonNullable() { + return subjectAuthorizationOidcProviderId; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_OIDC_PROVIDER_ID) + public void setSubjectAuthorizationOidcProviderId_JsonNullable( + JsonNullable subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = subjectAuthorizationOidcProviderId; + } + + public void setSubjectAuthorizationOidcProviderId(UUID subjectAuthorizationOidcProviderId) { + this.subjectAuthorizationOidcProviderId = + JsonNullable.of(subjectAuthorizationOidcProviderId); + } + + public UpdateEnvironmentAttributes subjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + this.subjectAuthorizationState = subjectAuthorizationState; + this.unparsed |= !subjectAuthorizationState.isValid(); + return this; + } + + /** + * Whether assignment requests for this environment require subject authorization. Allowed values + * are disabled and enabled. Enabling requires a provider ID formatted + * as a nonzero UUID. If omitted on create, defaults to disabled. If omitted on + * update, the stored state is preserved. null is not accepted. This setting applies + * only to the current Datadog site and is not copied to other sites. Before you enable it, + * configure an eligible Custom OIDC provider in the same organization and site, and verify that + * the provider's keys are published. Assignment requests fail when the required verification + * configuration is unavailable. + * + * @return subjectAuthorizationState + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_AUTHORIZATION_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnvironmentSubjectAuthorizationState getSubjectAuthorizationState() { + return subjectAuthorizationState; + } + + public void setSubjectAuthorizationState( + EnvironmentSubjectAuthorizationState subjectAuthorizationState) { + if (!subjectAuthorizationState.isValid()) { + this.unparsed = true; + } + this.subjectAuthorizationState = subjectAuthorizationState; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -232,6 +321,11 @@ public boolean equals(Object o) { && Objects.equals(this.queries, updateEnvironmentAttributes.queries) && Objects.equals( this.requireFeatureFlagApproval, updateEnvironmentAttributes.requireFeatureFlagApproval) + && Objects.equals( + this.subjectAuthorizationOidcProviderId, + updateEnvironmentAttributes.subjectAuthorizationOidcProviderId) + && Objects.equals( + this.subjectAuthorizationState, updateEnvironmentAttributes.subjectAuthorizationState) && Objects.equals( this.additionalProperties, updateEnvironmentAttributes.additionalProperties); } @@ -244,6 +338,8 @@ public int hashCode() { observeFullEvaluationData, queries, requireFeatureFlagApproval, + subjectAuthorizationOidcProviderId, + subjectAuthorizationState, additionalProperties); } @@ -260,6 +356,12 @@ public String toString() { sb.append(" requireFeatureFlagApproval: ") .append(toIndentedString(requireFeatureFlagApproval)) .append("\n"); + sb.append(" subjectAuthorizationOidcProviderId: ") + .append(toIndentedString(subjectAuthorizationOidcProviderId)) + .append("\n"); + sb.append(" subjectAuthorizationState: ") + .append(toIndentedString(subjectAuthorizationState)) + .append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature b/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature index a76c57b36a7..2134de4fd3c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature @@ -126,6 +126,8 @@ Feature: Feature Flags When the request is sent Then the response status is 201 Created And the response "data.attributes.observe_full_evaluation_data" is equal to false + And the response "data.attributes.subject_authorization_state" is equal to "disabled" + And the response "data.attributes.subject_authorization_oidc_provider_id" is equal to null @team:ddoghq/feature-flags Scenario: Create an environment with full evaluation data false returns "Created" response @@ -143,6 +145,15 @@ Feature: Feature Flags Then the response status is 201 Created And the response "data.attributes.observe_full_evaluation_data" is equal to true + @team:ddoghq/feature-flags + Scenario: Create an environment with subject authorization enabled without a provider returns "Bad Request" response + Given new "CreateFeatureFlagsEnvironment" request + And body with value {"data": {"type": "environments", "attributes": {"name": "Subject Authorization {{ unique }}", "queries": ["auth-{{ unique_lower }}"], "subject_authorization_state": "enabled"}}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors[0].status" is equal to "400" + And the response "errors[0].title" is equal to "Bad Request" + @generated @skip @team:ddoghq/feature-flags Scenario: Create targeting rules for a flag env returns "Accepted - Approval required for this change" response Given new "CreateAllocationsForFeatureFlagInEnvironment" request @@ -1194,6 +1205,14 @@ Feature: Feature Flags And the response "errors[0].status" is equal to "400" And the response "errors[0].title" is equal to "Bad Request" + @generated @skip @team:ddoghq/feature-flags + Scenario: Update an environment returns "Conflict" response + Given new "UpdateFeatureFlagsEnvironment" request + And request contains "environment_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"is_production": false, "name": "Environment XYZ789", "observe_full_evaluation_data": true, "queries": ["staging", "test"], "require_feature_flag_approval": true, "subject_authorization_oidc_provider_id": "550e8400-e29b-41d4-a716-446655440003", "subject_authorization_state": "disabled"}, "type": "environments"}} + When the request is sent + Then the response status is 409 Conflict + @team:ddoghq/feature-flags Scenario: Update an environment returns "Not Found" response Given new "UpdateFeatureFlagsEnvironment" request @@ -1255,6 +1274,17 @@ Feature: Feature Flags And the response "data.attributes.is_production" is equal to false And the response "data.attributes.require_feature_flag_approval" is equal to false + @team:ddoghq/feature-flags + Scenario: Update an environment with subject authorization enabled without a provider returns "Bad Request" response + Given there is a valid "environment" in the system + And new "UpdateFeatureFlagsEnvironment" request + And request contains "environment_id" parameter from "environment.data.id" + And body with value {"data": {"type": "environments", "attributes": {"name": "{{ environment.data.attributes.name }}", "queries": ["{{ environment.data.attributes.queries[0] }}", "{{ environment.data.attributes.queries[1] }}"], "subject_authorization_state": "enabled"}}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors[0].status" is equal to "400" + And the response "errors[0].title" is equal to "Bad Request" + @team:ddoghq/feature-flags Scenario: Update an environment without a name returns "Bad Request" response Given there is a valid "environment" in the system diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index 2d30f82bcdc..c26bcca145b 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -6538,6 +6538,13 @@ "scenario": "Create an environment with full evaluation data true returns \"Created\" response", "version": "v2" }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/create-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json", + "scenario": "Create an environment with subject authorization enabled without a provider returns \"Bad Request\" response", + "version": "v2" + }, { "feature": "Feature Flags", "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", @@ -6916,6 +6923,13 @@ "scenario": "Update an environment to preserve enabled full evaluation data when omitted returns \"OK\" response", "version": "v2" }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/update-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json", + "scenario": "Update an environment with subject authorization enabled without a provider returns \"Bad Request\" response", + "version": "v2" + }, { "feature": "Feature Flags", "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/create-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/create-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json new file mode 100644 index 00000000000..636769ddcf3 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/create-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json @@ -0,0 +1,37 @@ +{ + "api": "FeatureFlags", + "expected_status": 400, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Create an environment with subject authorization enabled without a provider returns \"Bad Request\" response", + "operation_id": "CreateFeatureFlagsEnvironment", + "request": { + "body": { + "schema": { + "format": null, + "ref": "CreateEnvironmentRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "name": "Subject Authorization {{ unique }}", + "queries": [ + "auth-{{ unique_lower }}" + ], + "subject_authorization_state": "enabled" + }, + "type": "environments" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v2/feature-flags/environments" + }, + "scenario": "Create an environment with subject authorization enabled without a provider returns \"Bad Request\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/update-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/update-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json new file mode 100644 index 00000000000..4eb6d182908 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/update-an-environment-with-subject-authorization-enabled-without-a-provider-returns-bad-request-response.json @@ -0,0 +1,55 @@ +{ + "api": "FeatureFlags", + "expected_status": 400, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Update an environment with subject authorization enabled without a provider returns \"Bad Request\" response", + "operation_id": "UpdateFeatureFlagsEnvironment", + "request": { + "body": { + "schema": { + "format": null, + "ref": "UpdateEnvironmentRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "name": "{{ environment.data.attributes.name }}", + "queries": [ + "{{ environment.data.attributes.queries[0] }}", + "{{ environment.data.attributes.queries[1] }}" + ], + "subject_authorization_state": "enabled" + }, + "type": "environments" + } + } + }, + "content_type": "application/json", + "method": "PUT", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "environment_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "environment.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/environments/{environment_id}" + }, + "scenario": "Update an environment with subject authorization enabled without a provider returns \"Bad Request\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-server-data/v2/feature-flags.json b/src/test/resources/generated-test/test-server-data/v2/feature-flags.json index 317e9f4da6a..e8c1bcfb6ef 100644 --- a/src/test/resources/generated-test/test-server-data/v2/feature-flags.json +++ b/src/test/resources/generated-test/test-server-data/v2/feature-flags.json @@ -516,7 +516,7 @@ }, { "feature": "Feature Flags", - "frozen_at": "2026-11-06T02:45:02.026Z", + "frozen_at": "2026-11-24T17:28:57.456Z", "interactions": [ { "request": { @@ -525,10 +525,10 @@ "value": { "data": { "attributes": { - "name": "Test Environment Test-Create_an_environment_returns_Created_response-1793933102", + "name": "Test Environment Test-Create_an_environment_returns_Created_response-1795541337", "queries": [ - "test-Test-Create_an_environment_returns_Created_response-1793933102", - "env-Test-Create_an_environment_returns_Created_response-1793933102" + "test-Test-Create_an_environment_returns_Created_response-1795541337", + "env-Test-Create_an_environment_returns_Created_response-1795541337" ] }, "type": "environments" @@ -543,7 +543,7 @@ "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"c149b1d8-a53a-45da-ac06-69b43a15291e\",\"type\":\"environments\",\"attributes\":{\"is_production\":false,\"name\":\"Test Environment Test-Create_an_environment_returns_Created_response-1793933102\",\"observe_full_evaluation_data\":false,\"queries\":[\"test-Test-Create_an_environment_returns_Created_response-1793933102\",\"env-Test-Create_an_environment_returns_Created_response-1793933102\"],\"require_feature_flag_approval\":false}}}" + "value": "{\"data\":{\"id\":\"1a20c202-4283-4d41-80cc-9cd7ab96adff\",\"type\":\"environments\",\"attributes\":{\"is_production\":false,\"name\":\"Test Environment Test-Create_an_environment_returns_Created_response-1795541337\",\"observe_full_evaluation_data\":false,\"queries\":[\"test-Test-Create_an_environment_returns_Created_response-1795541337\",\"env-Test-Create_an_environment_returns_Created_response-1795541337\"],\"require_feature_flag_approval\":false,\"subject_authorization_oidc_provider_id\":null,\"subject_authorization_state\":\"disabled\"}}}" }, "headers": { "content-type": "application/vnd.api+json" @@ -560,7 +560,7 @@ }, "content_type": "", "method": "DELETE", - "path": "/api/v2/feature-flags/environments/c149b1d8-a53a-45da-ac06-69b43a15291e", + "path": "/api/v2/feature-flags/environments/1a20c202-4283-4d41-80cc-9cd7ab96adff", "query": [] }, "response": { @@ -703,6 +703,48 @@ "scenario": "Create an environment with full evaluation data true returns \"Created\" response", "version": "v2" }, + { + "feature": "Feature Flags", + "frozen_at": "2026-11-24T17:28:59.030Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "Subject Authorization Test-Create_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541339", + "queries": [ + "auth-test-create_an_environment_with_subject_authorization_enabled_without_a_provider_returns_bad_request_resp-1795541339" + ], + "subject_authorization_state": "enabled" + }, + "type": "environments" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/feature-flags/environments", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"Enabling subject authorization requires subject_authorization_oidc_provider_id\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + } + ], + "scenario": "Create an environment with subject authorization enabled without a provider returns \"Bad Request\" response", + "version": "v2" + }, { "feature": "Feature Flags", "frozen_at": "2026-11-06T02:45:25.325Z", @@ -6106,6 +6148,104 @@ "scenario": "Update an environment to preserve enabled full evaluation data when omitted returns \"OK\" response", "version": "v2" }, + { + "feature": "Feature Flags", + "frozen_at": "2026-11-24T17:29:00.998Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "Test Environment Test-Update_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541340", + "queries": [ + "test-Test-Update_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541340", + "env-Test-Update_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541340" + ] + }, + "type": "environments" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/feature-flags/environments", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"a3ce9fb3-2d85-4fce-a9db-6fd694973d4c\",\"type\":\"environments\",\"attributes\":{\"is_production\":false,\"name\":\"Test Environment Test-Update_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541340\",\"observe_full_evaluation_data\":false,\"queries\":[\"test-Test-Update_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541340\",\"env-Test-Update_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541340\"],\"require_feature_flag_approval\":false,\"subject_authorization_oidc_provider_id\":null,\"subject_authorization_state\":\"disabled\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "Test Environment Test-Update_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541340", + "queries": [ + "test-Test-Update_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541340", + "env-Test-Update_an_environment_with_subject_authorization_enabled_without_a_provider_returns_Bad_Request_resp-1795541340" + ], + "subject_authorization_state": "enabled" + }, + "type": "environments" + } + } + }, + "content_type": "application/json", + "method": "PUT", + "path": "/api/v2/feature-flags/environments/a3ce9fb3-2d85-4fce-a9db-6fd694973d4c", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"Enabling subject authorization requires subject_authorization_oidc_provider_id\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/feature-flags/environments/a3ce9fb3-2d85-4fce-a9db-6fd694973d4c", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Update an environment with subject authorization enabled without a provider returns \"Bad Request\" response", + "version": "v2" + }, { "feature": "Feature Flags", "frozen_at": "2026-11-06T02:46:07.867Z",