@blakearoberts/visage 0.0.1-rc.6 → 0.0.1-rc.7
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/config.d.ts +8 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +77 -75
- package/dist/types.d.ts +27 -14
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -17,20 +17,14 @@ type ResolvedOAuth2Client = {
|
|
|
17
17
|
readonly scopes: readonly string[];
|
|
18
18
|
readonly public: boolean;
|
|
19
19
|
};
|
|
20
|
-
type ResolvedService = Omit<VisageService, 'upstream'>;
|
|
21
|
-
type ResolvedUpstream = Omit<VisageUpstream, 'host' | 'port' | 'scheme'> & {
|
|
22
|
-
readonly host: string;
|
|
23
|
-
readonly port: number;
|
|
24
|
-
readonly scheme: 'http' | 'https';
|
|
25
|
-
};
|
|
26
20
|
type ResolvedVisageOptions = {
|
|
27
21
|
readonly host: string;
|
|
28
22
|
readonly port: number;
|
|
29
23
|
readonly cookie: ResolvedCookiePolicy;
|
|
30
24
|
readonly idp: ResolvedIdpOption;
|
|
31
25
|
readonly oauth2: ResolvedOAuth2Client;
|
|
32
|
-
readonly services: Readonly<Record<string,
|
|
33
|
-
readonly upstreams?: Record<string,
|
|
26
|
+
readonly services: Readonly<Record<string, VisageService>>;
|
|
27
|
+
readonly upstreams?: Record<string, VisageUpstream>;
|
|
34
28
|
};
|
|
35
29
|
type ResolvedBaseIdpConfig = {
|
|
36
30
|
readonly upstream: string;
|
|
@@ -49,6 +43,12 @@ type ResolvedExternalIdpConfig = ResolvedBaseIdpConfig & {
|
|
|
49
43
|
readonly dex?: never;
|
|
50
44
|
};
|
|
51
45
|
type ResolvedIdpConfig = ResolvedDexIdpConfig | ResolvedExternalIdpConfig;
|
|
46
|
+
type ResolvedService = Omit<VisageService, 'upstream'>;
|
|
47
|
+
type ResolvedUpstream = Omit<VisageUpstream, 'host' | 'port' | 'scheme'> & {
|
|
48
|
+
readonly host: string;
|
|
49
|
+
readonly port: number;
|
|
50
|
+
readonly scheme: 'http' | 'https';
|
|
51
|
+
};
|
|
52
52
|
export type VisageConfig = {
|
|
53
53
|
readonly host: string;
|
|
54
54
|
readonly port: number;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE3C,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,aAAa,EAEb,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,KAAK,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;AAElD,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,KAAK,iBAAiB,GAClB;IACE,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;CAChC,GACD,wBAAwB,CAAC;AAE7B,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,KAAK,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","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,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAEtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;KAC1C,CAAC;IAEF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;IAC7D,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;CAChE,CAAC;AAuGF,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,qBAAqB,CAsC5E;AA4ID,wBAAgB,aAAa,CAC3B,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,MAAM,GACf,YAAY,CAoEd"}
|
package/dist/index.js
CHANGED
|
@@ -409,11 +409,7 @@ const BaseOauth2ProxyUpstream = {
|
|
|
409
409
|
'/oauth2/': {
|
|
410
410
|
auth: { enabled: false },
|
|
411
411
|
headers: {
|
|
412
|
-
Cookie: '$http_cookie',
|
|
413
|
-
Host: '$host',
|
|
414
|
-
'X-Real-IP': '$remote_addr',
|
|
415
|
-
'X-Forwarded-For': '$proxy_add_x_forwarded_for',
|
|
416
|
-
'X-Forwarded-Proto': '$scheme',
|
|
412
|
+
Cookie: '$http_cookie', // Forward session cookie.
|
|
417
413
|
'X-Auth-Request-Redirect': '$request_uri',
|
|
418
414
|
},
|
|
419
415
|
},
|
|
@@ -461,19 +457,17 @@ function resolveOptions(options) {
|
|
|
461
457
|
const { host = 'localhost', port = 9001, cookie = {}, oauth2 = {} } = options;
|
|
462
458
|
const cookieName = cookie.name ?? 'session';
|
|
463
459
|
const publicClient = oauth2.clientSecret === null;
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
...resolveUpstreams(options.upstreams),
|
|
467
|
-
};
|
|
460
|
+
const services = resolveServicesOptions(options.services);
|
|
461
|
+
const upstreams = resolveUpstreamsOptions(services, options.upstreams);
|
|
468
462
|
return {
|
|
469
463
|
host,
|
|
470
464
|
port,
|
|
471
465
|
cookie: {
|
|
472
466
|
...DefaultCookiePolicy,
|
|
473
467
|
cookie_name: cookie.domains === undefined
|
|
474
|
-
? cookieName.startsWith('
|
|
468
|
+
? cookieName.startsWith('__Host-')
|
|
475
469
|
? cookieName
|
|
476
|
-
: `
|
|
470
|
+
: `__Host-${cookieName}`
|
|
477
471
|
: cookieName,
|
|
478
472
|
...(cookie.expire === undefined ? {} : { cookie_expire: cookie.expire }),
|
|
479
473
|
...(cookie.refresh === undefined
|
|
@@ -493,62 +487,61 @@ function resolveOptions(options) {
|
|
|
493
487
|
scopes: oauth2.scopes ?? DefaultOAuth2Client.scopes,
|
|
494
488
|
public: publicClient,
|
|
495
489
|
},
|
|
496
|
-
services
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
490
|
+
services,
|
|
491
|
+
upstreams,
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
function resolveServicesOptions(services = {}) {
|
|
495
|
+
return {
|
|
496
|
+
...services,
|
|
497
|
+
nginx: {
|
|
498
|
+
...BaseServiceNginx,
|
|
499
|
+
...{
|
|
500
|
+
...(services.nginx ?? {}),
|
|
501
|
+
extra_hosts: [
|
|
502
|
+
...BaseServiceNginx.extra_hosts,
|
|
503
|
+
...(services.nginx?.extra_hosts ?? []),
|
|
504
|
+
],
|
|
510
505
|
},
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
],
|
|
519
|
-
|
|
506
|
+
},
|
|
507
|
+
oauth2_proxy: {
|
|
508
|
+
...BaseOAuth2ProxyService,
|
|
509
|
+
...{
|
|
510
|
+
...(services.oauth2_proxy ?? {}),
|
|
511
|
+
extra_hosts: [
|
|
512
|
+
...BaseOAuth2ProxyService.extra_hosts,
|
|
513
|
+
...(services.oauth2_proxy?.extra_hosts ?? []),
|
|
514
|
+
],
|
|
520
515
|
},
|
|
521
516
|
},
|
|
522
|
-
...(Object.keys(upstreams).length === 0 ? {} : { upstreams }),
|
|
523
517
|
};
|
|
524
518
|
}
|
|
525
|
-
function
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
name,
|
|
536
|
-
resolveUpstream(name, service.upstream ?? {}),
|
|
537
|
-
]));
|
|
538
|
-
}
|
|
539
|
-
function resolveUpstreams(upstreams = {}) {
|
|
540
|
-
return Object.fromEntries(Object.entries(upstreams).map(([name, upstream]) => [
|
|
541
|
-
name,
|
|
542
|
-
resolveUpstream(name, upstream),
|
|
543
|
-
]));
|
|
544
|
-
}
|
|
545
|
-
function resolveUpstream(name, upstream) {
|
|
519
|
+
function resolveUpstreamsOptions(services, upstreams = {}) {
|
|
520
|
+
function resolveUpstream(name, upstream) {
|
|
521
|
+
return {
|
|
522
|
+
...upstream,
|
|
523
|
+
scheme: upstream.scheme,
|
|
524
|
+
host: upstream.host ?? name,
|
|
525
|
+
port: upstream.port ?? (upstream.scheme === 'https' ? 443 : 80),
|
|
526
|
+
locations: upstream.locations ?? { [`/${name}/`]: {} },
|
|
527
|
+
};
|
|
528
|
+
}
|
|
546
529
|
return {
|
|
547
|
-
...
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
530
|
+
...Object.fromEntries(Object.entries(services)
|
|
531
|
+
.filter(([name]) =>
|
|
532
|
+
// Exclude base services handled separately.
|
|
533
|
+
name !== 'dex' && name !== 'nginx' && name !== 'oauth2_proxy')
|
|
534
|
+
.map(([name, service]) => [
|
|
535
|
+
name,
|
|
536
|
+
resolveUpstream(name, { scheme: 'http', ...service.upstream }),
|
|
537
|
+
])),
|
|
538
|
+
...Object.fromEntries(Object.entries(upstreams).map(([name, upstream]) => [
|
|
539
|
+
name,
|
|
540
|
+
resolveUpstream(name, {
|
|
541
|
+
scheme: services[name] === undefined ? 'https' : 'http',
|
|
542
|
+
...upstream,
|
|
543
|
+
}),
|
|
544
|
+
])),
|
|
552
545
|
};
|
|
553
546
|
}
|
|
554
547
|
function resolveIdpOption(idp) {
|
|
@@ -643,21 +636,30 @@ function resolveConfig(options, config, vitePort) {
|
|
|
643
636
|
depends_on: ['dex'],
|
|
644
637
|
},
|
|
645
638
|
}),
|
|
646
|
-
...options.services,
|
|
639
|
+
...Object.fromEntries(Object.entries(options.services).map(([name, { upstream: _upstream, ...service }]) => [name, service])),
|
|
647
640
|
},
|
|
648
|
-
upstreams: Object.fromEntries(Object.entries(upstreams).map(([name, upstream]) =>
|
|
649
|
-
name
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
641
|
+
upstreams: Object.fromEntries(Object.entries(upstreams).map(([name, upstream]) => {
|
|
642
|
+
const external = options.upstreams?.[name] !== undefined &&
|
|
643
|
+
options.services[name] === undefined;
|
|
644
|
+
return [
|
|
645
|
+
name,
|
|
646
|
+
{
|
|
647
|
+
...upstream,
|
|
648
|
+
locations: Object.fromEntries(Object.entries(upstream.locations ?? {}).map(([path, policy]) => [
|
|
649
|
+
path,
|
|
650
|
+
{
|
|
651
|
+
auth: { ...DefaultProxyPolicy.auth, ...policy.auth },
|
|
652
|
+
headers: {
|
|
653
|
+
...(external
|
|
654
|
+
? { ...DefaultProxyPolicy.headers, Host: upstream.host }
|
|
655
|
+
: DefaultProxyPolicy.headers),
|
|
656
|
+
...policy.headers,
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
])),
|
|
660
|
+
},
|
|
661
|
+
];
|
|
662
|
+
})),
|
|
661
663
|
};
|
|
662
664
|
}
|
|
663
665
|
|
package/dist/types.d.ts
CHANGED
|
@@ -15,7 +15,8 @@ export type VisageOptions = {
|
|
|
15
15
|
*/
|
|
16
16
|
readonly port?: number;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* OAuth2 Proxy session cookie settings for name, browser scope, lifetime, and
|
|
19
|
+
* refresh timing.
|
|
19
20
|
*/
|
|
20
21
|
readonly cookie?: VisageCookiePolicy;
|
|
21
22
|
/**
|
|
@@ -38,37 +39,48 @@ export type VisageOptions = {
|
|
|
38
39
|
readonly upstreams?: Record<string, VisageUpstream>;
|
|
39
40
|
};
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
+
* Settings for the browser session cookie managed by OAuth2 Proxy.
|
|
43
|
+
*
|
|
44
|
+
* OAuth2 Proxy keeps OIDC session state behind this cookie. The cookie lifetime
|
|
45
|
+
* caps the browser session, while the refresh interval controls when OAuth2
|
|
46
|
+
* Proxy tries to renew token state with the provider.
|
|
42
47
|
*/
|
|
43
48
|
export type VisageCookiePolicy = {
|
|
44
49
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
50
|
+
* Browser session cookie base name. When no domains are configured, Visage
|
|
51
|
+
* renders a host-only name with a `__Host-` prefix, so the default rendered
|
|
52
|
+
* name is `__Host-session`.
|
|
48
53
|
*
|
|
49
54
|
* @defaultValue `'session'`
|
|
50
55
|
*/
|
|
51
56
|
readonly name?: string;
|
|
52
57
|
/**
|
|
53
|
-
* Maximum
|
|
58
|
+
* Maximum browser session lifetime. Rendered as OAuth2 Proxy `cookie_expire`
|
|
59
|
+
* using its duration syntax. Keep this aligned with the identity provider's
|
|
60
|
+
* refresh-token lifetime to avoid sessions that can no longer be renewed
|
|
61
|
+
* silently.
|
|
54
62
|
*
|
|
55
63
|
* @defaultValue `'8h'`
|
|
56
64
|
*/
|
|
57
65
|
readonly expire?: string;
|
|
58
66
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
67
|
+
* Session age after which OAuth2 Proxy attempts silent renewal using the
|
|
68
|
+
* stored refresh token, when one is available. Rendered as `cookie_refresh`
|
|
69
|
+
* using OAuth2 Proxy duration syntax. If upstreams validate forwarded access
|
|
70
|
+
* tokens, set this below the access-token lifetime so OAuth2 Proxy refreshes
|
|
71
|
+
* before forwarding an expired bearer token.
|
|
61
72
|
*
|
|
62
73
|
* @defaultValue `'15m'`
|
|
63
74
|
*/
|
|
64
75
|
readonly refresh?: string;
|
|
65
76
|
/**
|
|
66
|
-
* Cookie domains for sharing
|
|
67
|
-
*
|
|
77
|
+
* Cookie domains for sharing one session across hostnames. Omit for a
|
|
78
|
+
* host-only cookie.
|
|
68
79
|
*/
|
|
69
80
|
readonly domains?: readonly string[];
|
|
70
81
|
/**
|
|
71
|
-
* Cookie path scope.
|
|
82
|
+
* Cookie path scope. Keep broad enough for every protected route that should
|
|
83
|
+
* send the session.
|
|
72
84
|
*
|
|
73
85
|
* @defaultValue `'/'`
|
|
74
86
|
*/
|
|
@@ -254,13 +266,13 @@ export type VisageUpstream = {
|
|
|
254
266
|
/**
|
|
255
267
|
* URL scheme NGINX should use when proxying to this upstream.
|
|
256
268
|
*
|
|
257
|
-
* @defaultValue `'http'`
|
|
269
|
+
* @defaultValue `'https'` for external upstreams; `'http'` otherwise.
|
|
258
270
|
*/
|
|
259
271
|
readonly scheme?: 'http' | 'https';
|
|
260
272
|
/**
|
|
261
273
|
* Port NGINX should proxy to on {@link VisageUpstream.host}.
|
|
262
274
|
*
|
|
263
|
-
* @defaultValue `80`
|
|
275
|
+
* @defaultValue `80`, or `443` when {@link VisageUpstream.scheme} is `'https'`.
|
|
264
276
|
*/
|
|
265
277
|
readonly port?: number;
|
|
266
278
|
/**
|
|
@@ -304,7 +316,8 @@ export type VisageProxyPolicy = {
|
|
|
304
316
|
* Request headers to set when proxying to the upstream. Values may include
|
|
305
317
|
* NGINX variables. These are merged with Visage's default proxy headers:
|
|
306
318
|
* `Cookie`, `Host`, `X-Real-IP`, `X-Forwarded-For`, and
|
|
307
|
-
* `X-Forwarded-Proto`.
|
|
319
|
+
* `X-Forwarded-Proto`. `Host` defaults to the upstream host for top-level
|
|
320
|
+
* upstreams with no matching service, and to `$host` otherwise.
|
|
308
321
|
*/
|
|
309
322
|
readonly headers?: {
|
|
310
323
|
readonly [key: string]: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,gBAAgB,GAAG,wBAAwB,CAAC;IAC3D;;OAEG;IACH,QA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