@blakearoberts/visage 0.0.1-rc.3 → 0.0.1-rc.30

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,55 +22,115 @@ 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:
57
+
58
+ ```ts
59
+ visage({ host: 'localhost', port: 9001 });
60
+ ```
61
+
62
+ ### Services
63
+
64
+ Services are Docker Compose services managed by the Vite dev-server lifecycle.
65
+ Additional services automatically get a matching managed upstream with the same
66
+ name, host, and default `/{name}/` location.
35
67
 
36
68
  ```ts
37
69
  visage({
38
- host: 'localhost',
39
- port: 9001,
70
+ services: { whoami: { image: 'traefik/whoami' } },
40
71
  });
41
72
  ```
42
73
 
43
- Services are Docker Compose services managed by the Vite dev-server lifecycle. Upstreams are proxy targets that Visage routes to, whether they are managed services or external systems.
74
+ ### Upstreams
75
+
76
+ Upstreams are proxy targets that Visage routes to. A top-level upstream with no
77
+ matching service entry is treated as an external upstream.
44
78
 
45
79
  ```ts
46
80
  visage({
47
- services: {
48
- whoami: { image: 'traefik/whoami' },
81
+ upstreams: {
82
+ api: { host: 'api.local.test', locations: { '/api/': {} } },
49
83
  },
84
+ });
85
+ ```
86
+
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.
95
+
96
+ ```ts
97
+ visage({
50
98
  upstreams: {
51
- whoami: {
52
- host: 'whoami',
53
- port: 80,
54
- locations: { '/whoami/': {} },
99
+ api: {
100
+ locations: {
101
+ '/api/': { auth: { forward: true } },
102
+ },
55
103
  },
56
104
  },
57
105
  });
58
106
  ```
59
107
 
60
- See `VisageOptions` for the full option surface.
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`.
61
110
 
62
- ## Expected Local URLs
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.
63
118
 
64
- The browser-facing Visage origin is `https://{host}:{port}`.
119
+ ### External IdPs
65
120
 
66
- With the default configuration, open:
121
+ External OIDC providers use issuer discovery by default:
67
122
 
68
- ```text
69
- https://localhost:9001/
123
+ ```ts
124
+ visage({
125
+ idp: { issuer: 'https://idp.example.test/oauth2/default' },
126
+ });
70
127
  ```
71
128
 
72
- 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.
73
134
 
74
135
  ## System Block Diagram
75
136
 
@@ -91,37 +152,53 @@ flowchart LR
91
152
 
92
153
  ## Required Tools
93
154
 
94
- - [Docker](https://docs.docker.com/get-started/get-docker/) with Compose v2 support through `docker compose`.
95
-
96
- ## Managed Tools
97
-
98
- ### 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`.
99
159
 
100
- Visage downloads [`mkcert`](https://github.com/FiloSottile/mkcert) from `dl.filippo.io` when the Vite dev server starts. Visage uses it to install a local certificate authority and generate HTTPS certificates for the local proxy.
101
-
102
- ### Docker Images
160
+ ## Managed Docker Images
103
161
 
104
162
  Visage pulls these as needed based on configuration:
105
163
 
106
- - [NGINX](https://nginx.org/): [`nginx:1.30.0-alpine`](https://hub.docker.com/_/nginx).
107
- - [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).
108
- - [Dex](https://dexidp.io/): [`ghcr.io/dexidp/dex:v2.45.1`](https://github.com/dexidp/dex/pkgs/container/dex).
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) |
109
169
 
110
170
  ## Security Notes
111
171
 
112
- 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.
113
181
 
114
- 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.
115
186
 
116
187
  ## Troubleshooting
117
188
 
118
- - 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.
119
191
  - If NGINX cannot start, check whether the configured `port` is already in use.
120
- - If the hostname cannot be resolved, Visage may need permission to update `/etc/hosts`.
121
- - If the browser rejects the certificate, allow the local certificate authority prompt from `mkcert`.
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.
122
197
 
123
198
  ## TO-DO
124
199
 
200
+ - [ ] Harden the default security posture by addressing the
201
+ [security hardening backlog](docs/security-hardening.md).
125
202
  - [ ] Support configuring [Dex connectors](https://dexidp.io/docs/connectors/).
126
- - [ ] Support configuring Dex on a distinct subdomain, such as `auth.local.vite.app`.
203
+ - [ ] Support configuring Dex on a distinct subdomain, such as `auth.localhost`.
127
204
  - [ ] Support optional [HTTP mode without local TLS](docs/tls-http-mode.md).
package/dist/certs.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- type Options = {
2
- bin: string;
3
- certs: string;
4
- hostname: string;
5
- };
6
- export declare function ensureCerts({ bin, certs, hostname, }: Options): Promise<void>;
7
- export {};
1
+ import type { VisageConfig } from './config';
2
+ export declare function ensureCerts(config: VisageConfig): Promise<void>;
8
3
  //# sourceMappingURL=certs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"certs.d.ts","sourceRoot":"","sources":["../src/certs.ts"],"names":[],"mappings":"AAOA,KAAK,OAAO,GAAG;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAsB,WAAW,CAAC,EAChC,GAAG,EACH,KAAK,EACL,QAAQ,GACT,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCzB"}
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":"AAGA,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC;AAI9B,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAoBtD"}
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, VisageDexUser, VisageOptions, 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;
@@ -8,55 +7,81 @@ type ResolvedCookiePolicy = {
8
7
  readonly cookie_domains?: readonly string[];
9
8
  readonly cookie_path: string;
10
9
  };
11
- type ResolvedDexConfig = {
12
- readonly expiry?: VisageDexExpiry;
13
- readonly users: readonly Required<VisageDexUser>[];
14
- };
15
10
  type ResolvedIdpOption = {
16
- readonly path: string;
17
- readonly upstream: string;
18
- readonly issuer?: string;
19
- readonly authorizationEndpoint?: string;
20
- readonly tokenEndpoint?: string;
21
- readonly jwksEndpoint?: string;
22
- } & ({
23
- readonly kind: 'dex';
24
- readonly dex: ResolvedDexConfig;
25
- } | {
26
- readonly kind: 'external';
27
- });
28
- type ResolvedIdp = {
29
- readonly issuer: string;
30
- readonly authorizationEndpoint: string;
31
- readonly tokenEndpoint: string;
32
- readonly jwksEndpoint: string;
33
- readonly upstream: string;
34
- } & ({
35
- readonly kind: 'dex';
36
- readonly dex: ResolvedDexConfig;
37
- } | {
38
- readonly kind: 'external';
39
- });
11
+ readonly dex: VisageDexOptions;
12
+ } | VisageExternalIdpOptions;
40
13
  type ResolvedOAuth2Client = {
41
14
  readonly id: string;
42
15
  readonly secret?: string;
43
16
  readonly scopes: readonly string[];
17
+ readonly emailDomains: readonly string[];
44
18
  readonly public: boolean;
45
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
+ };
46
36
  type ResolvedVisageOptions = {
47
37
  readonly host: string;
48
38
  readonly port: number;
49
39
  readonly cookie: ResolvedCookiePolicy;
50
40
  readonly idp: ResolvedIdpOption;
51
41
  readonly oauth2: ResolvedOAuth2Client;
52
- readonly services?: Record<string, VisageService>;
53
- readonly upstreams?: Record<string, VisageUpstream>;
42
+ readonly services: Readonly<Record<string, VisageService>>;
43
+ readonly upstreams: Record<string, ResolvedUpstream>;
44
+ };
45
+ type OIDCEndpointConfig = {
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 & {
53
+ readonly authorization: string;
54
+ readonly token: string;
55
+ readonly jwks: string;
56
+ };
57
+ type ResolvedDexIdpConfig = {
58
+ readonly dex: {
59
+ readonly expiry?: VisageDexExpiry;
60
+ readonly users: readonly VisageDexUser[];
61
+ };
62
+ readonly oidc: ManualOIDCEndpointConfig;
63
+ readonly upstream: {
64
+ readonly dex: ResolvedUpstream;
65
+ };
66
+ };
67
+ type ResolvedExternalIdpConfig = {
68
+ readonly oidc: OIDCEndpointConfig;
69
+ readonly upstream: {
70
+ readonly idp: ResolvedUpstream;
71
+ };
72
+ };
73
+ type ResolvedIdpConfig = ResolvedDexIdpConfig | ResolvedExternalIdpConfig;
74
+ type ResolvedService = Omit<VisageService, 'upstream'> & {
75
+ readonly restart: NonNullable<VisageService['restart']>;
76
+ };
77
+ type ResolvedConfigUpstream = ResolvedUpstream & {
78
+ readonly external: boolean;
54
79
  };
55
80
  export type VisageConfig = {
56
81
  readonly host: string;
57
82
  readonly port: number;
58
83
  readonly cookie: ResolvedCookiePolicy;
59
- readonly idp: ResolvedIdp;
84
+ readonly idp: ResolvedIdpConfig;
60
85
  readonly oauth2: ResolvedOAuth2Client;
61
86
  readonly cache: string;
62
87
  readonly files: {
@@ -65,12 +90,20 @@ export type VisageConfig = {
65
90
  readonly dex: Volume;
66
91
  readonly nginx: Volume;
67
92
  readonly oauth2Proxy: Volume;
68
- readonly oauth2ProxyClientSecret: Volume;
69
93
  };
70
- readonly services: Readonly<Record<string, VisageService>>;
71
- readonly upstreams: Readonly<Record<string, VisageUpstream>>;
94
+ readonly secrets: {
95
+ readonly cookieSecret: string;
96
+ readonly clientSecret: string;
97
+ };
98
+ readonly network: {
99
+ readonly name: string;
100
+ readonly trustedProxyIps: readonly string[];
101
+ };
102
+ readonly services: Readonly<Record<string, ResolvedService>>;
103
+ readonly upstreams: Readonly<Record<string, ResolvedConfigUpstream>>;
72
104
  };
105
+ export declare const VisageEdgeKeyHeader = "X-Visage-Edge-Key";
73
106
  export declare function resolveOptions(options: VisageOptions): ResolvedVisageOptions;
74
- export declare function resolveConfig(options: ResolvedVisageOptions, config: ResolvedConfig, vitePort: number): VisageConfig;
107
+ export declare function resolveConfig(options: ResolvedVisageOptions, cache: string, edgeKey?: string): VisageConfig;
75
108
  export {};
76
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,EAEf,aAAa,EAEb,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,GAAG;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;CACpD,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,GAAG,CACA;IACE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,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KAC9B,CAAC;IACF,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;KAC/B,CAAC;IACF,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;KAC7C,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,sBAAsB,CAAC,CAAC,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAmGvD,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
- export type { VisageCookiePolicy, VisageDexExpiry, VisageDexOptions, VisageDexUser, VisageIdpOptions, VisageOAuth2Client, VisageOptions, VisageProxyPolicy, VisageService, VisageUpstream, } from './types';
4
- export declare function visage(options?: VisageOptions): Plugin;
5
- export default visage;
1
+ export type { VisageCookiePolicy, VisageDexExpiry, VisageDexOptions, VisageDexUser, VisageExternalIdpOptions, VisageOAuth2Client, VisageOptions, VisageProxyPolicy, VisageService, VisageUpstream, } from './types';
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;AAE7C,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,wBAAgB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CAmD1D;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"}