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

Inconsistent model mapping (domain_user) #425

Closed
martinalbert opened this issue Apr 18, 2024 · 4 comments · Fixed by #427
Closed

Inconsistent model mapping (domain_user) #425

martinalbert opened this issue Apr 18, 2024 · 4 comments · Fixed by #427
Labels
bug Something isn't working

Comments

@martinalbert
Copy link

This issue describes inconsistent mapping of model DomainUser. This change happened in 97a9111.

Current structure of DomainUser from endpoint https://api.crowdstrike.com/user-management/entities/users/GET/v1:

image

Type in code:

type DomainUser struct {
// cid
Cid string `json:"cid,omitempty"`
// email
Email string `json:"email,omitempty"`
// first name
FirstName string `json:"firstName,omitempty"`
// last name
LastName string `json:"lastName,omitempty"`
// uuid
UUID string `json:"uuid,omitempty"`
}

Other types of DomainUser like DomainCreateUserRequest contain the old structure:

type DomainCreateUserRequest struct {
// cid
Cid string `json:"cid,omitempty"`
// first name
FirstName string `json:"first_name,omitempty"`
// last name
LastName string `json:"last_name,omitempty"`
// password
Password string `json:"password,omitempty"`
// uid
UID string `json:"uid,omitempty"`
}

@ffalor
Copy link
Contributor

ffalor commented Apr 26, 2024

I believe this is fixed in 0.7.0-rc1 it looks like multiple endpoints are defining that model. I'll keep an eye on it for future client generations to ensure it doesn't happen again.

@martinalbert
Copy link
Author

Thank you @ffalor, seems like the release action went through, but I can't use the new release candidate. I can't find it in go registry as well: https://pkg.go.dev/github.com/crowdstrike/gofalcon?tab=versions.

@ffalor
Copy link
Contributor

ffalor commented May 5, 2024

It's because it's marked as a pre-release. You can install it by running go get github.com/crowdstrike/gofalcon/[email protected]

It will look like this in your go.mod file: github.com/crowdstrike/gofalcon v0.6.1-0.20240426204036-ac8ce2b4f2d7

@martinalbert
Copy link
Author

My bad, thank you again @ffalor, it works!

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

Successfully merging a pull request may close this issue.

2 participants