]> git.ardis.lu - envpass/log
envpass
7 weeks agoDelete useless escapes
Ardis Lu [Sun, 30 Aug 2026 06:04:18 +0000 (23:04 -0700)]
Delete useless escapes

8 weeks agoProvide `challenge` and `exp` in return object
Ardis Lu [Sun, 23 Aug 2026 05:24:35 +0000 (22:24 -0700)]
Provide `challenge` and `exp` in return object

Being able to get these components easily without parsing `url` sets up the workflow to later expand so users can bring their own bridge.

8 weeks agoCast `parseEnv` result to `Record<string, string>`
Ardis Lu [Wed, 19 Aug 2026 04:53:36 +0000 (21:53 -0700)]
Cast `parseEnv` result to `Record<string, string>`

Casting is required instead of a simple annotation because the default return value `NodeJS.Dict<string>` sets the value to `string | undefined`. The `undefined` scenario is impossible with `parseEnv`'s current implementation, so to handle the the `undefined` case results in an untestable code branch.

2 months agoRefactor mock .env values to constants
Ardis Lu [Mon, 17 Aug 2026 04:42:44 +0000 (21:42 -0700)]
Refactor mock .env values to constants

2 months agoAdd `injectInProcess` unit tests
Ardis Lu [Sun, 16 Aug 2026 07:15:37 +0000 (00:15 -0700)]
Add `injectInProcess` unit tests

2 months agoAdd logger test variants
Ardis Lu [Sun, 16 Aug 2026 07:07:56 +0000 (00:07 -0700)]
Add logger test variants

2 months agoSeparate e2e suite
Ardis Lu [Sun, 16 Aug 2026 07:05:43 +0000 (00:05 -0700)]
Separate e2e suite

e2e is not accurate for the encrypt and decrypt unit tests, and helps deduplicate redundant tests.

2 months agoAdd tests for nonstandard encrypt or decrypt behavior
Ardis Lu [Sat, 15 Aug 2026 06:15:02 +0000 (23:15 -0700)]
Add tests for nonstandard encrypt or decrypt behavior

2 months agoCalculate client-side window expiration from `exp` query param
Ardis Lu [Sat, 15 Aug 2026 05:59:59 +0000 (22:59 -0700)]
Calculate client-side window expiration from `exp` query param

This change makes the client-side expiration in sync with the server-side expiration. Previously, if the client-side window is opened later than the server's start time, the expirations would be de-synced. It is also a maintenance burden to keep the duration constants in sync between the two.

2 months agoAdd tests to cover window expiration scenario
Ardis Lu [Sun, 2 Aug 2026 04:47:24 +0000 (21:47 -0700)]
Add tests to cover window expiration scenario

2 months agoCut v0.1.4 v0.1.4
Ardis Lu [Mon, 27 Jul 2026 05:16:58 +0000 (22:16 -0700)]
Cut v0.1.4

2 months agoAdd test for decrypt passthrough to exec
Ardis Lu [Sun, 26 Jul 2026 05:01:07 +0000 (22:01 -0700)]
Add test for decrypt passthrough to exec

Directly importing the method prevents mocking. It is required to import the default module object to mock the method.

2 months agoApply type narrowing to `decrypt`
Ardis Lu [Fri, 24 Jul 2026 07:08:55 +0000 (00:08 -0700)]
Apply type narrowing to `decrypt`

Same logic applies, just forgot to do this in 8374efadfc751aa2a5db43cff96109ffb230690b

2 months agoManually narrow the return type of `parseEnv`
Ardis Lu [Wed, 22 Jul 2026 07:35:47 +0000 (00:35 -0700)]
Manually narrow the return type of `parseEnv`

`Record<string, string>` clarifies that `value` can never be `undefined`, whereas `NodeJS.Dict<string>` allows `undefined`. This change allows the deletion of an unreachable and untestable code branch without raising type errors. The new return type matches the actual type used in the Node.js codebase [0].

[0] https://github.com/nodejs/node/blob/fbab4586118ccd225d06706fe6502e063354b765/lib/util.js#L485-L493

2 months agoWrap HTML loading logic for mocking purposes and add tests for it
Ardis Lu [Wed, 22 Jul 2026 07:15:17 +0000 (00:15 -0700)]
Wrap HTML loading logic for mocking purposes and add tests for it

2 months agoUpgrade dependencies
Ardis Lu [Wed, 22 Jul 2026 06:53:43 +0000 (23:53 -0700)]
Upgrade dependencies

3 months agoAdd test for alternate logger
Ardis Lu [Sat, 18 Jul 2026 05:04:06 +0000 (22:04 -0700)]
Add test for alternate logger

3 months agoTest count of first pass encrypt/decrypt
Ardis Lu [Sat, 18 Jul 2026 05:03:07 +0000 (22:03 -0700)]
Test count of first pass encrypt/decrypt

3 months agoRefuse streaming/chunked requests
Ardis Lu [Fri, 17 Jul 2026 07:02:32 +0000 (00:02 -0700)]
Refuse streaming/chunked requests

There is no practical reason the client must stream 32 bytes (should be able to send it in one chunk). This change reduces the attack surface and closes a potential DoS vector.

3 months agoUse more idiomatic types
Ardis Lu [Fri, 17 Jul 2026 06:45:38 +0000 (23:45 -0700)]
Use more idiomatic types

3 months agoSet `Content-Length` header on all responses
Ardis Lu [Thu, 16 Jul 2026 06:24:22 +0000 (23:24 -0700)]
Set `Content-Length` header on all responses

This value is easy to determine, so might as well make the response more useful and deterministic. Setting this header also lets the server drop the default `Transfer-Encoding: chunked` response header which could also be a miniscule performance improvement on clients.

3 months agoExplicitly reject methods that are not GET or POST
Ardis Lu [Thu, 16 Jul 2026 05:41:33 +0000 (22:41 -0700)]
Explicitly reject methods that are not GET or POST

3 months agoAdd tests for empty env file
Ardis Lu [Wed, 15 Jul 2026 05:26:03 +0000 (22:26 -0700)]
Add tests for empty env file

3 months agoAsset all logger methods
Ardis Lu [Wed, 15 Jul 2026 05:22:42 +0000 (22:22 -0700)]
Asset all logger methods

3 months agoAdd debug level logs
Ardis Lu [Wed, 15 Jul 2026 05:03:17 +0000 (22:03 -0700)]
Add debug level logs

3 months agoUpdate to match `Logger` interface
Ardis Lu [Wed, 15 Jul 2026 05:01:44 +0000 (22:01 -0700)]
Update to match `Logger` interface

To better interoperate with third-party loggers, `console.log` should be replaced with `console.info` and `console.debug` added.

3 months agoDo not emit end user-facing logs
Ardis Lu [Tue, 14 Jul 2026 06:13:27 +0000 (23:13 -0700)]
Do not emit end user-facing logs

Logs intended to improve the final UX should be a separate concern handled by the CLI or the library consumer. Library logs should only be related to debugging the library itself. This separation allows the code closest to the user to provide more tailored instructions (e.g., i18n) to the user.

3 months agoReplace `silent` with `logger` option
Ardis Lu [Tue, 14 Jul 2026 05:57:38 +0000 (22:57 -0700)]
Replace `silent` with `logger` option

Allowing the user to pass their own logger is far superior to hardcoding `console`, and libraries should default to silent anyway.

3 months agoShow concrete examples of library usage
Ardis Lu [Tue, 14 Jul 2026 05:23:22 +0000 (22:23 -0700)]
Show concrete examples of library usage

3 months agoRename "In-process" to "Global"
Ardis Lu [Sat, 27 Jun 2026 06:06:00 +0000 (23:06 -0700)]
Rename "In-process" to "Global"

3 months agoCut v0.1.3 v0.1.3
Ardis Lu [Wed, 24 Jun 2026 06:59:34 +0000 (23:59 -0700)]
Cut v0.1.3

3 months agoSet `types` key for TS badge on npm registry
Ardis Lu [Wed, 24 Jun 2026 06:56:51 +0000 (23:56 -0700)]
Set `types` key for TS badge on npm registry

Although this key is redundant with `exports`, it is still required to have the "TS" badge on the npm registry.

3 months agoUpgrade dependencies
Ardis Lu [Wed, 24 Jun 2026 06:48:41 +0000 (23:48 -0700)]
Upgrade dependencies

3 months agoSimplify `broadcastPromise` declaration
Ardis Lu [Sun, 21 Jun 2026 04:25:17 +0000 (21:25 -0700)]
Simplify `broadcastPromise` declaration

4 months agoReset `prf` on incomplete request
Ardis Lu [Thu, 18 Jun 2026 06:18:31 +0000 (23:18 -0700)]
Reset `prf` on incomplete request

4 months agoClear `prf` on invalid chunk
Ardis Lu [Thu, 18 Jun 2026 06:15:43 +0000 (23:15 -0700)]
Clear `prf` on invalid chunk

Seems safer to just wipe it in case there is a scenario where a partial `prf` is sent.

4 months agoMove prf zeroing logic inside `finally`
Ardis Lu [Thu, 18 Jun 2026 06:05:03 +0000 (23:05 -0700)]
Move prf zeroing logic inside `finally`

This approach is more semantically aligned with what is meant to happen (wipe `prf` after it is broadcast, regardless of success or fail), and potentially better scheduling (previous approach allowed theoretical promises in the microtask queue injected after the `fetch` but before yielding to main thread?).

4 months agoUpgrade commander.js
Ardis Lu [Mon, 15 Jun 2026 04:39:59 +0000 (21:39 -0700)]
Upgrade commander.js

4 months agoUse staged publishing
Ardis Lu [Sun, 14 Jun 2026 05:13:15 +0000 (22:13 -0700)]
Use staged publishing

Reference: https://docs.npmjs.com/staged-publishing/

4 months agoDisable `package-manager-cache`
Ardis Lu [Mon, 8 Jun 2026 02:43:43 +0000 (19:43 -0700)]
Disable `package-manager-cache`

From `setup-node`'s `README`: "For workflows with elevated privileges or access to sensitive information, we recommend disabling automatic caching ... when caching is not required for secure operation."

4 months agoFix type missed in fbd137cf836e51a395c352a2992aea73bd1d101f
Ardis Lu [Tue, 2 Jun 2026 05:06:20 +0000 (22:06 -0700)]
Fix type missed in fbd137cf836e51a395c352a2992aea73bd1d101f

4 months agoNarrow `ArrayBufferView` to `Uint8Array`
Ardis Lu [Sun, 31 May 2026 06:07:37 +0000 (23:07 -0700)]
Narrow `ArrayBufferView` to `Uint8Array`

`ArrayBufferView` includes `DataView` which causes a type error when passed to the Web Crypto API. Although any typed array would work here, it is most common to use `Uint8Array` for this kind of data, so it should not cause any problems narrowing the required type.

4 months agoHarden server config to mitigate request exhaustion
Ardis Lu [Wed, 27 May 2026 03:57:38 +0000 (20:57 -0700)]
Harden server config to mitigate request exhaustion

4 months agoCut v0.1.2 v0.1.2
Ardis Lu [Tue, 26 May 2026 03:20:49 +0000 (20:20 -0700)]
Cut v0.1.2

4 months agoFix type errors
Ardis Lu [Tue, 26 May 2026 03:19:36 +0000 (20:19 -0700)]
Fix type errors

4 months agoUpgrade dependencies
Ardis Lu [Tue, 26 May 2026 03:08:36 +0000 (20:08 -0700)]
Upgrade dependencies

4 months agoUse standard ES types
Ardis Lu [Mon, 25 May 2026 00:30:25 +0000 (17:30 -0700)]
Use standard ES types

`BufferSource` is from web IDL (`lib.dom.d.ts`), which is not always imported. `ArrayBuffer` and `ArrayBufferView` are from the ES spec (`lib.es*.d.ts`) so they should always be available.

4 months agoPass PRF as raw bytes instead of string
Ardis Lu [Mon, 25 May 2026 00:21:14 +0000 (17:21 -0700)]
Pass PRF as raw bytes instead of string

Avoiding string serialization is more performant and simpler, and more importantly reduces the places where this sensitive value is written to memory. By keeping the value in buffer we can immediately zero it out manually instead of waiting for garbage collection.

The value is still "leaked" via DevTools inspection and other points in the network stack, but that is out of the control of JS.

4 months agoUse custom `Envpass-Challenge` header
Ardis Lu [Sun, 24 May 2026 06:16:34 +0000 (23:16 -0700)]
Use custom `Envpass-Challenge` header

Separating `challenge` from `prf` allows more flexibility to change the format that `prf` is bridged (e.g., to `application/octet-stream`) and it is more consistent with how similar material is usually passed in other APIs.

4 months agoDelete extra space
Ardis Lu [Sun, 24 May 2026 06:11:31 +0000 (23:11 -0700)]
Delete extra space

4 months agoRefactor to isolate `filterNullValues` logic
Ardis Lu [Sun, 24 May 2026 06:06:42 +0000 (23:06 -0700)]
Refactor to isolate `filterNullValues` logic

This change allows a more precise type annotation to assert that there is no null value in the resulting object.

4 months agoVerify fetch metadata request headers on POST ("resource isolation policy")
Ardis Lu [Sat, 23 May 2026 06:19:48 +0000 (23:19 -0700)]
Verify fetch metadata request headers on POST ("resource isolation policy")

This is more hardening against cross-origin attacks.

4 months agoRefactor to separate each validation test
Ardis Lu [Sat, 23 May 2026 05:32:55 +0000 (22:32 -0700)]
Refactor to separate each validation test

4 months agoSet client-side security headers
Ardis Lu [Fri, 22 May 2026 06:21:00 +0000 (23:21 -0700)]
Set client-side security headers

The CSP `img-src 'none';` will block the empty data URL used for the favicon, so just remove it. The original purpose of the empty data URL was to prevent `favicon.ico` requests, but that is also accomplished by this CSP.

4 months agoVerify `Content-Type` header on POST
Ardis Lu [Fri, 22 May 2026 05:33:15 +0000 (22:33 -0700)]
Verify `Content-Type` header on POST

Setting this header to `application/json` forces the request to be CORS preflighted (i.e. not a "simple request"). This is further security hardening against cross-origin requests from a web browser.

4 months agoVerify `Origin` header on POST
Ardis Lu [Fri, 22 May 2026 05:20:18 +0000 (22:20 -0700)]
Verify `Origin` header on POST

This is security hardening against cross-origin requests. Although the server already does not send CORS headers (so web browsers should already block a cross-origin POST), there should still be a server-side `Origin` check as defense-in-depth.

4 months agoOnly get passkey if actually required
Ardis Lu [Thu, 21 May 2026 05:59:14 +0000 (22:59 -0700)]
Only get passkey if actually required

Getting passkey is not required when `encrypt` is run on a file where all variables are already encrypted, or `decrypt` is run on a file where all variables are already decrypted.

Previously, the passkey flow would always initiate. Now, it will only initiate the first time it is required.

This change improves the UX in situations where `encrypt` or `decrypt` are called on a continuous basis. For example, when calling `envpass encrypt` in a `prestart` npm script hook.

4 months agoRemove block margin on `<body>`
Ardis Lu [Thu, 21 May 2026 05:42:52 +0000 (22:42 -0700)]
Remove block margin on `<body>`

Otherwise there will be an unnecessary vertical scrollbar on the page.

4 months agoAllow passing options to Playwright
Ardis Lu [Thu, 21 May 2026 05:41:55 +0000 (22:41 -0700)]
Allow passing options to Playwright

Makes it easier to debug Playwright tests.

5 months agoCut v0.1.1 v0.1.1
Ardis Lu [Mon, 18 May 2026 04:47:07 +0000 (21:47 -0700)]
Cut v0.1.1

5 months agoFix auto-corrected error
Ardis Lu [Mon, 18 May 2026 04:46:29 +0000 (21:46 -0700)]
Fix auto-corrected error

Used `npm pkg fix` to correct.

5 months agoInitial commit v0.1.0
Ardis Lu [Mon, 18 May 2026 04:18:36 +0000 (21:18 -0700)]
Initial commit

This page took 0.066876 seconds and 4 git commands to generate.