Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

CacheKey equatable object in CacheTagHelper #4246

Closed
sebastienros opened this issue Mar 7, 2016 · 2 comments
Closed

CacheKey equatable object in CacheTagHelper #4246

sebastienros opened this issue Mar 7, 2016 · 2 comments
Assignees
Milestone

Comments

@sebastienros
Copy link
Member

  • Prevent string allocations
  • Fix hash collision by checking the serialized key with the actual content for DistributedCacheTagHelper
@danroth27
Copy link
Member

@sebastienros Could you please provide more details on what the issue is here and what the proposed change is?

@sebastienros
Copy link
Member Author

@lodejard 's recommendations. We are building/serializing the key for every request and comparing strings, where we could just store a structure representing the key in memory and compare instances in the case of the CacheTagHelper.

Then for the DistributedCacheTagHelper we need to store the key with the data, because the key is hashed (SHA256) and there could be hash collisions, hence potential leak of information if a request gets forge to get the value from another cache key. Serializing the key with the data will let us check that the returned content is for the intended key (like a dictionary handles key collisions).

So yes, you need to open it for RC2 and assign it to me.

@Eilon Eilon added this to the 1.0.0-rc2 milestone Mar 10, 2016
sebastienros added a commit that referenced this issue Mar 24, 2016
sebastienros added a commit that referenced this issue Mar 25, 2016
sebastienros added a commit that referenced this issue Mar 28, 2016
sebastienros added a commit that referenced this issue Mar 29, 2016
Prevent string allocations in CacheTagHelper
Fix hash collision by checking the serialized key with the actual content for DistributedCacheTagHelper
sebastienros added a commit that referenced this issue Mar 29, 2016
Prevent string allocations in CacheTagHelper
Fix hash collision by checking the serialized key with the actual content for DistributedCacheTagHelper
sebastienros added a commit that referenced this issue Apr 1, 2016
Prevent string allocations in CacheTagHelper
Fix hash collision by checking the serialized key with the actual content for DistributedCacheTagHelper
sebastienros added a commit that referenced this issue Apr 1, 2016
Prevent string allocations in CacheTagHelper
Fix hash collision by checking the serialized key with the actual content for DistributedCacheTagHelper
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants