@blakearoberts/visage 0.0.1-rc.9 → 0.0.2-rc.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/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Visage
2
2
 
3
- Visage (`/vit·ɛdʒ/`) is a Vite plugin for local development with HMR and OIDC session cookie lifecycle semantics.
3
+ Visage (`/vit·ɛdʒ/`) is a Vite plugin for local development with HMR and OIDC
4
+ session cookie lifecycle semantics.
4
5
 
5
6
  ## Getting Started
6
7
 
@@ -21,17 +22,38 @@ export default defineConfig({
21
22
  });
22
23
  ```
23
24
 
24
- Then start Vite normally:
25
+ Start Vite normally:
25
26
 
26
27
  ```console
27
28
  vite
28
29
  ```
29
30
 
31
+ By default, you can reach the app at `https://localhost:9001`. You will be
32
+ redirected to Dex to sign in. The default username and password is
33
+ `user@example.com` and `pass`.
34
+
35
+ ## Why Visage
36
+
37
+ Visage is a local development harness for web apps that run behind an
38
+ auth-protected edge, where browser sessions are represented by secure cookies
39
+ backed by OIDC tokens.
40
+
41
+ Visage narrows the gap between local development, automated tests, and
42
+ production by bringing production-like session lifecycle semantics to local Vite
43
+ development without giving up HMR. That makes it practical to iterate on SSR
44
+ identity injection, session timeout recovery, lock screens, and authenticated
45
+ API calls.
46
+
47
+ Visage can also use a hosted IdP, so local frontend code can call hosted backend
48
+ APIs with real credentials. That avoids frontend-only auth mocks or backend-only
49
+ local bypasses: code can be written for production and still work locally.
50
+
30
51
  ## Configuration
31
52
 
32
53
  Visage is configured through `visage(options?)` in `vite.config.ts`.
33
54
 
34
- The top-level `host` and `port` configure the local Visage origin that the browser visits:
55
+ The top-level `host` and `port` configure the local Visage origin that the
56
+ browser visits:
35
57
 
36
58
  ```ts
37
59
  visage({ host: 'localhost', port: 9001 });
@@ -62,19 +84,53 @@ visage({
62
84
  });
63
85
  ```
64
86
 
65
- See [`VisageOptions`](src/types.ts) for the full option surface.
87
+ Authenticated upstream locations do not forward bearer tokens by default. Set
88
+ `auth.forward` to `true` to forward the default bearer token for the upstream
89
+ kind: external upstreams receive the OAuth access token, while local service
90
+ upstreams receive the OIDC ID token.
91
+
92
+ Hosted backend APIs that validate bearer auth should generally receive the
93
+ access token, provided the token is issued for that API's issuer, audience, and
94
+ scopes. Use `'access'` or `'id'` when you need to force a specific token kind.
66
95
 
67
- ## Expected Local URLs
96
+ ```ts
97
+ visage({
98
+ upstreams: {
99
+ api: {
100
+ locations: {
101
+ '/api/': { auth: { forward: true } },
102
+ },
103
+ },
104
+ },
105
+ });
106
+ ```
68
107
 
69
- The browser-facing Visage origin is `https://{host}:{port}`.
108
+ OAuth2 Proxy identity values can also be mapped explicitly through headers such
109
+ as `$auth_user`, `$auth_email`, `$auth_groups`, and `$auth_preferred_username`.
70
110
 
71
- With the default configuration, open:
111
+ Authenticated locations also get Fetch Metadata CSRF checks by default. The
112
+ built-in Vite root location uses `csrf: 'app'`, which allows same-origin
113
+ requests and top-level `GET` document navigations. Other authenticated upstream
114
+ locations use `csrf: 'api'`, which blocks same-site and cross-site browser
115
+ requests when modern Fetch Metadata headers are present. Set `csrf: 'app'` for
116
+ an upstream that serves browser pages, or `csrf: false` when the upstream
117
+ intentionally handles cross-site browser requests itself.
72
118
 
73
- ```text
74
- https://localhost:9001/
119
+ ### External IdPs
120
+
121
+ External OIDC providers use issuer discovery by default:
122
+
123
+ ```ts
124
+ visage({
125
+ idp: { issuer: 'https://idp.example.test/oauth2/default' },
126
+ });
75
127
  ```
76
128
 
77
- When using the managed Dex flow, OAuth2 Proxy serves auth endpoints under `/oauth2/` and Dex serves OIDC endpoints under `/dex/`.
129
+ Configure `authorization`, `token`, or `jwks` only when the provider endpoints
130
+ must be rendered explicitly instead of discovered from the issuer. Configure
131
+ `end_session_endpoint` when the provider supports OIDC end-session redirects.
132
+
133
+ See [`VisageOptions`](src/types.ts) for the full option surface.
78
134
 
79
135
  ## System Block Diagram
80
136
 
@@ -96,40 +152,53 @@ flowchart LR
96
152
 
97
153
  ## Required Tools
98
154
 
99
- - [Docker](https://docs.docker.com/get-started/get-docker/) with Compose v2 support through `docker compose`.
100
-
101
- ## Managed Tools
102
-
103
- ### mkcert
155
+ - [Docker](https://docs.docker.com/get-started/get-docker/) with Compose v2
156
+ support through `docker compose`.
157
+ - [`mkcert`](https://github.com/FiloSottile/mkcert#installation) installed on
158
+ `PATH`, or configured with `VISAGE_MKCERT=/path/to/mkcert`.
104
159
 
105
- Visage downloads [`mkcert`](https://github.com/FiloSottile/mkcert) from `dl.filippo.io` into `$XDG_CACHE_HOME/visage/bin/mkcert-<platform>-<arch>` when the Vite dev server starts. Visage uses it to install a local certificate authority and generate HTTPS certificates for the local proxy.
106
-
107
- ### Docker Images
160
+ ## Managed Docker Images
108
161
 
109
162
  Visage pulls these as needed based on configuration:
110
163
 
111
- | Service | Image | Source |
112
- | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- | ------------------------- |
113
- | [NGINX](https://nginx.org/) | [`nginx:1.30.0-alpine`](https://hub.docker.com/_/nginx) | Docker Hub |
114
- | [OAuth2 Proxy](https://oauth2-proxy.github.io/oauth2-proxy/) | [`quay.io/oauth2-proxy/oauth2-proxy:v7.15.2`](https://quay.io/repository/oauth2-proxy/oauth2-proxy) | Quay |
115
- | [Dex](https://dexidp.io/) | [`ghcr.io/dexidp/dex:v2.45.1`](https://github.com/dexidp/dex/pkgs/container/dex) | GitHub Container Registry |
164
+ | Service | Image | Pin |
165
+ | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------- |
166
+ | [NGINX](https://nginx.org/) | [`nginx`](https://hub.docker.com/_/nginx) | [manifest](docker-compose.images.yml) |
167
+ | [OAuth2 Proxy](https://oauth2-proxy.github.io/oauth2-proxy/) | [`quay.io/oauth2-proxy/oauth2-proxy`](https://quay.io/repository/oauth2-proxy/oauth2-proxy) | [manifest](docker-compose.images.yml) |
168
+ | [Dex](https://dexidp.io/) | [`ghcr.io/dexidp/dex`](https://github.com/dexidp/dex/pkgs/container/dex) | [manifest](docker-compose.images.yml) |
116
169
 
117
170
  ## Security Notes
118
171
 
119
- Visage is local-development tooling. It starts local auth infrastructure, terminates local HTTPS, and forwards authenticated identity or token material to configured upstreams.
172
+ Visage is local-development tooling. It starts local auth infrastructure,
173
+ terminates local HTTPS, and forwards authenticated identity or token material to
174
+ configured upstreams.
175
+
176
+ Please report suspected vulnerabilities through GitHub private vulnerability
177
+ reporting as described in [Security Policy](SECURITY.md).
178
+
179
+ Do not treat the managed Dex and OAuth2 Proxy defaults as production auth
180
+ infrastructure.
120
181
 
121
- Do not treat the managed Dex and OAuth2 Proxy defaults as production auth infrastructure.
182
+ Visage's CSRF policy is an edge request-isolation guard for cookie-backed
183
+ locations. It is not a replacement for application-owned CSRF tokens where an
184
+ application accepts form posts or other browser-submitted mutations. CSP,
185
+ `frame-ancestors`, and other click-jacking controls remain application policy.
122
186
 
123
187
  ## Troubleshooting
124
188
 
125
- - If startup fails immediately, confirm Docker is running and `docker compose` works.
189
+ - If startup fails immediately, confirm Docker is running and `docker compose`
190
+ works.
126
191
  - If NGINX cannot start, check whether the configured `port` is already in use.
127
- - If the hostname cannot be resolved, Visage may need permission to update `/etc/hosts`.
128
- - If the browser rejects the certificate, allow the local certificate authority prompt from `mkcert`; CI test runners should be configured to ignore local HTTPS errors.
192
+ - If the hostname cannot be resolved, Visage may need permission to update
193
+ `/etc/hosts`.
194
+ - If the browser rejects the certificate, allow the local certificate authority
195
+ prompt from `mkcert`; CI test runners should be configured to ignore local
196
+ HTTPS errors.
129
197
 
130
198
  ## TO-DO
131
199
 
132
- - [ ] Support SSR injection of identity into HTML responses as script tag elements.
200
+ - [ ] Harden the default security posture by addressing the
201
+ [security hardening backlog](docs/security-hardening.md).
133
202
  - [ ] Support configuring [Dex connectors](https://dexidp.io/docs/connectors/).
134
203
  - [ ] Support configuring Dex on a distinct subdomain, such as `auth.localhost`.
135
204
  - [ ] Support optional [HTTP mode without local TLS](docs/tls-http-mode.md).
package/dist/certs.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- type Options = {
2
- certs: string;
3
- hostname: string;
4
- };
5
- export declare function ensureCerts({ certs, hostname }: Options): Promise<void>;
6
- export {};
1
+ import type { VisageConfig } from './config';
2
+ export declare function ensureCerts(config: VisageConfig): Promise<void>;
7
3
  //# sourceMappingURL=certs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"certs.d.ts","sourceRoot":"","sources":["../src/certs.ts"],"names":[],"mappings":"AAcA,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,wBAAsB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA0C7E"}
1
+ {"version":3,"file":"certs.d.ts","sourceRoot":"","sources":["../src/certs.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,wBAAsB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCrE"}
package/dist/compose.d.ts CHANGED
@@ -1,4 +1,5 @@
1
+ import type { VisageConfig } from './config';
1
2
  type StopCompose = () => void;
2
- export declare function startCompose(file: string): StopCompose;
3
+ export declare function startCompose(config: VisageConfig): StopCompose;
3
4
  export {};
4
5
  //# sourceMappingURL=compose.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAIA,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC;AAI9B,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAwCtD"}
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC;AAI9B,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CA0C9D"}
package/dist/config.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import type { ResolvedConfig } from 'vite';
2
- import type { VisageDexExpiry, VisageDexOptions, VisageDexUser, VisageExternalIdpOptions, VisageOptions, VisageProxyPolicy, VisageService, VisageUpstream } from './types';
1
+ import type { VisageDexExpiry, VisageDexOptions, VisageDexUser, VisageExternalIdpOptions, VisageOptions, VisageService } from './types';
3
2
  type Volume = readonly [from: string, to: string];
4
3
  type ResolvedCookiePolicy = {
5
4
  readonly cookie_name: string;
@@ -15,8 +14,25 @@ type ResolvedOAuth2Client = {
15
14
  readonly id: string;
16
15
  readonly secret?: string;
17
16
  readonly scopes: readonly string[];
17
+ readonly emailDomains: readonly string[];
18
18
  readonly public: boolean;
19
19
  };
20
+ type ResolvedProxyPolicy = {
21
+ readonly auth: {
22
+ readonly enabled: boolean;
23
+ readonly forward: false | 'id' | 'access';
24
+ readonly redirect: boolean;
25
+ };
26
+ readonly csrf: false | 'app' | 'api';
27
+ readonly headers: Readonly<Record<string, string>>;
28
+ readonly directives: Readonly<Record<string, readonly string[]>>;
29
+ };
30
+ type ResolvedUpstream = {
31
+ readonly scheme: 'http' | 'https';
32
+ readonly host: string;
33
+ readonly port: number;
34
+ readonly locations: Readonly<Record<string, ResolvedProxyPolicy>>;
35
+ };
20
36
  type ResolvedVisageOptions = {
21
37
  readonly host: string;
22
38
  readonly port: number;
@@ -24,38 +40,41 @@ type ResolvedVisageOptions = {
24
40
  readonly idp: ResolvedIdpOption;
25
41
  readonly oauth2: ResolvedOAuth2Client;
26
42
  readonly services: Readonly<Record<string, VisageService>>;
27
- readonly upstreams: Record<string, VisageUpstream>;
43
+ readonly upstreams: Record<string, ResolvedUpstream>;
28
44
  };
29
- type ResolvedBaseIdpConfig = {
30
- readonly upstream: string;
45
+ type OIDCEndpointConfig = {
31
46
  readonly issuer: string;
47
+ readonly authorization?: string;
48
+ readonly token?: string;
49
+ readonly jwks?: string;
50
+ readonly end_session_endpoint?: string;
51
+ };
52
+ type ManualOIDCEndpointConfig = OIDCEndpointConfig & {
32
53
  readonly authorization: string;
33
54
  readonly token: string;
34
55
  readonly jwks: string;
35
56
  };
36
- type ResolvedDexIdpConfig = ResolvedBaseIdpConfig & {
57
+ type ResolvedDexIdpConfig = {
37
58
  readonly dex: {
38
59
  readonly expiry?: VisageDexExpiry;
39
60
  readonly users: readonly VisageDexUser[];
40
61
  };
62
+ readonly oidc: ManualOIDCEndpointConfig;
63
+ readonly upstream: {
64
+ readonly dex: ResolvedUpstream;
65
+ };
41
66
  };
42
- type ResolvedExternalIdpConfig = ResolvedBaseIdpConfig & {
43
- readonly dex?: never;
67
+ type ResolvedExternalIdpConfig = {
68
+ readonly oidc: OIDCEndpointConfig;
69
+ readonly upstream: {
70
+ readonly idp: ResolvedUpstream;
71
+ };
44
72
  };
45
73
  type ResolvedIdpConfig = ResolvedDexIdpConfig | ResolvedExternalIdpConfig;
46
- type ResolvedService = Omit<VisageService, 'upstream'>;
47
- type ResolvedUpstream = {
48
- readonly scheme: 'http' | 'https';
49
- readonly host: string;
50
- readonly port: number;
51
- readonly locations: Readonly<Record<string, VisageProxyPolicy>>;
74
+ type ResolvedService = Omit<VisageService, 'upstream'> & {
75
+ readonly restart: NonNullable<VisageService['restart']>;
52
76
  };
53
- type ResolvedProxyPolicy = {
54
- readonly auth: Required<VisageProxyPolicy['auth']>;
55
- readonly headers: VisageProxyPolicy['headers'];
56
- };
57
- type ResolvedConfigUpstream = Omit<ResolvedUpstream, 'locations'> & {
58
- readonly locations: Readonly<Record<string, ResolvedProxyPolicy>>;
77
+ type ResolvedConfigUpstream = ResolvedUpstream & {
59
78
  readonly external: boolean;
60
79
  };
61
80
  export type VisageConfig = {
@@ -71,12 +90,20 @@ export type VisageConfig = {
71
90
  readonly dex: Volume;
72
91
  readonly nginx: Volume;
73
92
  readonly oauth2Proxy: Volume;
74
- readonly oauth2ProxyClientSecret: Volume;
93
+ };
94
+ readonly secrets: {
95
+ readonly cookieSecret: string;
96
+ readonly clientSecret: string;
97
+ };
98
+ readonly network: {
99
+ readonly name: string;
100
+ readonly trustedProxyIps: readonly string[];
75
101
  };
76
102
  readonly services: Readonly<Record<string, ResolvedService>>;
77
103
  readonly upstreams: Readonly<Record<string, ResolvedConfigUpstream>>;
78
104
  };
105
+ export declare const VisageEdgeKeyHeader = "X-Visage-Edge-Key";
79
106
  export declare function resolveOptions(options: VisageOptions): ResolvedVisageOptions;
80
- export declare function resolveConfig(options: ResolvedVisageOptions, config: ResolvedConfig, vitePort: number): VisageConfig;
107
+ export declare function resolveConfig(options: ResolvedVisageOptions, cache: string, edgeKey?: string): VisageConfig;
81
108
  export {};
82
109
  //# sourceMappingURL=config.d.ts.map
@@ -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,EACb,iBAAiB,EACjB,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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CAAC,CAAC,CAAC;IAC7D,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAiHvD,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,qBAAqB,CAyD5E;AAsLD,wBAAgB,aAAa,CAC3B,OAAO,EAAE,qBAAqB,EAC9B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,GACf,YAAY,CAsFd"}
package/dist/hosts.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export declare function ensureHostEntry(hostname: string): void;
1
+ import type { VisageConfig } from './config';
2
+ export declare function ensureHostEntry({ host }: VisageConfig): void;
2
3
  //# sourceMappingURL=hosts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../src/hosts.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAyDtD"}
1
+ {"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../src/hosts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,YAAY,GAAG,IAAI,CAyD5D"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- import type { Plugin } from 'vite';
2
- import type { VisageOptions } from './types';
3
1
  export type { VisageCookiePolicy, VisageDexExpiry, VisageDexOptions, VisageDexUser, VisageExternalIdpOptions, VisageOAuth2Client, VisageOptions, VisageProxyPolicy, VisageService, VisageUpstream, } from './types';
4
- export declare function visage(options?: VisageOptions): Plugin;
5
- export default visage;
2
+ export { default, visage } from './plugin';
3
+ export { createVisageServer, type VisageServer } from './server';
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAOnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAC;AAUjB,wBAAgB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CAgE1D;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC"}