@rekog/mcp-nest 1.7.0-alpha.0 → 1.7.0-alpha.2
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/authz/guards/jwt-auth.guard.d.ts +13 -0
- package/dist/authz/guards/jwt-auth.guard.d.ts.map +1 -0
- package/dist/authz/guards/jwt-auth.guard.js +46 -0
- package/dist/authz/guards/jwt-auth.guard.js.map +1 -0
- package/dist/authz/index.d.ts +8 -1
- package/dist/authz/index.d.ts.map +1 -1
- package/dist/authz/index.js +22 -0
- package/dist/authz/index.js.map +1 -1
- package/dist/authz/interfaces/index.d.ts +3 -0
- package/dist/authz/interfaces/index.d.ts.map +1 -0
- package/dist/authz/interfaces/index.js +19 -0
- package/dist/authz/interfaces/index.js.map +1 -0
- package/dist/authz/mcp-oauth.controller.d.ts +53 -0
- package/dist/authz/mcp-oauth.controller.d.ts.map +1 -0
- package/dist/authz/mcp-oauth.controller.js +305 -0
- package/dist/authz/mcp-oauth.controller.js.map +1 -0
- package/dist/authz/mcp-oauth.module.d.ts +11 -0
- package/dist/authz/mcp-oauth.module.d.ts.map +1 -0
- package/dist/authz/mcp-oauth.module.js +173 -0
- package/dist/authz/mcp-oauth.module.js.map +1 -0
- package/dist/authz/providers/github.provider.d.ts +3 -0
- package/dist/authz/providers/github.provider.d.ts.map +1 -0
- package/dist/authz/providers/github.provider.js +23 -0
- package/dist/authz/providers/github.provider.js.map +1 -0
- package/dist/authz/providers/google.provider.d.ts +3 -0
- package/dist/authz/providers/google.provider.d.ts.map +1 -0
- package/dist/authz/providers/google.provider.js +24 -0
- package/dist/authz/providers/google.provider.js.map +1 -0
- package/dist/authz/providers/oauth-provider.interface.d.ts +75 -0
- package/dist/authz/providers/oauth-provider.interface.d.ts.map +1 -0
- package/dist/authz/providers/oauth-provider.interface.js +3 -0
- package/dist/authz/providers/oauth-provider.interface.js.map +1 -0
- package/dist/authz/services/client.service.d.ts +10 -0
- package/dist/authz/services/client.service.d.ts.map +1 -0
- package/dist/authz/services/client.service.js +84 -0
- package/dist/authz/services/client.service.js.map +1 -0
- package/dist/authz/services/jwt-token.service.d.ts +29 -0
- package/dist/authz/services/jwt-token.service.d.ts.map +1 -0
- package/dist/authz/services/jwt-token.service.js +103 -0
- package/dist/authz/services/jwt-token.service.js.map +1 -0
- package/dist/authz/services/oauth-strategy.service.d.ts +11 -0
- package/dist/authz/services/oauth-strategy.service.d.ts.map +1 -0
- package/dist/authz/services/oauth-strategy.service.js +64 -0
- package/dist/authz/services/oauth-strategy.service.js.map +1 -0
- package/dist/authz/stores/memory-store.service.d.ts +19 -0
- package/dist/authz/stores/memory-store.service.d.ts.map +1 -0
- package/dist/authz/stores/memory-store.service.js +84 -0
- package/dist/authz/stores/memory-store.service.js.map +1 -0
- package/dist/authz/stores/memory-store.service.spec.d.ts +2 -0
- package/dist/authz/stores/memory-store.service.spec.d.ts.map +1 -0
- package/dist/authz/stores/memory-store.service.spec.js +195 -0
- package/dist/authz/stores/memory-store.service.spec.js.map +1 -0
- package/dist/authz/stores/oauth-store.interface.d.ts +52 -0
- package/dist/authz/stores/oauth-store.interface.d.ts.map +1 -0
- package/dist/authz/stores/oauth-store.interface.js +3 -0
- package/dist/authz/stores/oauth-store.interface.js.map +1 -0
- package/dist/authz/stores/sqlite/sqlite-store.service.d.ts +18 -0
- package/dist/authz/stores/sqlite/sqlite-store.service.d.ts.map +1 -0
- package/dist/authz/stores/sqlite/sqlite-store.service.js +206 -0
- package/dist/authz/stores/sqlite/sqlite-store.service.js.map +1 -0
- package/dist/authz/stores/typeorm/entities/authorization-code.entity.d.ts +13 -0
- package/dist/authz/stores/typeorm/entities/authorization-code.entity.d.ts.map +1 -0
- package/dist/authz/stores/typeorm/entities/authorization-code.entity.js +60 -0
- package/dist/authz/stores/typeorm/entities/authorization-code.entity.js.map +1 -0
- package/dist/authz/stores/typeorm/entities/index.d.ts +4 -0
- package/dist/authz/stores/typeorm/entities/index.d.ts.map +1 -0
- package/dist/authz/stores/typeorm/entities/index.js +10 -0
- package/dist/authz/stores/typeorm/entities/index.js.map +1 -0
- package/dist/authz/stores/typeorm/entities/oauth-client.entity.d.ts +16 -0
- package/dist/authz/stores/typeorm/entities/oauth-client.entity.d.ts.map +1 -0
- package/dist/authz/stores/typeorm/entities/oauth-client.entity.js +72 -0
- package/dist/authz/stores/typeorm/entities/oauth-client.entity.js.map +1 -0
- package/dist/authz/stores/typeorm/entities/oauth-session.entity.d.ts +13 -0
- package/dist/authz/stores/typeorm/entities/oauth-session.entity.d.ts.map +1 -0
- package/dist/authz/stores/typeorm/entities/oauth-session.entity.js +60 -0
- package/dist/authz/stores/typeorm/entities/oauth-session.entity.js.map +1 -0
- package/dist/authz/stores/typeorm/typeorm-store.service.d.ts +21 -0
- package/dist/authz/stores/typeorm/typeorm-store.service.d.ts.map +1 -0
- package/dist/authz/stores/typeorm/typeorm-store.service.js +87 -0
- package/dist/authz/stores/typeorm/typeorm-store.service.js.map +1 -0
- package/dist/mcp/services/handlers/mcp-tools.handler.d.ts.map +1 -1
- package/dist/mcp/services/handlers/mcp-tools.handler.js.map +1 -1
- package/package.json +17 -2
- package/src/authz/guards/jwt-auth.guard.ts +45 -0
- package/src/authz/index.ts +8 -1
- package/src/authz/mcp-oauth.controller.ts +394 -0
- package/src/authz/mcp-oauth.module.ts +235 -0
- package/src/authz/providers/github.provider.ts +24 -0
- package/src/authz/providers/google.provider.ts +22 -0
- package/src/authz/providers/oauth-provider.interface.ts +102 -0
- package/src/authz/services/client.service.ts +110 -0
- package/src/authz/services/jwt-token.service.ts +127 -0
- package/src/authz/services/oauth-strategy.service.ts +55 -0
- package/src/authz/stores/memory-store.service.spec.ts +240 -0
- package/src/authz/stores/memory-store.service.ts +100 -0
- package/src/authz/stores/oauth-store.interface.ts +105 -0
- package/src/authz/stores/sqlite/sqlite-store.service.ts +279 -0
- package/src/authz/stores/typeorm/README.md +133 -0
- package/src/authz/stores/typeorm/entities/authorization-code.entity.ts +34 -0
- package/src/authz/stores/typeorm/entities/index.ts +3 -0
- package/src/authz/stores/typeorm/entities/oauth-client.entity.ts +49 -0
- package/src/authz/stores/typeorm/entities/oauth-session.entity.ts +34 -0
- package/src/authz/stores/typeorm/typeorm-store.service.ts +98 -0
- package/src/mcp/services/handlers/mcp-tools.handler.ts +5 -2
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SQLiteStore = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const better_sqlite3_1 = __importDefault(require("better-sqlite3"));
|
|
18
|
+
const crypto_1 = require("crypto");
|
|
19
|
+
let SQLiteStore = class SQLiteStore {
|
|
20
|
+
constructor(databasePath = './oauth-sqlite.db') {
|
|
21
|
+
this.sqlite = new better_sqlite3_1.default(databasePath);
|
|
22
|
+
this.initializeTables();
|
|
23
|
+
}
|
|
24
|
+
initializeTables() {
|
|
25
|
+
this.sqlite.pragma('foreign_keys = ON');
|
|
26
|
+
this.sqlite.exec(`
|
|
27
|
+
CREATE TABLE IF NOT EXISTS oauth_clients (
|
|
28
|
+
client_id TEXT PRIMARY KEY,
|
|
29
|
+
client_name TEXT NOT NULL,
|
|
30
|
+
client_description TEXT,
|
|
31
|
+
logo_uri TEXT,
|
|
32
|
+
client_uri TEXT,
|
|
33
|
+
developer_name TEXT,
|
|
34
|
+
developer_email TEXT,
|
|
35
|
+
redirect_uris TEXT NOT NULL,
|
|
36
|
+
grant_types TEXT NOT NULL,
|
|
37
|
+
response_types TEXT NOT NULL,
|
|
38
|
+
token_endpoint_auth_method TEXT NOT NULL,
|
|
39
|
+
created_at INTEGER NOT NULL,
|
|
40
|
+
updated_at INTEGER NOT NULL
|
|
41
|
+
)
|
|
42
|
+
`);
|
|
43
|
+
this.sqlite.exec(`
|
|
44
|
+
CREATE TABLE IF NOT EXISTS authorization_codes (
|
|
45
|
+
code TEXT PRIMARY KEY,
|
|
46
|
+
user_id TEXT NOT NULL,
|
|
47
|
+
client_id TEXT NOT NULL,
|
|
48
|
+
redirect_uri TEXT NOT NULL,
|
|
49
|
+
code_challenge TEXT NOT NULL,
|
|
50
|
+
code_challenge_method TEXT NOT NULL,
|
|
51
|
+
expires_at INTEGER NOT NULL,
|
|
52
|
+
used_at INTEGER,
|
|
53
|
+
github_access_token TEXT NOT NULL
|
|
54
|
+
)
|
|
55
|
+
`);
|
|
56
|
+
this.sqlite.exec(`
|
|
57
|
+
CREATE TABLE IF NOT EXISTS oauth_sessions (
|
|
58
|
+
session_id TEXT PRIMARY KEY,
|
|
59
|
+
client_id TEXT NOT NULL,
|
|
60
|
+
redirect_uri TEXT NOT NULL,
|
|
61
|
+
code_challenge TEXT NOT NULL,
|
|
62
|
+
code_challenge_method TEXT NOT NULL,
|
|
63
|
+
state TEXT,
|
|
64
|
+
resource TEXT,
|
|
65
|
+
expires_at INTEGER NOT NULL
|
|
66
|
+
)
|
|
67
|
+
`);
|
|
68
|
+
}
|
|
69
|
+
async storeClient(client) {
|
|
70
|
+
const stmt = this.sqlite.prepare(`
|
|
71
|
+
INSERT INTO oauth_clients (
|
|
72
|
+
client_id, client_name, client_description, logo_uri, client_uri,
|
|
73
|
+
developer_name, developer_email, redirect_uris, grant_types,
|
|
74
|
+
response_types, token_endpoint_auth_method, created_at, updated_at
|
|
75
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
76
|
+
`);
|
|
77
|
+
stmt.run(client.client_id, client.client_name, client.client_description || null, client.logo_uri || null, client.client_uri || null, client.developer_name || null, client.developer_email || null, JSON.stringify(client.redirect_uris), JSON.stringify(client.grant_types), JSON.stringify(client.response_types), client.token_endpoint_auth_method, client.created_at.getTime(), client.updated_at.getTime());
|
|
78
|
+
return client;
|
|
79
|
+
}
|
|
80
|
+
async getClient(client_id) {
|
|
81
|
+
const stmt = this.sqlite.prepare('SELECT * FROM oauth_clients WHERE client_id = ?');
|
|
82
|
+
const result = stmt.get(client_id);
|
|
83
|
+
if (!result) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
client_id: result.client_id,
|
|
88
|
+
client_name: result.client_name,
|
|
89
|
+
client_description: result.client_description || undefined,
|
|
90
|
+
logo_uri: result.logo_uri || undefined,
|
|
91
|
+
client_uri: result.client_uri || undefined,
|
|
92
|
+
developer_name: result.developer_name || undefined,
|
|
93
|
+
developer_email: result.developer_email || undefined,
|
|
94
|
+
redirect_uris: JSON.parse(result.redirect_uris),
|
|
95
|
+
grant_types: JSON.parse(result.grant_types),
|
|
96
|
+
response_types: JSON.parse(result.response_types),
|
|
97
|
+
token_endpoint_auth_method: result.token_endpoint_auth_method,
|
|
98
|
+
created_at: new Date(result.created_at),
|
|
99
|
+
updated_at: new Date(result.updated_at),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
async findClient(client_name) {
|
|
103
|
+
const stmt = this.sqlite.prepare('SELECT * FROM oauth_clients WHERE client_name = ?');
|
|
104
|
+
const result = stmt.get(client_name);
|
|
105
|
+
if (!result) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
client_id: result.client_id,
|
|
110
|
+
client_name: result.client_name,
|
|
111
|
+
client_description: result.client_description || undefined,
|
|
112
|
+
logo_uri: result.logo_uri || undefined,
|
|
113
|
+
client_uri: result.client_uri || undefined,
|
|
114
|
+
developer_name: result.developer_name || undefined,
|
|
115
|
+
developer_email: result.developer_email || undefined,
|
|
116
|
+
redirect_uris: JSON.parse(result.redirect_uris),
|
|
117
|
+
grant_types: JSON.parse(result.grant_types),
|
|
118
|
+
response_types: JSON.parse(result.response_types),
|
|
119
|
+
token_endpoint_auth_method: result.token_endpoint_auth_method,
|
|
120
|
+
created_at: new Date(result.created_at),
|
|
121
|
+
updated_at: new Date(result.updated_at),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
async storeAuthCode(code) {
|
|
125
|
+
const stmt = this.sqlite.prepare(`
|
|
126
|
+
INSERT INTO authorization_codes (
|
|
127
|
+
code, user_id, client_id, redirect_uri, code_challenge,
|
|
128
|
+
code_challenge_method, expires_at, used_at, github_access_token
|
|
129
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
130
|
+
`);
|
|
131
|
+
stmt.run(code.code, code.user_id, code.client_id, code.redirect_uri, code.code_challenge, code.code_challenge_method, code.expires_at, code.used_at ? code.used_at.getTime() : null, code.github_access_token);
|
|
132
|
+
}
|
|
133
|
+
async getAuthCode(code) {
|
|
134
|
+
const stmt = this.sqlite.prepare('SELECT * FROM authorization_codes WHERE code = ?');
|
|
135
|
+
const result = stmt.get(code);
|
|
136
|
+
if (!result) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
if (result.expires_at < Date.now()) {
|
|
140
|
+
await this.removeAuthCode(code);
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
code: result.code,
|
|
145
|
+
user_id: result.user_id,
|
|
146
|
+
client_id: result.client_id,
|
|
147
|
+
redirect_uri: result.redirect_uri,
|
|
148
|
+
code_challenge: result.code_challenge,
|
|
149
|
+
code_challenge_method: result.code_challenge_method,
|
|
150
|
+
expires_at: result.expires_at,
|
|
151
|
+
used_at: result.used_at ? new Date(result.used_at) : undefined,
|
|
152
|
+
github_access_token: result.github_access_token,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async removeAuthCode(code) {
|
|
156
|
+
const stmt = this.sqlite.prepare('DELETE FROM authorization_codes WHERE code = ?');
|
|
157
|
+
stmt.run(code);
|
|
158
|
+
}
|
|
159
|
+
async storeOAuthSession(sessionId, session) {
|
|
160
|
+
const stmt = this.sqlite.prepare(`
|
|
161
|
+
INSERT INTO oauth_sessions (
|
|
162
|
+
session_id, client_id, redirect_uri, code_challenge,
|
|
163
|
+
code_challenge_method, state, resource, expires_at
|
|
164
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
165
|
+
`);
|
|
166
|
+
stmt.run(sessionId, session.clientId, session.redirectUri, session.codeChallenge, session.codeChallengeMethod, session.state || null, session.resource || null, session.expiresAt);
|
|
167
|
+
}
|
|
168
|
+
async getOAuthSession(sessionId) {
|
|
169
|
+
const stmt = this.sqlite.prepare('SELECT * FROM oauth_sessions WHERE session_id = ?');
|
|
170
|
+
const result = stmt.get(sessionId);
|
|
171
|
+
if (!result) {
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
if (result.expires_at < Date.now()) {
|
|
175
|
+
await this.removeOAuthSession(sessionId);
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
sessionId: result.session_id,
|
|
180
|
+
clientId: result.client_id,
|
|
181
|
+
redirectUri: result.redirect_uri,
|
|
182
|
+
codeChallenge: result.code_challenge,
|
|
183
|
+
codeChallengeMethod: result.code_challenge_method,
|
|
184
|
+
state: result.state || undefined,
|
|
185
|
+
resource: result.resource || undefined,
|
|
186
|
+
expiresAt: result.expires_at,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
async removeOAuthSession(sessionId) {
|
|
190
|
+
const stmt = this.sqlite.prepare('DELETE FROM oauth_sessions WHERE session_id = ?');
|
|
191
|
+
stmt.run(sessionId);
|
|
192
|
+
}
|
|
193
|
+
generateClientId(client) {
|
|
194
|
+
const normalizedName = client.client_name
|
|
195
|
+
.toLowerCase()
|
|
196
|
+
.replace(/[^a-z0-9]/g, '');
|
|
197
|
+
const salt = (0, crypto_1.randomBytes)(4).toString('hex');
|
|
198
|
+
return `${normalizedName}_${salt}`;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
exports.SQLiteStore = SQLiteStore;
|
|
202
|
+
exports.SQLiteStore = SQLiteStore = __decorate([
|
|
203
|
+
(0, common_1.Injectable)(),
|
|
204
|
+
__metadata("design:paramtypes", [String])
|
|
205
|
+
], SQLiteStore);
|
|
206
|
+
//# sourceMappingURL=sqlite-store.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-store.service.js","sourceRoot":"","sources":["../../../../src/authz/stores/sqlite/sqlite-store.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oEAAsC;AACtC,mCAAqC;AAS9B,IAAM,WAAW,GAAjB,MAAM,WAAW;IAGtB,YAAY,eAAuB,mBAAmB;QACpD,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAQ,CAAC,YAAY,CAAC,CAAC;QACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAEO,gBAAgB;QAEtB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAGxC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;KAgBhB,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;;;;;;;;;;;;KAYhB,CAAC,CAAC;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,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACnC,MAAM,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YACzC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,UAAU;YAC5B,QAAQ,EAAE,MAAM,CAAC,SAAS;YAC1B,WAAW,EAAE,MAAM,CAAC,YAAY;YAChC,aAAa,EAAE,MAAM,CAAC,cAAc;YACpC,mBAAmB,EAAE,MAAM,CAAC,qBAAqB;YACjD,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,SAAS;YAChC,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,SAAS;YACtC,SAAS,EAAE,MAAM,CAAC,UAAU;SAC7B,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,SAAiB;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAC9B,iDAAiD,CAClD,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACtB,CAAC;IAED,gBAAgB,CAAC,MAAmB;QAElC,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW;aACtC,WAAW,EAAE;aACb,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAC7B,MAAM,IAAI,GAAG,IAAA,oBAAW,EAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5C,OAAO,GAAG,cAAc,IAAI,IAAI,EAAE,CAAC;IACrC,CAAC;CACF,CAAA;AA3QY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;;GACA,WAAW,CA2QvB","sourcesContent":["import { Injectable } from '@nestjs/common';\nimport Database from 'better-sqlite3';\nimport { randomBytes } from 'crypto';\nimport { OAuthSession } from '../../providers/oauth-provider.interface';\nimport {\n AuthorizationCode,\n IOAuthStore,\n OAuthClient,\n} from '../oauth-store.interface';\n\n@Injectable()\nexport class SQLiteStore implements IOAuthStore {\n private sqlite: any;\n\n constructor(databasePath: string = './oauth-sqlite.db') {\n this.sqlite = new Database(databasePath);\n this.initializeTables();\n }\n\n private initializeTables() {\n // Enable foreign keys\n this.sqlite.pragma('foreign_keys = ON');\n\n // Create tables if they don't exist\n this.sqlite.exec(`\n CREATE TABLE IF NOT EXISTS oauth_clients (\n client_id TEXT PRIMARY KEY,\n client_name TEXT NOT NULL,\n client_description TEXT,\n logo_uri TEXT,\n client_uri TEXT,\n developer_name TEXT,\n developer_email TEXT,\n redirect_uris TEXT NOT NULL,\n grant_types TEXT NOT NULL,\n response_types TEXT NOT NULL,\n token_endpoint_auth_method TEXT NOT NULL,\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL\n )\n `);\n\n this.sqlite.exec(`\n CREATE TABLE IF NOT EXISTS authorization_codes (\n code TEXT PRIMARY KEY,\n user_id TEXT NOT NULL,\n client_id TEXT NOT NULL,\n redirect_uri TEXT NOT NULL,\n code_challenge TEXT NOT NULL,\n code_challenge_method TEXT NOT NULL,\n expires_at INTEGER NOT NULL,\n used_at INTEGER,\n github_access_token TEXT NOT NULL\n )\n `);\n\n this.sqlite.exec(`\n CREATE TABLE IF NOT EXISTS oauth_sessions (\n session_id TEXT PRIMARY KEY,\n client_id TEXT NOT NULL,\n redirect_uri TEXT NOT NULL,\n code_challenge TEXT NOT NULL,\n code_challenge_method TEXT NOT NULL,\n state TEXT,\n resource TEXT,\n expires_at INTEGER NOT NULL\n )\n `);\n }\n\n // Client management\n async storeClient(client: OAuthClient): Promise<OAuthClient> {\n const stmt = this.sqlite.prepare(`\n INSERT INTO oauth_clients (\n client_id, client_name, client_description, logo_uri, client_uri,\n developer_name, developer_email, redirect_uris, grant_types,\n response_types, token_endpoint_auth_method, created_at, updated_at\n ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n `);\n\n stmt.run(\n client.client_id,\n client.client_name,\n client.client_description || null,\n client.logo_uri || null,\n client.client_uri || null,\n client.developer_name || null,\n client.developer_email || null,\n JSON.stringify(client.redirect_uris),\n JSON.stringify(client.grant_types),\n JSON.stringify(client.response_types),\n client.token_endpoint_auth_method,\n client.created_at.getTime(),\n client.updated_at.getTime(),\n );\n\n return client;\n }\n\n async getClient(client_id: string): Promise<OAuthClient | undefined> {\n const stmt = this.sqlite.prepare(\n 'SELECT * FROM oauth_clients WHERE client_id = ?',\n );\n const result = stmt.get(client_id) as any;\n\n if (!result) {\n return undefined;\n }\n\n return {\n client_id: result.client_id,\n client_name: result.client_name,\n client_description: result.client_description || undefined,\n logo_uri: result.logo_uri || undefined,\n client_uri: result.client_uri || undefined,\n developer_name: result.developer_name || undefined,\n developer_email: result.developer_email || undefined,\n redirect_uris: JSON.parse(result.redirect_uris),\n grant_types: JSON.parse(result.grant_types),\n response_types: JSON.parse(result.response_types),\n token_endpoint_auth_method: result.token_endpoint_auth_method,\n created_at: new Date(result.created_at),\n updated_at: new Date(result.updated_at),\n };\n }\n\n async findClient(client_name: string): Promise<OAuthClient | undefined> {\n const stmt = this.sqlite.prepare(\n 'SELECT * FROM oauth_clients WHERE client_name = ?',\n );\n const result = stmt.get(client_name) as any;\n\n if (!result) {\n return undefined;\n }\n\n return {\n client_id: result.client_id,\n client_name: result.client_name,\n client_description: result.client_description || undefined,\n logo_uri: result.logo_uri || undefined,\n client_uri: result.client_uri || undefined,\n developer_name: result.developer_name || undefined,\n developer_email: result.developer_email || undefined,\n redirect_uris: JSON.parse(result.redirect_uris),\n grant_types: JSON.parse(result.grant_types),\n response_types: JSON.parse(result.response_types),\n token_endpoint_auth_method: result.token_endpoint_auth_method,\n created_at: new Date(result.created_at),\n updated_at: new Date(result.updated_at),\n };\n }\n\n // Authorization code management\n async storeAuthCode(code: AuthorizationCode): Promise<void> {\n const stmt = this.sqlite.prepare(`\n INSERT INTO authorization_codes (\n code, user_id, client_id, redirect_uri, code_challenge,\n code_challenge_method, expires_at, used_at, github_access_token\n ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)\n `);\n\n stmt.run(\n code.code,\n code.user_id,\n code.client_id,\n code.redirect_uri,\n code.code_challenge,\n code.code_challenge_method,\n code.expires_at,\n code.used_at ? code.used_at.getTime() : null,\n code.github_access_token,\n );\n }\n\n async getAuthCode(code: string): Promise<AuthorizationCode | undefined> {\n const stmt = this.sqlite.prepare(\n 'SELECT * FROM authorization_codes WHERE code = ?',\n );\n const result = stmt.get(code) as any;\n\n if (!result) {\n return undefined;\n }\n\n // Check if expired\n if (result.expires_at < Date.now()) {\n await this.removeAuthCode(code);\n return undefined;\n }\n\n return {\n code: result.code,\n user_id: result.user_id,\n client_id: result.client_id,\n redirect_uri: result.redirect_uri,\n code_challenge: result.code_challenge,\n code_challenge_method: result.code_challenge_method,\n expires_at: result.expires_at,\n used_at: result.used_at ? new Date(result.used_at) : undefined,\n github_access_token: result.github_access_token,\n };\n }\n\n async removeAuthCode(code: string): Promise<void> {\n const stmt = this.sqlite.prepare(\n 'DELETE FROM authorization_codes WHERE code = ?',\n );\n stmt.run(code);\n }\n\n // OAuth session management\n async storeOAuthSession(\n sessionId: string,\n session: OAuthSession,\n ): Promise<void> {\n const stmt = this.sqlite.prepare(`\n INSERT INTO oauth_sessions (\n session_id, client_id, redirect_uri, code_challenge,\n code_challenge_method, state, resource, expires_at\n ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\n `);\n\n stmt.run(\n sessionId,\n session.clientId,\n session.redirectUri,\n session.codeChallenge,\n session.codeChallengeMethod,\n session.state || null,\n session.resource || null,\n session.expiresAt,\n );\n }\n\n async getOAuthSession(sessionId: string): Promise<OAuthSession | undefined> {\n const stmt = this.sqlite.prepare(\n 'SELECT * FROM oauth_sessions WHERE session_id = ?',\n );\n const result = stmt.get(sessionId) as any;\n\n if (!result) {\n return undefined;\n }\n\n // Check if expired\n if (result.expires_at < Date.now()) {\n await this.removeOAuthSession(sessionId);\n return undefined;\n }\n\n return {\n sessionId: result.session_id,\n clientId: result.client_id,\n redirectUri: result.redirect_uri,\n codeChallenge: result.code_challenge,\n codeChallengeMethod: result.code_challenge_method,\n state: result.state || undefined,\n resource: result.resource || undefined,\n expiresAt: result.expires_at,\n };\n }\n\n async removeOAuthSession(sessionId: string): Promise<void> {\n const stmt = this.sqlite.prepare(\n 'DELETE FROM oauth_sessions WHERE session_id = ?',\n );\n stmt.run(sessionId);\n }\n\n generateClientId(client: OAuthClient): string {\n // Create deterministic client ID based on name + random salt\n const normalizedName = client.client_name\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '');\n const salt = randomBytes(4).toString('hex');\n return `${normalizedName}_${salt}`;\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class AuthorizationCodeEntity {
|
|
2
|
+
code: string;
|
|
3
|
+
user_id: string;
|
|
4
|
+
client_id: string;
|
|
5
|
+
redirect_uri: string;
|
|
6
|
+
code_challenge: string;
|
|
7
|
+
code_challenge_method: string;
|
|
8
|
+
expires_at: number;
|
|
9
|
+
used_at?: Date;
|
|
10
|
+
github_access_token: string;
|
|
11
|
+
created_at: Date;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=authorization-code.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization-code.entity.d.ts","sourceRoot":"","sources":["../../../../../src/authz/stores/typeorm/entities/authorization-code.entity.ts"],"names":[],"mappings":"AAEA,qBACa,uBAAuB;IAElC,IAAI,EAAE,MAAM,CAAC;IAGb,OAAO,EAAE,MAAM,CAAC;IAGhB,SAAS,EAAE,MAAM,CAAC;IAGlB,YAAY,EAAE,MAAM,CAAC;IAGrB,cAAc,EAAE,MAAM,CAAC;IAGvB,qBAAqB,EAAE,MAAM,CAAC;IAG9B,UAAU,EAAE,MAAM,CAAC;IAGnB,OAAO,CAAC,EAAE,IAAI,CAAC;IAGf,mBAAmB,EAAE,MAAM,CAAC;IAG5B,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AuthorizationCodeEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let AuthorizationCodeEntity = class AuthorizationCodeEntity {
|
|
15
|
+
};
|
|
16
|
+
exports.AuthorizationCodeEntity = AuthorizationCodeEntity;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], AuthorizationCodeEntity.prototype, "code", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], AuthorizationCodeEntity.prototype, "user_id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AuthorizationCodeEntity.prototype, "client_id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AuthorizationCodeEntity.prototype, "redirect_uri", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], AuthorizationCodeEntity.prototype, "code_challenge", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], AuthorizationCodeEntity.prototype, "code_challenge_method", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)('bigint'),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], AuthorizationCodeEntity.prototype, "expires_at", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
47
|
+
__metadata("design:type", Date)
|
|
48
|
+
], AuthorizationCodeEntity.prototype, "used_at", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], AuthorizationCodeEntity.prototype, "github_access_token", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
55
|
+
__metadata("design:type", Date)
|
|
56
|
+
], AuthorizationCodeEntity.prototype, "created_at", void 0);
|
|
57
|
+
exports.AuthorizationCodeEntity = AuthorizationCodeEntity = __decorate([
|
|
58
|
+
(0, typeorm_1.Entity)('authorization_codes')
|
|
59
|
+
], AuthorizationCodeEntity);
|
|
60
|
+
//# sourceMappingURL=authorization-code.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization-code.entity.js","sourceRoot":"","sources":["../../../../../src/authz/stores/typeorm/entities/authorization-code.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA0E;AAGnE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CA8BnC,CAAA;AA9BY,0DAAuB;AAElC;IADC,IAAA,uBAAa,GAAE;;qDACH;AAGb;IADC,IAAA,gBAAM,GAAE;;wDACO;AAGhB;IADC,IAAA,gBAAM,GAAE;;0DACS;AAGlB;IADC,IAAA,gBAAM,GAAE;;6DACY;AAGrB;IADC,IAAA,gBAAM,GAAE;;+DACc;AAGvB;IADC,IAAA,gBAAM,GAAE;;sEACqB;AAG9B;IADC,IAAA,gBAAM,EAAC,QAAQ,CAAC;;2DACE;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACjB,IAAI;wDAAC;AAGf;IADC,IAAA,gBAAM,GAAE;;oEACmB;AAG5B;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;2DAAC;kCA7BN,uBAAuB;IADnC,IAAA,gBAAM,EAAC,qBAAqB,CAAC;GACjB,uBAAuB,CA8BnC","sourcesContent":["import { Entity, Column, PrimaryColumn, CreateDateColumn } from 'typeorm';\n\n@Entity('authorization_codes')\nexport class AuthorizationCodeEntity {\n @PrimaryColumn()\n code: string;\n\n @Column()\n user_id: string;\n\n @Column()\n client_id: string;\n\n @Column()\n redirect_uri: string;\n\n @Column()\n code_challenge: string;\n\n @Column()\n code_challenge_method: string;\n\n @Column('bigint')\n expires_at: number;\n\n @Column({ nullable: true })\n used_at?: Date;\n\n @Column()\n github_access_token: string;\n\n @CreateDateColumn()\n created_at: Date;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/authz/stores/typeorm/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OAuthSessionEntity = exports.AuthorizationCodeEntity = exports.OAuthClientEntity = void 0;
|
|
4
|
+
var oauth_client_entity_1 = require("./oauth-client.entity");
|
|
5
|
+
Object.defineProperty(exports, "OAuthClientEntity", { enumerable: true, get: function () { return oauth_client_entity_1.OAuthClientEntity; } });
|
|
6
|
+
var authorization_code_entity_1 = require("./authorization-code.entity");
|
|
7
|
+
Object.defineProperty(exports, "AuthorizationCodeEntity", { enumerable: true, get: function () { return authorization_code_entity_1.AuthorizationCodeEntity; } });
|
|
8
|
+
var oauth_session_entity_1 = require("./oauth-session.entity");
|
|
9
|
+
Object.defineProperty(exports, "OAuthSessionEntity", { enumerable: true, get: function () { return oauth_session_entity_1.OAuthSessionEntity; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/authz/stores/typeorm/entities/index.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,yEAAsE;AAA7D,oIAAA,uBAAuB,OAAA;AAChC,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA","sourcesContent":["export { OAuthClientEntity } from './oauth-client.entity';\nexport { AuthorizationCodeEntity } from './authorization-code.entity';\nexport { OAuthSessionEntity } from './oauth-session.entity';\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class OAuthClientEntity {
|
|
2
|
+
client_id: string;
|
|
3
|
+
client_name: string;
|
|
4
|
+
client_description?: string;
|
|
5
|
+
logo_uri?: string;
|
|
6
|
+
client_uri?: string;
|
|
7
|
+
developer_name?: string;
|
|
8
|
+
developer_email?: string;
|
|
9
|
+
redirect_uris: string[];
|
|
10
|
+
grant_types: string[];
|
|
11
|
+
response_types: string[];
|
|
12
|
+
token_endpoint_auth_method: string;
|
|
13
|
+
created_at: Date;
|
|
14
|
+
updated_at: Date;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=oauth-client.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-client.entity.d.ts","sourceRoot":"","sources":["../../../../../src/authz/stores/typeorm/entities/oauth-client.entity.ts"],"names":[],"mappings":"AAQA,qBACa,iBAAiB;IAE5B,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,CAAC;IAGpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,WAAW,EAAE,MAAM,EAAE,CAAC;IAGtB,cAAc,EAAE,MAAM,EAAE,CAAC;IAGzB,0BAA0B,EAAE,MAAM,CAAC;IAGnC,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OAuthClientEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let OAuthClientEntity = class OAuthClientEntity {
|
|
15
|
+
};
|
|
16
|
+
exports.OAuthClientEntity = OAuthClientEntity;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], OAuthClientEntity.prototype, "client_id", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], OAuthClientEntity.prototype, "client_name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], OAuthClientEntity.prototype, "client_description", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], OAuthClientEntity.prototype, "logo_uri", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], OAuthClientEntity.prototype, "client_uri", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], OAuthClientEntity.prototype, "developer_name", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], OAuthClientEntity.prototype, "developer_email", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)('simple-array'),
|
|
47
|
+
__metadata("design:type", Array)
|
|
48
|
+
], OAuthClientEntity.prototype, "redirect_uris", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)('simple-array'),
|
|
51
|
+
__metadata("design:type", Array)
|
|
52
|
+
], OAuthClientEntity.prototype, "grant_types", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)('simple-array'),
|
|
55
|
+
__metadata("design:type", Array)
|
|
56
|
+
], OAuthClientEntity.prototype, "response_types", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], OAuthClientEntity.prototype, "token_endpoint_auth_method", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
63
|
+
__metadata("design:type", Date)
|
|
64
|
+
], OAuthClientEntity.prototype, "created_at", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
67
|
+
__metadata("design:type", Date)
|
|
68
|
+
], OAuthClientEntity.prototype, "updated_at", void 0);
|
|
69
|
+
exports.OAuthClientEntity = OAuthClientEntity = __decorate([
|
|
70
|
+
(0, typeorm_1.Entity)('oauth_clients')
|
|
71
|
+
], OAuthClientEntity);
|
|
72
|
+
//# sourceMappingURL=oauth-client.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-client.entity.js","sourceRoot":"","sources":["../../../../../src/authz/stores/typeorm/entities/oauth-client.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMiB;AAGV,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAuC7B,CAAA;AAvCY,8CAAiB;AAE5B;IADC,IAAA,uBAAa,GAAE;;oDACE;AAGlB;IADC,IAAA,gBAAM,GAAE;;sDACW;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DACC;AAG5B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACT;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACP;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACH;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACF;AAGzB;IADC,IAAA,gBAAM,EAAC,cAAc,CAAC;;wDACC;AAGxB;IADC,IAAA,gBAAM,EAAC,cAAc,CAAC;;sDACD;AAGtB;IADC,IAAA,gBAAM,EAAC,cAAc,CAAC;;yDACE;AAGzB;IADC,IAAA,gBAAM,GAAE;;qEAC0B;AAGnC;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;qDAAC;AAGjB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;qDAAC;4BAtCN,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,eAAe,CAAC;GACX,iBAAiB,CAuC7B","sourcesContent":["import {\n Entity,\n Column,\n PrimaryColumn,\n CreateDateColumn,\n UpdateDateColumn,\n} from 'typeorm';\n\n@Entity('oauth_clients')\nexport class OAuthClientEntity {\n @PrimaryColumn()\n client_id: string;\n\n @Column()\n client_name: string;\n\n @Column({ nullable: true })\n client_description?: string;\n\n @Column({ nullable: true })\n logo_uri?: string;\n\n @Column({ nullable: true })\n client_uri?: string;\n\n @Column({ nullable: true })\n developer_name?: string;\n\n @Column({ nullable: true })\n developer_email?: string;\n\n @Column('simple-array')\n redirect_uris: string[];\n\n @Column('simple-array')\n grant_types: string[];\n\n @Column('simple-array')\n response_types: string[];\n\n @Column()\n token_endpoint_auth_method: string;\n\n @CreateDateColumn()\n created_at: Date;\n\n @UpdateDateColumn()\n updated_at: Date;\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class OAuthSessionEntity {
|
|
2
|
+
sessionId: string;
|
|
3
|
+
state: string;
|
|
4
|
+
clientId?: string;
|
|
5
|
+
redirectUri?: string;
|
|
6
|
+
codeChallenge?: string;
|
|
7
|
+
codeChallengeMethod?: string;
|
|
8
|
+
oauthState?: string;
|
|
9
|
+
resource?: string;
|
|
10
|
+
expiresAt: number;
|
|
11
|
+
created_at: Date;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=oauth-session.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-session.entity.d.ts","sourceRoot":"","sources":["../../../../../src/authz/stores/typeorm/entities/oauth-session.entity.ts"],"names":[],"mappings":"AAEA,qBACa,kBAAkB;IAE7B,SAAS,EAAE,MAAM,CAAC;IAGlB,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAG7B,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAGlB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OAuthSessionEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let OAuthSessionEntity = class OAuthSessionEntity {
|
|
15
|
+
};
|
|
16
|
+
exports.OAuthSessionEntity = OAuthSessionEntity;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], OAuthSessionEntity.prototype, "sessionId", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], OAuthSessionEntity.prototype, "state", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], OAuthSessionEntity.prototype, "clientId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], OAuthSessionEntity.prototype, "redirectUri", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], OAuthSessionEntity.prototype, "codeChallenge", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], OAuthSessionEntity.prototype, "codeChallengeMethod", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], OAuthSessionEntity.prototype, "oauthState", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], OAuthSessionEntity.prototype, "resource", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)('bigint'),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], OAuthSessionEntity.prototype, "expiresAt", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
55
|
+
__metadata("design:type", Date)
|
|
56
|
+
], OAuthSessionEntity.prototype, "created_at", void 0);
|
|
57
|
+
exports.OAuthSessionEntity = OAuthSessionEntity = __decorate([
|
|
58
|
+
(0, typeorm_1.Entity)('oauth_sessions')
|
|
59
|
+
], OAuthSessionEntity);
|
|
60
|
+
//# sourceMappingURL=oauth-session.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-session.entity.js","sourceRoot":"","sources":["../../../../../src/authz/stores/typeorm/entities/oauth-session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA0E;AAGnE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CA8B9B,CAAA;AA9BY,gDAAkB;AAE7B;IADC,IAAA,uBAAa,GAAE;;qDACE;AAGlB;IADC,IAAA,gBAAM,GAAE;;iDACK;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACT;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACN;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACJ;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+DACE;AAG7B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACP;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACT;AAGlB;IADC,IAAA,gBAAM,EAAC,QAAQ,CAAC;;qDACC;AAGlB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;sDAAC;6BA7BN,kBAAkB;IAD9B,IAAA,gBAAM,EAAC,gBAAgB,CAAC;GACZ,kBAAkB,CA8B9B","sourcesContent":["import { Entity, Column, PrimaryColumn, CreateDateColumn } from 'typeorm';\n\n@Entity('oauth_sessions')\nexport class OAuthSessionEntity {\n @PrimaryColumn()\n sessionId: string;\n\n @Column()\n state: string;\n\n @Column({ nullable: true })\n clientId?: string;\n\n @Column({ nullable: true })\n redirectUri?: string;\n\n @Column({ nullable: true })\n codeChallenge?: string;\n\n @Column({ nullable: true })\n codeChallengeMethod?: string;\n\n @Column({ nullable: true })\n oauthState?: string;\n\n @Column({ nullable: true })\n resource?: string;\n\n @Column('bigint')\n expiresAt: number;\n\n @CreateDateColumn()\n created_at: Date;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { OAuthClientEntity, AuthorizationCodeEntity, OAuthSessionEntity } from './entities';
|
|
3
|
+
import { OAuthSession } from '../../providers/oauth-provider.interface';
|
|
4
|
+
import { AuthorizationCode, IOAuthStore, OAuthClient } from '../oauth-store.interface';
|
|
5
|
+
export declare class TypeOrmStore implements IOAuthStore {
|
|
6
|
+
private readonly clientRepository;
|
|
7
|
+
private readonly authCodeRepository;
|
|
8
|
+
private readonly sessionRepository;
|
|
9
|
+
constructor(clientRepository: Repository<OAuthClientEntity>, authCodeRepository: Repository<AuthorizationCodeEntity>, sessionRepository: Repository<OAuthSessionEntity>);
|
|
10
|
+
storeClient(client: OAuthClient): Promise<OAuthClient>;
|
|
11
|
+
getClient(client_id: string): Promise<OAuthClient | undefined>;
|
|
12
|
+
findClient(client_name: string): Promise<OAuthClient | undefined>;
|
|
13
|
+
storeAuthCode(code: AuthorizationCode): Promise<void>;
|
|
14
|
+
getAuthCode(code: string): Promise<AuthorizationCode | undefined>;
|
|
15
|
+
removeAuthCode(code: string): Promise<void>;
|
|
16
|
+
storeOAuthSession(sessionId: string, session: OAuthSession): Promise<void>;
|
|
17
|
+
getOAuthSession(sessionId: string): Promise<OAuthSession | undefined>;
|
|
18
|
+
removeOAuthSession(sessionId: string): Promise<void>;
|
|
19
|
+
generateClientId(client: OAuthClient): string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=typeorm-store.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeorm-store.service.d.ts","sourceRoot":"","sources":["../../../../src/authz/stores/typeorm/typeorm-store.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAElC,qBACa,YAAa,YAAW,WAAW;IAG5C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAEjC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAEnC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAJjB,gBAAgB,EAAE,UAAU,CAAC,iBAAiB,CAAC,EAE/C,kBAAkB,EAAE,UAAU,CAAC,uBAAuB,CAAC,EAEvD,iBAAiB,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAI9D,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAKtD,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAO9D,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAQjE,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,WAAW,CAAC,IAAI,EAAE,MAAM,GAA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