@aigile/auth-oidc 0.0.0-stage → 0.2.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/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/package.json +29 -4
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AuthProvider, AuthResult, AuthenticatedUser, DataStore, OidcConfig } from '@aigile/core';
|
|
2
|
+
export interface OidcAuthOptions {
|
|
3
|
+
config: OidcConfig;
|
|
4
|
+
sessionSecret: string;
|
|
5
|
+
sessionTtlSeconds: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Placeholder OIDC provider. Implements {@link AuthProvider} so the runtime can
|
|
9
|
+
* wire it by config, but the authorization-code flow is not built yet — the
|
|
10
|
+
* redirect-flow methods throw, and session verification rejects everything.
|
|
11
|
+
*
|
|
12
|
+
* When implemented, this will use `options.config` (issuer/clientId/clientSecret/
|
|
13
|
+
* scopes) to drive the standard code flow and mint sessions the same shape as the
|
|
14
|
+
* local provider.
|
|
15
|
+
*/
|
|
16
|
+
export declare class OidcAuthProvider implements AuthProvider {
|
|
17
|
+
private readonly store;
|
|
18
|
+
private readonly options;
|
|
19
|
+
readonly id = "oidc";
|
|
20
|
+
constructor(store: DataStore, options: OidcAuthOptions);
|
|
21
|
+
init(): Promise<void>;
|
|
22
|
+
getAuthorizationUrl(_redirectUri: string, _state: string): Promise<string>;
|
|
23
|
+
handleCallback(_params: Record<string, string>, _redirectUri: string): Promise<AuthResult | null>;
|
|
24
|
+
verifySession(_token: string): Promise<AuthenticatedUser | null>;
|
|
25
|
+
revokeSession(_token: string): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,UAAU,EACX,MAAM,cAAc,CAAC;AAMtB,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,qBAAa,gBAAiB,YAAW,YAAY;IAIjD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ1B,QAAQ,CAAC,EAAE,UAAU;gBAGF,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,eAAe;IAMrC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1E,cAAc,CAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAIvB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAIhE,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const NOT_IMPLEMENTED = 'OIDC authentication is not implemented yet. This is a conforming stub that ' +
|
|
2
|
+
'reserves the redirect-flow seam (getAuthorizationUrl/handleCallback).';
|
|
3
|
+
/**
|
|
4
|
+
* Placeholder OIDC provider. Implements {@link AuthProvider} so the runtime can
|
|
5
|
+
* wire it by config, but the authorization-code flow is not built yet — the
|
|
6
|
+
* redirect-flow methods throw, and session verification rejects everything.
|
|
7
|
+
*
|
|
8
|
+
* When implemented, this will use `options.config` (issuer/clientId/clientSecret/
|
|
9
|
+
* scopes) to drive the standard code flow and mint sessions the same shape as the
|
|
10
|
+
* local provider.
|
|
11
|
+
*/
|
|
12
|
+
export class OidcAuthProvider {
|
|
13
|
+
store;
|
|
14
|
+
options;
|
|
15
|
+
id = 'oidc';
|
|
16
|
+
constructor(store, options) {
|
|
17
|
+
this.store = store;
|
|
18
|
+
this.options = options;
|
|
19
|
+
void this.store;
|
|
20
|
+
void this.options;
|
|
21
|
+
}
|
|
22
|
+
async init() {
|
|
23
|
+
// Discovery (issuer metadata fetch) will happen here.
|
|
24
|
+
}
|
|
25
|
+
async getAuthorizationUrl(_redirectUri, _state) {
|
|
26
|
+
throw new Error(NOT_IMPLEMENTED);
|
|
27
|
+
}
|
|
28
|
+
async handleCallback(_params, _redirectUri) {
|
|
29
|
+
throw new Error(NOT_IMPLEMENTED);
|
|
30
|
+
}
|
|
31
|
+
async verifySession(_token) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
async revokeSession(_token) {
|
|
35
|
+
// No-op until implemented.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,MAAM,eAAe,GACnB,6EAA6E;IAC7E,uEAAuE,CAAC;AAQ1E;;;;;;;;GAQG;AACH,MAAM,OAAO,gBAAgB;IAIR;IACA;IAJV,EAAE,GAAG,MAAM,CAAC;IAErB,YACmB,KAAgB,EAChB,OAAwB;QADxB,UAAK,GAAL,KAAK,CAAW;QAChB,YAAO,GAAP,OAAO,CAAiB;QAEzC,KAAK,IAAI,CAAC,KAAK,CAAC;QAChB,KAAK,IAAI,CAAC,OAAO,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,sDAAsD;IACxD,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,YAAoB,EAAE,MAAc;QAC5D,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,OAA+B,EAC/B,YAAoB;QAEpB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAc;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAc;QAChC,2BAA2B;IAC7B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigile/auth-oidc",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "aigile: auth-oidc package",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"author": "Ryan Goldstein <me@ryangoldstein.com>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/RyanGoldstein/aigile.git",
|
|
10
|
+
"directory": "packages/auth-oidc"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"!dist/**/*.test.*"
|
|
16
|
+
],
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc --build"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@aigile/core": "0.2.0"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/README.md
DELETED