From 95a1d0772fb76262c173b19b1f2e9eb5ff6ed051 Mon Sep 17 00:00:00 2001 From: Bryan Apellanes <63638027+bryanapellanes-okta@users.noreply.github.com> Date: Wed, 13 Nov 2024 08:41:24 -0600 Subject: [PATCH] OKTA-821864 authorizationserverpolicy regen (#756) * update IdentityModel components to address vulnerability * explicitly reference System.Text.Json 8.0.5 * fix AuthorizationServerPolicy definition --- .openapi-generator/FILES | 2 + API_README.md | 1 + docs/AuthorizationServerPolicy.md | 10 + docs/AuthorizationServerPolicyStatus.md | 10 + openapi3/management.yaml | 47 ++++ .../Model/AuthorizationServerPolicy.cs | 206 ++++++++++++++++++ .../Model/AuthorizationServerPolicyStatus.cs | 61 ++++++ 7 files changed, 337 insertions(+) create mode 100644 docs/AuthorizationServerPolicyStatus.md create mode 100644 src/Okta.Sdk/Model/AuthorizationServerPolicyStatus.cs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c12929611..9d44d00fa 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -171,6 +171,7 @@ docs/AuthorizationServerPolicyRuleActions.md docs/AuthorizationServerPolicyRuleConditions.md docs/AuthorizationServerPolicyRuleGroupCondition.md docs/AuthorizationServerPolicyRuleUserCondition.md +docs/AuthorizationServerPolicyStatus.md docs/AuthorizationServerRulesApi.md docs/AuthorizationServerScopesApi.md docs/AutoAssignAdminAppSetting.md @@ -1520,6 +1521,7 @@ src/Okta.Sdk/Model/AuthorizationServerPolicyRuleActions.cs src/Okta.Sdk/Model/AuthorizationServerPolicyRuleConditions.cs src/Okta.Sdk/Model/AuthorizationServerPolicyRuleGroupCondition.cs src/Okta.Sdk/Model/AuthorizationServerPolicyRuleUserCondition.cs +src/Okta.Sdk/Model/AuthorizationServerPolicyStatus.cs src/Okta.Sdk/Model/AutoAssignAdminAppSetting.cs src/Okta.Sdk/Model/AutoLoginApplication.cs src/Okta.Sdk/Model/AutoLoginApplicationSettings.cs diff --git a/API_README.md b/API_README.md index 7543985e8..8d7f2ed6f 100644 --- a/API_README.md +++ b/API_README.md @@ -797,6 +797,7 @@ Class | Method | HTTP request | Description - [Model.AuthorizationServerPolicyRuleConditions](docs/AuthorizationServerPolicyRuleConditions.md) - [Model.AuthorizationServerPolicyRuleGroupCondition](docs/AuthorizationServerPolicyRuleGroupCondition.md) - [Model.AuthorizationServerPolicyRuleUserCondition](docs/AuthorizationServerPolicyRuleUserCondition.md) + - [Model.AuthorizationServerPolicyStatus](docs/AuthorizationServerPolicyStatus.md) - [Model.AutoAssignAdminAppSetting](docs/AutoAssignAdminAppSetting.md) - [Model.AutoLoginApplication](docs/AutoLoginApplication.md) - [Model.AutoLoginApplicationAllOf](docs/AutoLoginApplicationAllOf.md) diff --git a/docs/AuthorizationServerPolicy.md b/docs/AuthorizationServerPolicy.md index c1ecbdb6b..251c44f97 100644 --- a/docs/AuthorizationServerPolicy.md +++ b/docs/AuthorizationServerPolicy.md @@ -4,7 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Id** | **string** | ID of the Policy | [optional] +**Type** | **string** | Indicates that the Policy is an authorization server Policy | [optional] +**Name** | **string** | Name of the Policy | [optional] **Conditions** | [**AuthorizationServerPolicyConditions**](AuthorizationServerPolicyConditions.md) | | [optional] +**Description** | **string** | Description of the Policy | [optional] +**Priority** | **int** | Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server | [optional] +**Status** | **AuthorizationServerPolicyStatus** | | [optional] +**System** | **bool** | Specifies whether Okta created this Policy | [optional] +**Created** | **DateTimeOffset** | Timestamp when the Policy was created | [optional] [readonly] +**LastUpdated** | **DateTimeOffset** | Timestamp when the Policy was last updated | [optional] [readonly] +**Links** | [**LinksSelfAndLifecycle**](LinksSelfAndLifecycle.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AuthorizationServerPolicyStatus.md b/docs/AuthorizationServerPolicyStatus.md new file mode 100644 index 000000000..230e21f8c --- /dev/null +++ b/docs/AuthorizationServerPolicyStatus.md @@ -0,0 +1,10 @@ +# Okta.Sdk.Model.AuthorizationServerPolicyStatus +The allowed statuses for the AurhorizationServerPolicy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/openapi3/management.yaml b/openapi3/management.yaml index 897aebc23..426e468a2 100644 --- a/openapi3/management.yaml +++ b/openapi3/management.yaml @@ -32849,6 +32849,12 @@ components: - none - recovery - sso + AuthorizationServerPolicyStatus: + description: The allowed statuses for the AurhorizationServerPolicy + type: string + enum: + - ACTIVE + - INACTIVE ApiToken: title: API Token description: An API token for an Okta User. This token is NOT scoped any further and can be used for any API the user has permissions to call. @@ -34301,8 +34307,49 @@ components: allOf: - type: object properties: + id: + type: string + description: ID of the Policy + type: + type: string + description: Indicates that the Policy is an authorization server Policy + enum: + - OAUTH_AUTHORIZATION_POLICY + name: + type: string + description: Name of the Policy conditions: $ref: '#/components/schemas/AuthorizationServerPolicyConditions' + description: + type: string + description: Description of the Policy + priority: + type: integer + description: Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server + status: + $ref: '#/components/schemas/AuthorizationServerPolicyStatus' + system: + type: boolean + description: Specifies whether Okta created this Policy + created: + type: string + format: date-time + readOnly: true + description: Timestamp when the Policy was created + lastUpdated: + type: string + format: date-time + readOnly: true + description: Timestamp when the Policy was last updated + _links: + allOf: + - $ref: '#/components/schemas/LinksSelfAndLifecycle' + - type: object + properties: + rules: + allOf: + - description: Link to the authorization server policy's rules + - $ref: '#/components/schemas/HrefObject' AuthorizationServerPolicyConditions: type: object properties: diff --git a/src/Okta.Sdk/Model/AuthorizationServerPolicy.cs b/src/Okta.Sdk/Model/AuthorizationServerPolicy.cs index 605a0f5b9..39930d1c6 100644 --- a/src/Okta.Sdk/Model/AuthorizationServerPolicy.cs +++ b/src/Okta.Sdk/Model/AuthorizationServerPolicy.cs @@ -33,13 +33,129 @@ namespace Okta.Sdk.Model public partial class AuthorizationServerPolicy : IEquatable { + /// + /// Indicates that the Policy is an authorization server Policy + /// + /// Indicates that the Policy is an authorization server Policy + [JsonConverter(typeof(StringEnumSerializingConverter))] + public sealed class TypeEnum : StringEnum + { + /// + /// StringEnum OAUTHAUTHORIZATIONPOLICY for value: OAUTH_AUTHORIZATION_POLICY + /// + + public static TypeEnum OAUTHAUTHORIZATIONPOLICY = new TypeEnum("OAUTH_AUTHORIZATION_POLICY"); + + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator TypeEnum(string value) => new TypeEnum(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public TypeEnum(string value) + : base(value) + { + } + } + + + /// + /// Indicates that the Policy is an authorization server Policy + /// + /// Indicates that the Policy is an authorization server Policy + [DataMember(Name = "type", EmitDefaultValue = true)] + public TypeEnum Type { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", EmitDefaultValue = true)] + + public AuthorizationServerPolicyStatus Status { get; set; } + + /// + /// ID of the Policy + /// + /// ID of the Policy + [DataMember(Name = "id", EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Name of the Policy + /// + /// Name of the Policy + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + /// /// Gets or Sets Conditions /// [DataMember(Name = "conditions", EmitDefaultValue = true)] public AuthorizationServerPolicyConditions Conditions { get; set; } + /// + /// Description of the Policy + /// + /// Description of the Policy + [DataMember(Name = "description", EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server + /// + /// Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server + [DataMember(Name = "priority", EmitDefaultValue = true)] + public int Priority { get; set; } + + /// + /// Specifies whether Okta created this Policy + /// + /// Specifies whether Okta created this Policy + [DataMember(Name = "system", EmitDefaultValue = true)] + public bool System { get; set; } + + /// + /// Timestamp when the Policy was created + /// + /// Timestamp when the Policy was created + [DataMember(Name = "created", EmitDefaultValue = true)] + public DateTimeOffset Created { get; private set; } + + /// + /// Returns false as Created should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeCreated() + { + return false; + } + /// + /// Timestamp when the Policy was last updated + /// + /// Timestamp when the Policy was last updated + [DataMember(Name = "lastUpdated", EmitDefaultValue = true)] + public DateTimeOffset LastUpdated { get; private set; } + + /// + /// Returns false as LastUpdated should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeLastUpdated() + { + return false; + } + /// + /// Gets or Sets Links + /// + [DataMember(Name = "_links", EmitDefaultValue = true)] + public LinksSelfAndLifecycle Links { get; set; } + /// /// Returns the string presentation of the object /// @@ -48,7 +164,17 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class AuthorizationServerPolicy {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Conditions: ").Append(Conditions).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Priority: ").Append(Priority).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" System: ").Append(System).Append("\n"); + sb.Append(" Created: ").Append(Created).Append("\n"); + sb.Append(" LastUpdated: ").Append(LastUpdated).Append("\n"); + sb.Append(" Links: ").Append(Links).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -84,10 +210,56 @@ public bool Equals(AuthorizationServerPolicy input) return false; } return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && ( this.Conditions == input.Conditions || (this.Conditions != null && this.Conditions.Equals(input.Conditions)) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.Priority == input.Priority || + this.Priority.Equals(input.Priority) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ) && + ( + this.System == input.System || + this.System.Equals(input.System) + ) && + ( + this.Created == input.Created || + (this.Created != null && + this.Created.Equals(input.Created)) + ) && + ( + this.LastUpdated == input.LastUpdated || + (this.LastUpdated != null && + this.LastUpdated.Equals(input.LastUpdated)) + ) && + ( + this.Links == input.Links || + (this.Links != null && + this.Links.Equals(input.Links)) ); } @@ -101,10 +273,44 @@ public override int GetHashCode() { int hashCode = 41; + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.Conditions != null) { hashCode = (hashCode * 59) + this.Conditions.GetHashCode(); } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Priority.GetHashCode(); + if (this.Status != null) + { + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + } + hashCode = (hashCode * 59) + this.System.GetHashCode(); + if (this.Created != null) + { + hashCode = (hashCode * 59) + this.Created.GetHashCode(); + } + if (this.LastUpdated != null) + { + hashCode = (hashCode * 59) + this.LastUpdated.GetHashCode(); + } + if (this.Links != null) + { + hashCode = (hashCode * 59) + this.Links.GetHashCode(); + } return hashCode; } } diff --git a/src/Okta.Sdk/Model/AuthorizationServerPolicyStatus.cs b/src/Okta.Sdk/Model/AuthorizationServerPolicyStatus.cs new file mode 100644 index 000000000..ad521e901 --- /dev/null +++ b/src/Okta.Sdk/Model/AuthorizationServerPolicyStatus.cs @@ -0,0 +1,61 @@ +/* + * Okta Admin Management + * + * Allows customers to easily access the Okta Management APIs + * + * The version of the OpenAPI document: 2024.07.0 + * Contact: devex-public@okta.com + * Generated by: /~https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Okta.Sdk.Client.OpenAPIDateConverter; + +namespace Okta.Sdk.Model +{ + /// + /// The allowed statuses for the AurhorizationServerPolicy + /// + /// The allowed statuses for the AurhorizationServerPolicy + [JsonConverter(typeof(StringEnumSerializingConverter))] + public sealed class AuthorizationServerPolicyStatus : StringEnum + { + /// + /// StringEnum AuthorizationServerPolicyStatus for value: ACTIVE + /// + public static AuthorizationServerPolicyStatus ACTIVE = new AuthorizationServerPolicyStatus("ACTIVE"); + /// + /// StringEnum AuthorizationServerPolicyStatus for value: INACTIVE + /// + public static AuthorizationServerPolicyStatus INACTIVE = new AuthorizationServerPolicyStatus("INACTIVE"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator AuthorizationServerPolicyStatus(string value) => new AuthorizationServerPolicyStatus(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public AuthorizationServerPolicyStatus(string value) + : base(value) + { + } + } + + +}