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

refactor: remove StaticHint wrapper, log duplicate hints #289

Merged
merged 4 commits into from
Mar 23, 2022

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Mar 22, 2022

  • refactor: remove statichint
  • feat: log.Warn when duplicate hint registration.

See #287 -->

This PR;

  1. Removes the NewStaticHint wrapper, that allowed for custom UUID (which we don't want to)
  2. "Allows" duplicate hint registration with a trace in log.Warn. Duplicate hint registration may occur when importing a package when a hint is declared and registered in a init() function and adding it manually / through std.RegsiterHints . In practice, duplicate UUID for a function would occur only in the same package so it seems improbable to be possible for a malicious actor to replace a hint (which would not be any more a security issue than importing unknown code).

@gbotrel gbotrel requested a review from ivokub March 22, 2022 18:44
Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

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

Looks good.

backend/hint/builtin.go Outdated Show resolved Hide resolved
std/hints.go Show resolved Hide resolved
std/hints.go Show resolved Hide resolved
@gbotrel gbotrel merged commit bad1f2e into develop Mar 23, 2022
@gbotrel gbotrel deleted the refactor/removestatichint branch March 23, 2022 14:30
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