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

Use bidder name instead of syncer key #2948

Merged
merged 7 commits into from
Jul 26, 2023
Merged

Conversation

VeronikaSolovei9
Copy link
Contributor

@VeronikaSolovei9 VeronikaSolovei9 commented Jul 19, 2023

Redirect urls for bidders user sync now have bidder={bidderName} not bidder={syncerKey}.

user_sync endpoint now returns urls with redirect urls with bidder name instead of syncer key.
setuid endpoint now accepts bidder name, not syncer key: setuid?bidder=appnexus not setuid?bidder=adnxs
getuids endpoint returns ids by syncer key.

Copy link
Contributor

@SyntaxNode SyntaxNode left a comment

Choose a reason for hiding this comment

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

Nice. The change is surprisingly small.

syncersByKey := make(map[string]usersync.Syncer, len(syncersByBidder))
for _, v := range syncersByBidder {
syncersByKey[v.Key()] = v
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The assumption is still generally true, but the bidder name is now important for activity control so this approach is no longer valid.

@hhhjort hhhjort self-requested a review July 19, 2023 17:29
@VeronikaSolovei9 VeronikaSolovei9 marked this pull request as ready for review July 19, 2023 21:06
key := query.Get("bidder")

if key == "" {
return nil, errors.New(`"bidder" query param is required`)
}

syncer, syncerExists := syncersByKey[key]
syncer, syncerExists := syncersByBidder[key]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should key within the brackets [key] now be called bidder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this change is already present in this PR: #2897 (comment)
But yes, it will be simpler to have it here :)

hhhjort
hhhjort previously approved these changes Jul 20, 2023
Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

LGTM

AlexBVolcy
AlexBVolcy previously approved these changes Jul 20, 2023
Copy link
Contributor

@AlexBVolcy AlexBVolcy left a comment

Choose a reason for hiding this comment

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

LGTM

config/bidderinfo.go Outdated Show resolved Hide resolved
usersync/syncer.go Show resolved Hide resolved
@VeronikaSolovei9 VeronikaSolovei9 dismissed stale reviews from AlexBVolcy and hhhjort via c6a9bd5 July 24, 2023 20:35
config/bidderinfo.go Outdated Show resolved Hide resolved
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.

4 participants