Skip to content

Commit

Permalink
rename extract key param
Browse files Browse the repository at this point in the history
  • Loading branch information
jchris committed Sep 20, 2024
1 parent c2be413 commit e1fe4cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ It's possible to change the logformat by setting FP_FORMAT to:
- json makes the log output in singleline json (default)
If you add `extractKey` with the value `_deprecated_internal_api` to the `FP_STORAGE_URL` url
you can bypass the security check to extract the key material. This is the default configuruation,
you can bypass the security check to extract the key material. This is the default configuration,
but there is a warning emitted if you use this feature, and roadmap plans for more secure key management.
## Thanks 🙏
Expand Down
4 changes: 3 additions & 1 deletion src/runtime/key-bag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export class KeyBag {
async subtleKey(key: string) {
const extractable = this.rt.url.getParam("extractKey") === "_deprecated_internal_api";
if (extractable) {
this._warnOnce.once(() => this.logger.Warn().Msg("extractKey is enabled via _deprecated_internal_api --- handle keys safely!!!"));
this._warnOnce.once(() =>
this.logger.Warn().Msg("extractKey is enabled via _deprecated_internal_api --- handle keys safely!!!"),
);
}
return await this.rt.crypto.importKey(
"raw", // raw or jwk
Expand Down
2 changes: 1 addition & 1 deletion tests/blockstore/keyed-crypto.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("KeyBag", () => {
{
level: "warn",
module: "KeyBag",
msg: "extractKey is enabled --- hopefully you know what you are doing!!!",
msg: "extractKey is enabled via _deprecated_internal_api --- handle keys safely!!!",
},
]);
});
Expand Down

0 comments on commit e1fe4cd

Please sign in to comment.