@threadbase-sh/streamer 1.21.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4877,10 +4877,17 @@ var StreamerServer = class {
4877
4877
  });
4878
4878
  }
4879
4879
  rotateApiKey() {
4880
+ const oldKey = this.apiKey;
4880
4881
  const newKey = generateApiKey();
4881
4882
  const persisted = this.apiKeySource === "config";
4882
4883
  if (persisted) setApiKey(newKey);
4883
4884
  this.apiKey = newKey;
4885
+ this.log.info("API key rotated", {
4886
+ event: "auth.api_key_rotated",
4887
+ oldKeyMasked: `${oldKey.slice(0, 6)}\u2026`,
4888
+ newKeyMasked: `${newKey.slice(0, 6)}\u2026`,
4889
+ persisted
4890
+ });
4884
4891
  return { newKey, persisted };
4885
4892
  }
4886
4893
  checkRateLimit(map, key, limit, windowMs) {