-
Notifications
You must be signed in to change notification settings - Fork 70
feat: Identity API response caching #513
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
base: development
Are you sure you want to change the base?
Changes from 2 commits
b3b63f7
529c725
983175f
efad64c
a8efd13
b6ab438
268d850
669ae88
fa9b79b
4eb7566
2e832ca
9d432bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,8 @@ | |||||
| import com.mparticle.internal.MessageManager; | ||||||
| import com.mparticle.internal.listeners.ApiClass; | ||||||
|
|
||||||
| import java.security.MessageDigest; | ||||||
| import java.security.NoSuchAlgorithmException; | ||||||
|
Comment on lines
+24
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Looks like these imports aren't required |
||||||
| import java.util.ArrayList; | ||||||
| import java.util.Collections; | ||||||
| import java.util.Comparator; | ||||||
|
|
@@ -348,6 +350,26 @@ private void reset() { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| private String generateHash(String input) { | ||||||
| try { | ||||||
| MessageDigest digest = MessageDigest.getInstance("SHA-256"); | ||||||
| byte[] hashBytes = digest.digest(input.getBytes()); | ||||||
|
|
||||||
| // Convert byte array to hex string | ||||||
| StringBuilder hexString = new StringBuilder(); | ||||||
| for (byte b : hashBytes) { | ||||||
| String hex = Integer.toHexString(0xff & b); | ||||||
| if (hex.length() == 1) hexString.append('0'); | ||||||
| hexString.append(hex); | ||||||
| } | ||||||
| return hexString.toString(); | ||||||
| } catch (NoSuchAlgorithmException e) { | ||||||
| //throw new RuntimeException("Hashing algorithm not found", e); | ||||||
|
Mansi-mParticle marked this conversation as resolved.
Outdated
|
||||||
| } | ||||||
| return null; | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Also if we removed this extra line change, the whole file will be removed from the PR as it's not actually being changed |
||||||
| private BaseIdentityTask makeIdentityRequest(IdentityApiRequest request, final IdentityNetworkRequestRunnable networkRequest) { | ||||||
| if (request == null) { | ||||||
| request = IdentityApiRequest.withEmptyUser().build(); | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.