@blakearoberts/visage 0.0.1-rc.13 → 0.0.1-rc.15
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 +21 -0
- package/dist/config.d.ts +9 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +639 -557
- package/dist/render/nginx.d.ts.map +1 -1
- package/dist/render/oauth2-proxy.d.ts.map +1 -1
- package/dist/types.d.ts +36 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -62,6 +62,27 @@ visage({
|
|
|
62
62
|
});
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
Authenticated upstream locations forward the OIDC ID token as the upstream
|
|
66
|
+
`Authorization` bearer value by default. Set `auth.forward` to `'access'` for
|
|
67
|
+
legacy upstreams that explicitly expect the OAuth access token as
|
|
68
|
+
`Authorization: Bearer ...`.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
visage({
|
|
72
|
+
upstreams: {
|
|
73
|
+
api: {
|
|
74
|
+
locations: {
|
|
75
|
+
'/api/': { auth: { forward: 'access' } },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
OAuth2 Proxy identity values can also be mapped explicitly through headers such
|
|
83
|
+
as `$auth_user`, `$auth_email`, `$auth_groups`, and
|
|
84
|
+
`$auth_preferred_username`.
|
|
85
|
+
|
|
65
86
|
See [`VisageOptions`](src/types.ts) for the full option surface.
|
|
66
87
|
|
|
67
88
|
## Expected Local URLs
|
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ResolvedConfig } from 'vite';
|
|
2
1
|
import type { VisageDexExpiry, VisageDexOptions, VisageDexUser, VisageExternalIdpOptions, VisageOptions, VisageProxyPolicy, VisageService, VisageUpstream } from './types';
|
|
3
2
|
type Volume = readonly [from: string, to: string];
|
|
4
3
|
type ResolvedCookiePolicy = {
|
|
@@ -7,6 +6,7 @@ type ResolvedCookiePolicy = {
|
|
|
7
6
|
readonly cookie_refresh: string;
|
|
8
7
|
readonly cookie_domains?: readonly string[];
|
|
9
8
|
readonly cookie_path: string;
|
|
9
|
+
readonly cookie_secret_file: string;
|
|
10
10
|
};
|
|
11
11
|
type ResolvedIdpOption = {
|
|
12
12
|
readonly dex: VisageDexOptions;
|
|
@@ -15,6 +15,7 @@ type ResolvedOAuth2Client = {
|
|
|
15
15
|
readonly id: string;
|
|
16
16
|
readonly secret?: string;
|
|
17
17
|
readonly scopes: readonly string[];
|
|
18
|
+
readonly emailDomains: readonly string[];
|
|
18
19
|
readonly public: boolean;
|
|
19
20
|
};
|
|
20
21
|
type ResolvedVisageOptions = {
|
|
@@ -43,7 +44,9 @@ type ResolvedExternalIdpConfig = ResolvedBaseIdpConfig & {
|
|
|
43
44
|
readonly dex?: never;
|
|
44
45
|
};
|
|
45
46
|
type ResolvedIdpConfig = ResolvedDexIdpConfig | ResolvedExternalIdpConfig;
|
|
46
|
-
type ResolvedService = Omit<VisageService, 'upstream'
|
|
47
|
+
type ResolvedService = Omit<VisageService, 'upstream'> & {
|
|
48
|
+
readonly restart: NonNullable<VisageService['restart']>;
|
|
49
|
+
};
|
|
47
50
|
type ResolvedUpstream = {
|
|
48
51
|
readonly scheme: 'http' | 'https';
|
|
49
52
|
readonly host: string;
|
|
@@ -72,12 +75,14 @@ export type VisageConfig = {
|
|
|
72
75
|
readonly dex: Volume;
|
|
73
76
|
readonly nginx: Volume;
|
|
74
77
|
readonly oauth2Proxy: Volume;
|
|
75
|
-
readonly
|
|
78
|
+
readonly clientSecret: Volume;
|
|
79
|
+
readonly cookieSecret: Volume;
|
|
76
80
|
};
|
|
77
81
|
readonly services: Readonly<Record<string, ResolvedService>>;
|
|
78
82
|
readonly upstreams: Readonly<Record<string, ResolvedConfigUpstream>>;
|
|
79
83
|
};
|
|
80
84
|
export declare function resolveOptions(options: VisageOptions): ResolvedVisageOptions;
|
|
81
|
-
export declare function resolveConfig(options: ResolvedVisageOptions,
|
|
85
|
+
export declare function resolveConfig(options: ResolvedVisageOptions, cache: string): VisageConfig;
|
|
86
|
+
export declare function resolveViteUpstream(vite?: VisageUpstream): VisageUpstream;
|
|
82
87
|
export {};
|
|
83
88
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,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;IAC7B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC,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,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,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,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;KAC/B,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;AA0FF,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,qBAAqB,CAuC5E;AAwJD,wBAAgB,aAAa,CAC3B,OAAO,EAAE,qBAAqB,EAC9B,KAAK,EAAE,MAAM,GACZ,YAAY,CAmEd;AAqBD,wBAAgB,mBAAmB,CACjC,IAAI,GAAE,cAAkC,GACvC,cAAc,CAwBhB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
import type { VisageOptions } from './types';
|
|
3
|
-
export type { VisageCookiePolicy, VisageDexExpiry, VisageDexOptions, VisageDexUser, VisageExternalIdpOptions, VisageOAuth2Client, VisageOptions, VisageProxyPolicy, VisageService, VisageUpstream, } from './types';
|
|
4
|
-
export declare function
|
|
5
|
-
export default visage;
|
|
2
|
+
import type { VisageOptions, VisageServer } from './types';
|
|
3
|
+
export type { VisageCookiePolicy, VisageDexExpiry, VisageDexOptions, VisageDexUser, VisageExternalIdpOptions, VisageOAuth2Client, VisageOptions, VisageProxyPolicy, VisageServer, VisageService, VisageUpstream, } from './types';
|
|
4
|
+
export declare function createVisageServer(options: VisageOptions): VisageServer;
|
|
5
|
+
export default function visage(options?: VisageOptions): Plugin;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAOnC,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAkB,MAAM,SAAS,CAAC;AAE3E,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAgCvE;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CA4ElE"}
|