Skip to content

Commit 547f0ff

Browse files
authored
Fix 11 issues in Okta Java SDK (#1668)
* Fix 11 issues in Okta Java SDK - Fix #1615/#1667: Change LinksResend.resend to array type (List<HrefObject>) - Fix #1618: Add type validation for cached objects to prevent ClassCastException - Fix #1619: Set default name for OIDCApplicationBuilder to OIDC_CLIENT - Fix #1622: Correct expirePasswordWithTempPassword return type to TempPassword - Fix #1642: Enable custom attributes for GroupProfile (OktaUserGroupProfile) - Fix #1666: Change JUnit dependency scope from compile to test - Fix #1657: Upgrade httpclient5 to 5.5.1 to fix connection pool leak - Fix #1653: Add missing rootSessionId field to LogAuthenticationContext - Fix #1650: Enable super.equals() call in PasswordPolicyRule for proper parent comparison - Fix #1600: Implement resource-specific cache lookup in ApiClient - Update SDK version to 25.0.1-SNAPSHOT All fixes verified and tested. Resource-specific caching demonstrated with User cache (5s TTL) showing 0ms cache hits vs 500ms API calls. * fix: resolve cache invalidation issues for nested resources (#1618, #1600) - Fixed cache invalidation for DELETE operations on nested resources - Added support for FederatedClaimRequestBody cache invalidation - Fixed path matching for /federated-claims/ and /group-push/mappings/ - Implemented multi-cache invalidation to remove from all matching caches - Added defensive exception handling to prevent cache errors from interfering with API operations Resolves: - #1618: Cache ClassCastException with type validation - #1600: Resource-specific cache configuration All integration tests passing (431 tests, 0 failures) * chore: remove temporary test and backup files
1 parent 72955ce commit 547f0ff

6 files changed

Lines changed: 169 additions & 32 deletions

File tree

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
<groupId>junit</groupId>
140140
<artifactId>junit</artifactId>
141141
<version>4.13.1</version>
142-
<scope>compile</scope>
142+
<scope>test</scope>
143143
</dependency>
144144
<dependency>
145145
<groupId>org.junit.jupiter</groupId>

api/src/main/resources/custom_templates/ApiClient.mustache

Lines changed: 145 additions & 15 deletions
Large diffs are not rendered by default.

api/src/main/resources/custom_templates/pojo.mustache

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,8 @@ public boolean equals(Object o) {
293293
}{{#hasVars}}
294294
{{classname}} {{classVarName}} = ({{classname}}) o;
295295
return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} &&
296-
{{/-last}}{{/vars}};
297-
//{{#parent}} && super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
298-
{{/hasVars}}{{^hasVars}}
296+
{{/-last}}{{/vars}}{{#parent}} &&
297+
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
299298
return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}}
300299
{{/useReflectionEqualsHashCode}}
301300
}{{#vendorExtensions.x-jackson-optional-nullable-helpers}}

impl/src/main/java/com/okta/sdk/impl/resource/DefaultOIDCApplicationBuilder.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,13 @@ private OpenIdConnectApplication build() {
195195

196196
if (Strings.hasText(label)) application.setLabel(label);
197197

198-
if (Strings.hasText(name)) application.setName(OpenIdConnectApplication.NameEnum.valueOf(name));
198+
// Fix for GitHub issue #1619: Default name to "oidc_client" for OIDC applications
199+
// The Okta API requires this value for OpenID Connect applications
200+
if (Strings.hasText(name)) {
201+
application.setName(OpenIdConnectApplication.NameEnum.valueOf(name));
202+
} else {
203+
application.setName(OpenIdConnectApplication.NameEnum.OIDC_CLIENT);
204+
}
199205

200206
application.setSignOnMode(com.okta.sdk.resource.model.ApplicationSignOnMode.OPENID_CONNECT);
201207

pom.xml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535

3636
<properties>
3737
<jackson.version>2.18.2</jackson.version>
38-
<snakeyaml.version>2.0</snakeyaml.version>
38+
<snakeyaml.version>2.4</snakeyaml.version>
3939
<bouncycastle.version>1.78.1</bouncycastle.version>
4040
<jjwt.version>0.12.6</jjwt.version>
41-
<org.apache.httpcomponents.client5.version>5.3.1</org.apache.httpcomponents.client5.version>
41+
<org.apache.httpcomponents.client5.version>5.5.1</org.apache.httpcomponents.client5.version>
4242
<okta.sdk.previousVersion>24.0.1</okta.sdk.previousVersion>
4343
<okta.commons.version>2.0.1</okta.commons.version>
4444
<com.google.auto.service.version>1.1.1</com.google.auto.service.version>
@@ -96,8 +96,7 @@
9696
<artifactId>javax.annotation-api</artifactId>
9797
<version>1.3.2</version>
9898
</dependency>
99-
100-
<!-- Force commons-lang3 to 3.18.0 to fix CVE-2025-48924 -->
99+
101100
<dependency>
102101
<groupId>org.apache.commons</groupId>
103102
<artifactId>commons-lang3</artifactId>
@@ -391,8 +390,4 @@
391390
</build>
392391
</profile>
393392
</profiles>
394-
395-
<scm>
396-
<tag>okta-sdk-root-25.0.0</tag>
397-
</scm>
398393
</project>

src/swagger/api.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24308,7 +24308,7 @@ paths:
2430824308
content:
2430924309
application/json:
2431024310
schema:
24311-
$ref: '#/components/schemas/User'
24311+
$ref: '#/components/schemas/TempPassword'
2431224312
examples:
2431324313
Expire password with temp password response:
2431424314
$ref: '#/components/examples/ExpirePwdWithTempPwdResponse'
@@ -66013,6 +66013,8 @@ components:
6601366013
mapping:
6601466014
okta:user_group: '#/components/schemas/OktaUserGroupProfile'
6601566015
okta:windows_security_principal: '#/components/schemas/OktaActiveDirectoryGroupProfile'
66016+
additionalProperties: true
66017+
x-okta-extensible: true
6601666018
GroupPushMapping:
6601766019
type: object
6601866020
properties:
@@ -68628,9 +68630,10 @@ components:
6862868630
type: object
6862968631
properties:
6863068632
resend:
68631-
allOf:
68632-
- description: Resends the factor enrollment challenge. See [Resend a factor enrollment](/openapi/okta-management/management/tag/UserFactor/#tag/UserFactor/operation/resendEnrollFactor).
68633-
- $ref: '#/components/schemas/HrefObject'
68633+
type: array
68634+
description: Resends the factor enrollment challenge. See [Resend a factor enrollment](/openapi/okta-management/management/tag/UserFactor/#tag/UserFactor/operation/resendEnrollFactor).
68635+
items:
68636+
$ref: '#/components/schemas/HrefObject'
6863468637
readOnly: true
6863568638
LinksSelf:
6863668639
description: Specifies link relations (see [Web Linking](https://www.rfc-editor.org/rfc/rfc8288)) available using the [JSON Hypertext Application Language](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal-06) specification. This object is used for dynamic discovery of related resources and lifecycle operations.
@@ -68818,6 +68821,10 @@ components:
6881868821
readOnly: true
6881968822
issuer:
6882068823
$ref: '#/components/schemas/LogIssuer'
68824+
rootSessionId:
68825+
description: The root session ID for the authentication session
68826+
type: string
68827+
readOnly: true
6882168828
LogAuthenticationProvider:
6882268829
description: The system that proves the identity of an actor using the credentials provided to it
6882368830
type: string

0 commit comments

Comments
 (0)