-
Notifications
You must be signed in to change notification settings - Fork 91
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
ref(common): Make the DSN public key Copy #795
Conversation
|
||
/// Data scoping information. | ||
/// | ||
/// This structure holds information of all scopes required for attributing an item to quotas. | ||
#[derive(Clone, Debug)] | ||
#[derive(Clone, Copy, Debug)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is now Copy theoretically you can put it into ItemScoping without a lifetime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'll leave it like this. The ItemScoping
type is quite large, and since one should only temporarily hold an item scoping, it's probably fine to keep it with a reference.
We should be able to represent all DSNs with half the bytes. I validated that we don't have non-hex DSNs in prod, this returns 0: select count(*) from sentry_projectkey where encode(decode(public_key, 'hex'), 'hex') != public_key This should solve the concern voiced by Jan in #795
Creates a type for DSN public keys that implements copy. Every public key is a 32-character hexadecimal string. Storage requirements could be halved by parsing the hexadecimal contents of the key, however this is currently not enforced anywhere in Sentry. For this reason, we're taking the conservative approach using 32 bytes.
The type is called
ProjectKey
to distinguish it from Relay's own public key.#skip-changelog