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

fix: Continue syncing if no users are found #9

Merged
merged 9 commits into from
May 6, 2024
Merged

Conversation

martinalbert
Copy link
Contributor

This PR implements more robust flow of syncing users and roles. If no user ids are found, we continue syncing other resources.

This PR also updates dependencies and downgrades go-falcon library due to incorrect mapping of domain_user. (issue described here: CrowdStrike/gofalcon#425

- downgrade go-falcon to support proper mapping of domain_user (first name and last name are incorrectly mapped in newer versions)
- upgrade go version as well as other dependecies
go.mod Outdated
github.com/conductorone/baton-sdk v0.1.11
github.com/crowdstrike/gofalcon v0.4.2
github.com/conductorone/baton-sdk v0.1.33
github.com/crowdstrike/gofalcon v0.3.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a release candidate has the fix: https://github.com/CrowdStrike/gofalcon/releases/tag/0.7.0-rc1

Do we want to try using that? If it works, we can switch to 0.7.0 when it comes out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the github release went through, but I can't find it in the go registry: https://pkg.go.dev/github.com/crowdstrike/gofalcon?tab=versions. Will let them know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was not aware of installation steps of pre-releases, fixed in 84dacf5

func NewRateLimitInfo(limit, remaining int64) RateLimitInfo {
return RateLimitInfo{
func NewRateLimitInfo(limit, remaining int64) *RateLimitInfo {
return &RateLimitInfo{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed? The code looks uglier so it must be important. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggreer it is not needed, I just like to use pointers as a good practice 😄 I'm not sure about using it with such small structs though. I reverted this change and use copies of RateLimitInfo struct. I could refactor it to use array of pointers, but that might be overkill, what do you think of using pointers over copies?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong opinion here. If you like pointers, leave this code using pointers.

- add status and lastLogin into user
- use supported referencing in loops (GO version 1.22)
- use creating resource id instead of whole object
@martinalbert martinalbert requested a review from ggreer May 6, 2024 06:03
- remove deprecated `deadcode`, `varcheck` and `execinquery`
@ggreer ggreer merged commit 4be7502 into main May 6, 2024
2 checks passed
@ggreer ggreer deleted the fix/listing-users branch May 6, 2024 16:58
@ggreer ggreer mentioned this pull request May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants