okta / okta-sdk-golang

A Golang SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
https://github.com/okta/okta-sdk-golang
Other
173 stars 143 forks source link

Error is thrown if UserIdentifierConditionEvaluatorPattern is empty #392

Open louiecampagna-okta opened 1 year ago

louiecampagna-okta commented 1 year ago

Describe the bug?

Api validation failed: mediationRule. Causes: errorSummary: The condition 'userIdentifier' must have 'patterns'.

omitempty on UserIdentifierConditionEvaluatorPattern prevents requests being made with a blank pattern value; if a policy rule is retrieved, it can have a blank value for the pattern. If the policy rule is updated, a valid policy rule with a blank pattern will throw an error trying to update.

Updating userIdentifierPolicyRuleCondition.go to remove omitempty resolves the issue

What is expected to happen?

Expected behavior would be for the policy rule to update successfully even with a blank value for the pattern

What is the actual behavior?

Api validation failed: mediationRule. Causes: errorSummary: The condition 'userIdentifier' must have 'patterns'.

Reproduction Steps?

Update a policy rule via golang SDK that has a blank value for the user identifier patterns

Additional Information?

No response

Golang Version

go version go1.19.2 darwin/amd64

SDK Version

2.17

OS version

Darwin C02G12VPML85 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 x86_64

duytiennguyen-okta commented 1 year ago

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-620369

github-actions[bot] commented 1 year ago

This issue has been marked stale because there has been no activity within the last 14 days. To keep this issue active, remove the stale label.