signet-auth 1.2.0 → 1.2.2
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/bin/sig.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { readFileSync, existsSync } from 'node:fs';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
5
5
|
import { dirname, join } from 'node:path';
|
|
6
6
|
import { execSync } from 'node:child_process';
|
|
7
7
|
|
|
@@ -50,7 +50,7 @@ async function main() {
|
|
|
50
50
|
|
|
51
51
|
buildIfNeeded();
|
|
52
52
|
|
|
53
|
-
const { run } = await import(join(rootDir, 'dist', 'cli', 'main.js'));
|
|
53
|
+
const { run } = await import(pathToFileURL(join(rootDir, 'dist', 'cli', 'main.js')).href);
|
|
54
54
|
await run(args);
|
|
55
55
|
}
|
|
56
56
|
|
package/dist/config/validator.js
CHANGED
|
@@ -306,6 +306,9 @@ export function buildStrategyConfig(strategy, config) {
|
|
|
306
306
|
return {
|
|
307
307
|
strategy: StrategyName.COOKIE,
|
|
308
308
|
...(typeof c.ttl === 'string' ? { ttl: c.ttl } : {}),
|
|
309
|
+
...(typeof c.waitUntil === 'string' && VALID_WAIT_UNTIL.includes(c.waitUntil)
|
|
310
|
+
? { waitUntil: c.waitUntil }
|
|
311
|
+
: {}),
|
|
309
312
|
...(Array.isArray(c.requiredCookies)
|
|
310
313
|
? { requiredCookies: c.requiredCookies }
|
|
311
314
|
: {}),
|
package/dist/core/types.d.ts
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
* These types have zero external dependencies — they are the shared vocabulary
|
|
4
4
|
* used across all layers (strategies, storage, providers, handlers).
|
|
5
5
|
*/
|
|
6
|
+
import type { WaitUntilValue } from './constants.js';
|
|
6
7
|
export interface CookieStrategyConfig {
|
|
7
8
|
strategy: 'cookie';
|
|
8
9
|
ttl?: string;
|
|
10
|
+
waitUntil?: WaitUntilValue;
|
|
9
11
|
requiredCookies?: string[];
|
|
10
12
|
}
|
|
11
13
|
export interface OAuth2StrategyConfig {
|
package/dist/core/types.js
CHANGED
|
@@ -4,7 +4,7 @@ import { parseDuration } from '../utils/duration.js';
|
|
|
4
4
|
import { runHybridFlow, stderrLogger } from '../browser/flows/hybrid-flow.js';
|
|
5
5
|
import { isLoginPage } from '../browser/flows/form-login.flow.js';
|
|
6
6
|
import { hasOAuthTokens } from '../browser/flows/oauth-consent.flow.js';
|
|
7
|
-
import { HttpHeader,
|
|
7
|
+
import { HttpHeader, StrategyName, CredentialTypeName } from '../core/constants.js';
|
|
8
8
|
const DEFAULT_TTL = '24h';
|
|
9
9
|
/**
|
|
10
10
|
* Cookie-based authentication strategy.
|
|
@@ -14,9 +14,11 @@ const DEFAULT_TTL = '24h';
|
|
|
14
14
|
class CookieStrategy {
|
|
15
15
|
ttlMs;
|
|
16
16
|
requiredCookies;
|
|
17
|
+
waitUntil;
|
|
17
18
|
constructor(config) {
|
|
18
19
|
this.ttlMs = parseDuration(config.ttl ?? DEFAULT_TTL);
|
|
19
20
|
this.requiredCookies = config.requiredCookies ?? [];
|
|
21
|
+
this.waitUntil = config.waitUntil;
|
|
20
22
|
}
|
|
21
23
|
validate(credential) {
|
|
22
24
|
if (credential.type !== CredentialTypeName.COOKIE)
|
|
@@ -45,7 +47,7 @@ class CookieStrategy {
|
|
|
45
47
|
entryUrl: provider.entryUrl,
|
|
46
48
|
browserConfig: context.browserConfig,
|
|
47
49
|
forceVisible: provider.forceVisible ?? false,
|
|
48
|
-
waitUntil:
|
|
50
|
+
waitUntil: this.waitUntil,
|
|
49
51
|
xHeaders: provider.xHeaders,
|
|
50
52
|
providerDomains: provider.domains,
|
|
51
53
|
localStorage: provider.localStorage,
|