bruno-roustant commented on code in PR #60: URL: https://github.com/apache/solr-sandbox/pull/60#discussion_r1221223230
########## encryption/src/main/java/org/apache/solr/encryption/EncryptionUtil.java: ########## @@ -142,6 +144,36 @@ public static boolean hasKeyIdInCommit(Map<String, String> commitUserData) { return false; } + /** + * Gets the cookies (key-value pairs) for all the key ids, from the provided commit user data. + * + * @return the cookies for all key ids. + */ + public static KeyCookies getKeyCookiesFromCommit(Map<String, String> commitUserData) { + Map<String, Map<String, String>> keyCookies = null; + for (Map.Entry<String, String> dataEntry : commitUserData.entrySet()) { + if (dataEntry.getKey().startsWith(COMMIT_KEY_ID)) { + String keyId = dataEntry.getValue(); + String keyRef = dataEntry.getKey().substring(COMMIT_KEY_ID.length()); + String commitKeyCookie = COMMIT_KEY_COOKIE + keyRef; + String cookieSizeAsString = commitUserData.get(commitKeyCookie); + if (cookieSizeAsString != null) { + int cookieSize = Integer.parseInt(cookieSizeAsString); + Map<String, String> cookie = new HashMap<>((int) (cookieSize / 0.75f) + 1); Review Comment: I'll bump the dependency version for the encryption module so I can use CollectionUti.newHashMap() (which has the same code). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org