@things-factory/oauth2-client 6.0.0-alpha.10 → 6.0.0-alpha.12
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-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/oauth2-client/oauth2-client.js +22 -64
- package/dist-server/service/oauth2-client/oauth2-client.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/server/service/oauth2-client/oauth2-client.ts +22 -64
|
@@ -42,140 +42,102 @@ tslib_1.__decorate([
|
|
|
42
42
|
tslib_1.__metadata("design:type", String)
|
|
43
43
|
], Oauth2Client.prototype, "name", void 0);
|
|
44
44
|
tslib_1.__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({
|
|
46
|
-
nullable: true
|
|
47
|
-
}),
|
|
45
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
48
46
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
49
47
|
tslib_1.__metadata("design:type", String)
|
|
50
48
|
], Oauth2Client.prototype, "description", void 0);
|
|
51
49
|
tslib_1.__decorate([
|
|
52
|
-
(0, typeorm_1.Column)({
|
|
53
|
-
nullable: true
|
|
54
|
-
}),
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
55
51
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
56
52
|
tslib_1.__metadata("design:type", String)
|
|
57
53
|
], Oauth2Client.prototype, "icon", void 0);
|
|
58
54
|
tslib_1.__decorate([
|
|
59
|
-
(0, typeorm_1.Column)({
|
|
60
|
-
nullable: true
|
|
61
|
-
}),
|
|
55
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
62
56
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
63
57
|
tslib_1.__metadata("design:type", String)
|
|
64
58
|
], Oauth2Client.prototype, "grantType", void 0);
|
|
65
59
|
tslib_1.__decorate([
|
|
66
|
-
(0, typeorm_1.Column)({
|
|
67
|
-
nullable: true
|
|
68
|
-
}),
|
|
60
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
69
61
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
70
62
|
tslib_1.__metadata("design:type", String)
|
|
71
63
|
], Oauth2Client.prototype, "clientId", void 0);
|
|
72
64
|
tslib_1.__decorate([
|
|
73
|
-
(0, typeorm_1.Column)({
|
|
74
|
-
nullable: true
|
|
75
|
-
}),
|
|
65
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
76
66
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
67
|
tslib_1.__metadata("design:type", String)
|
|
78
68
|
], Oauth2Client.prototype, "clientSecret", void 0);
|
|
79
69
|
tslib_1.__decorate([
|
|
80
|
-
(0, typeorm_1.Column)({
|
|
81
|
-
nullable: true
|
|
82
|
-
}),
|
|
70
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
83
71
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
84
72
|
tslib_1.__metadata("design:type", String)
|
|
85
73
|
], Oauth2Client.prototype, "accessTokenUrl", void 0);
|
|
86
74
|
tslib_1.__decorate([
|
|
87
|
-
(0, typeorm_1.Column)({
|
|
88
|
-
nullable: true
|
|
89
|
-
}),
|
|
75
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
90
76
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
91
77
|
tslib_1.__metadata("design:type", String)
|
|
92
78
|
], Oauth2Client.prototype, "authUrl", void 0);
|
|
93
79
|
tslib_1.__decorate([
|
|
94
|
-
(0, typeorm_1.Column)({
|
|
95
|
-
nullable: true
|
|
96
|
-
}),
|
|
80
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
97
81
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
98
82
|
tslib_1.__metadata("design:type", String)
|
|
99
83
|
], Oauth2Client.prototype, "callbackUrl", void 0);
|
|
100
84
|
tslib_1.__decorate([
|
|
101
|
-
(0, typeorm_1.Column)({
|
|
102
|
-
nullable: true
|
|
103
|
-
}),
|
|
85
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
104
86
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
105
87
|
tslib_1.__metadata("design:type", String)
|
|
106
88
|
], Oauth2Client.prototype, "webhook", void 0);
|
|
107
89
|
tslib_1.__decorate([
|
|
108
|
-
(0, typeorm_1.Column)({
|
|
109
|
-
nullable: true
|
|
110
|
-
}),
|
|
90
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
111
91
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
112
92
|
tslib_1.__metadata("design:type", String)
|
|
113
93
|
], Oauth2Client.prototype, "username", void 0);
|
|
114
94
|
tslib_1.__decorate([
|
|
115
|
-
(0, typeorm_1.Column)({
|
|
116
|
-
nullable: true
|
|
117
|
-
}),
|
|
95
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
118
96
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
119
97
|
tslib_1.__metadata("design:type", String)
|
|
120
98
|
], Oauth2Client.prototype, "password", void 0);
|
|
121
99
|
tslib_1.__decorate([
|
|
122
|
-
(0, typeorm_1.Column)({
|
|
123
|
-
nullable: true
|
|
124
|
-
}),
|
|
100
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
125
101
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
126
102
|
tslib_1.__metadata("design:type", String)
|
|
127
103
|
], Oauth2Client.prototype, "codeChallengeMethod", void 0);
|
|
128
104
|
tslib_1.__decorate([
|
|
129
|
-
(0, typeorm_1.Column)({
|
|
130
|
-
nullable: true
|
|
131
|
-
}),
|
|
105
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
132
106
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
133
107
|
tslib_1.__metadata("design:type", String)
|
|
134
108
|
], Oauth2Client.prototype, "codeVerifier", void 0);
|
|
135
109
|
tslib_1.__decorate([
|
|
136
|
-
(0, typeorm_1.Column)({
|
|
137
|
-
nullable: true
|
|
138
|
-
}),
|
|
110
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
139
111
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
140
112
|
tslib_1.__metadata("design:type", String)
|
|
141
113
|
], Oauth2Client.prototype, "scopes", void 0);
|
|
142
114
|
tslib_1.__decorate([
|
|
143
|
-
(0, typeorm_1.Column)({
|
|
144
|
-
nullable: true
|
|
145
|
-
}),
|
|
115
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
146
116
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
147
117
|
tslib_1.__metadata("design:type", String)
|
|
148
118
|
], Oauth2Client.prototype, "accessToken", void 0);
|
|
149
119
|
tslib_1.__decorate([
|
|
150
|
-
(0, typeorm_1.Column)({
|
|
151
|
-
nullable: true
|
|
152
|
-
}),
|
|
120
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
153
121
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
154
122
|
tslib_1.__metadata("design:type", String)
|
|
155
123
|
], Oauth2Client.prototype, "refreshToken", void 0);
|
|
156
124
|
tslib_1.__decorate([
|
|
157
|
-
(0, typeorm_1.Column)(),
|
|
125
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
158
126
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
159
127
|
tslib_1.__metadata("design:type", Date)
|
|
160
128
|
], Oauth2Client.prototype, "expires", void 0);
|
|
161
129
|
tslib_1.__decorate([
|
|
162
|
-
(0, typeorm_1.Column)({
|
|
163
|
-
nullable: true
|
|
164
|
-
}),
|
|
130
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
165
131
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
166
132
|
tslib_1.__metadata("design:type", String)
|
|
167
133
|
], Oauth2Client.prototype, "state", void 0);
|
|
168
134
|
tslib_1.__decorate([
|
|
169
|
-
(0, typeorm_1.Column)({
|
|
170
|
-
nullable: true
|
|
171
|
-
}),
|
|
135
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
172
136
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
173
137
|
tslib_1.__metadata("design:type", String)
|
|
174
138
|
], Oauth2Client.prototype, "jwtToken", void 0);
|
|
175
139
|
tslib_1.__decorate([
|
|
176
|
-
(0, typeorm_1.Column)({
|
|
177
|
-
nullable: true
|
|
178
|
-
}),
|
|
140
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
179
141
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
180
142
|
tslib_1.__metadata("design:type", String)
|
|
181
143
|
], Oauth2Client.prototype, "tokenType", void 0);
|
|
@@ -190,9 +152,7 @@ tslib_1.__decorate([
|
|
|
190
152
|
tslib_1.__metadata("design:type", Date)
|
|
191
153
|
], Oauth2Client.prototype, "updatedAt", void 0);
|
|
192
154
|
tslib_1.__decorate([
|
|
193
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
194
|
-
nullable: true
|
|
195
|
-
}),
|
|
155
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
196
156
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
197
157
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
198
158
|
], Oauth2Client.prototype, "creator", void 0);
|
|
@@ -201,9 +161,7 @@ tslib_1.__decorate([
|
|
|
201
161
|
tslib_1.__metadata("design:type", String)
|
|
202
162
|
], Oauth2Client.prototype, "creatorId", void 0);
|
|
203
163
|
tslib_1.__decorate([
|
|
204
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
205
|
-
nullable: true
|
|
206
|
-
}),
|
|
164
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
207
165
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
208
166
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
209
167
|
], Oauth2Client.prototype, "updater", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2-client.js","sourceRoot":"","sources":["../../../server/service/oauth2-client/oauth2-client.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAK9C,IAAa,YAAY,GAAzB,MAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"oauth2-client.js","sourceRoot":"","sources":["../../../server/service/oauth2-client/oauth2-client.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAK9C,IAAa,YAAY,GAAzB,MAAa,YAAY;IAsHvB,cAAc;QACZ,IAAI,IAAI,CAAC,SAAS,IAAI,QAAQ,EAAE;YAC9B,OAAO;gBACL,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;aAC5C,CAAA;SACF;aAAM,IAAI,IAAI,CAAC,SAAS,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACvD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;YACnF,OAAO;gBACL,aAAa,EAAE,SAAS,OAAO,EAAE;aAClC,CAAA;SACF;QAED,OAAO,EAAE,CAAA;IACX,CAAC;CACF,CAAA;AAjIC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;wCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,cAAM;4CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,YAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC;;8CAC/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ApHP,YAAY;IAHxB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,YAA0B,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;GAC1C,YAAY,CAoIxB;AApIY,oCAAY","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\n@Entity()\n@Index('ix_oauth2_client_0', (oauth2Client: Oauth2Client) => [oauth2Client.domain, oauth2Client.name], { unique: true })\n@ObjectType({ description: 'Entity for Oauth2Client' })\nexport class Oauth2Client {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((oauth2Client: Oauth2Client) => oauth2Client.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n icon?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n grantType?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n clientId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n clientSecret?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n accessTokenUrl?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n authUrl?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n callbackUrl?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n webhook?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n username?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n password?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n codeChallengeMethod?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n codeVerifier?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n scopes?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n accessToken?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n refreshToken?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n expires?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n jwtToken?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n tokenType?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((oauth2Client: Oauth2Client) => oauth2Client.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((oauth2Client: Oauth2Client) => oauth2Client.creator)\n updaterId?: string\n\n getAuthHeaders() {\n if (this.tokenType == 'bearer') {\n return {\n Authorization: `Bearer ${this.accessToken}`\n }\n } else if (this.tokenType == 'basic' || !this.tokenType) {\n const encoded = Buffer.from(`${this.username}:${this.password}`).toString('base64')\n return {\n Authorization: `Basic ${encoded}`\n }\n }\n\n return {}\n }\n}\n"]}
|