Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListLogEvents fails to unmarshal the response due to wrong definiotn of LogDebugContext.DebugData and LogTarget.DetailEntry #482

Closed
mikiberd opened this issue Aug 4, 2024 · 3 comments · Fixed by #484
Labels
bug Something isn't working Triaged

Comments

@mikiberd
Copy link

mikiberd commented Aug 4, 2024

Describe the bug?

When calling ListLogEvents of the SystemLogAPI, errors are returned (one of the following, depends on the response):
json: cannot unmarshal string into Go struct field _LogEvent.debugContext of type map[string]interface {}
json: cannot unmarshal string into Go struct field _LogEvent.target of type map[string]interface {}
json: cannot unmarshal string into Go struct field _LogEvent.transaction of type map[string]interface {}
json: cannot unmarshal string into Go struct field _LogEvent.actor of type map[string]interface {}

In all cases, the error is due to the following fields being defined as map[string]map[string]interface{} instead of map[string]interface{}:

  • LogDebugContext.DebugData
  • LogTarget.DetailEntry
  • LogTransaction.Detail
  • LogActor.DetailEntry

What is expected to happen?

The response should be unmarshalled correctly, returning a LogEvent object

What is the actual behavior?

An error is returned

Reproduction Steps?

Call ListLogEvents(), from the okta.SystemLogAPI client

Additional Information?

Some of the errors occurred in previous versions and have been fixed
#462
#449

Can we kindly request that a test will be added? 🙏🏻

Golang Version

go version go1.22.3 darwin/arm64

SDK Version

v5.0.0

OS version

No response

@mikiberd mikiberd added the bug Something isn't working label Aug 4, 2024
@duytiennguyen-okta
Copy link
Contributor

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

@mikiberd
Copy link
Author

mikiberd commented Aug 7, 2024

Also LogTargetChangeDetails.From and LogTargetChangeDetails.To are defined with the wrong type.

@duytiennguyen-okta
Copy link
Contributor

@mikiberd do you have the API response for LogTargetChangeDetails?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants