@point3/logto-module 1.0.17 → 1.0.18
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/__tests__/m2m-client.spec.d.ts +1 -0
- package/dist/client/__tests__/m2m-client.spec.js +55 -0
- package/dist/client/__tests__/m2m-client.spec.js.map +1 -0
- package/dist/client/__tests__/oauth-client.spec.d.ts +1 -0
- package/dist/client/__tests__/oauth-client.spec.js +40 -0
- package/dist/client/__tests__/oauth-client.spec.js.map +1 -0
- package/dist/client/config.d.ts +21 -0
- package/dist/client/config.js +16 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +22 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/logto-login-session.d.ts +28 -0
- package/dist/client/logto-login-session.js +128 -0
- package/dist/client/logto-login-session.js.map +1 -0
- package/dist/client/m2m-client.d.ts +38 -0
- package/dist/client/m2m-client.js +225 -0
- package/dist/client/m2m-client.js.map +1 -0
- package/dist/client/oauth-client.d.ts +25 -0
- package/dist/client/oauth-client.js +135 -0
- package/dist/client/oauth-client.js.map +1 -0
- package/dist/client/types.d.ts +45 -0
- package/dist/client/types.js +37 -0
- package/dist/client/types.js.map +1 -0
- package/dist/errors.d.ts +24 -0
- package/dist/errors.js +62 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +4 -0
- package/dist/module.js +70 -0
- package/dist/module.js.map +1 -0
- package/dist/stateless/decorator.d.ts +7 -0
- package/dist/stateless/decorator.js +10 -0
- package/dist/stateless/decorator.js.map +1 -0
- package/dist/stateless/guard.d.ts +11 -0
- package/dist/stateless/guard.js +70 -0
- package/dist/stateless/guard.js.map +1 -0
- package/dist/stateless/guard.spec.d.ts +1 -0
- package/dist/stateless/guard.spec.js +210 -0
- package/dist/stateless/guard.spec.js.map +1 -0
- package/dist/stateless/index.d.ts +2 -0
- package/dist/stateless/index.js +19 -0
- package/dist/stateless/index.js.map +1 -0
- package/dist/token/access-token.d.ts +31 -0
- package/dist/token/access-token.js +19 -0
- package/dist/token/access-token.js.map +1 -0
- package/dist/token/index.d.ts +2 -0
- package/dist/token/index.js +19 -0
- package/dist/token/index.js.map +1 -0
- package/dist/token/verifier.d.ts +13 -0
- package/dist/token/verifier.js +65 -0
- package/dist/token/verifier.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const testing_1 = require("@nestjs/testing");
|
|
4
|
+
const config_1 = require("@nestjs/config");
|
|
5
|
+
const point3_common_tool_1 = require("point3-common-tool");
|
|
6
|
+
const __1 = require("..");
|
|
7
|
+
const token_1 = require("../../token");
|
|
8
|
+
const common_1 = require("@nestjs/common");
|
|
9
|
+
describe('M2mclient를 이용한 Logto API 테스트', () => {
|
|
10
|
+
let m2mClient;
|
|
11
|
+
let testUser;
|
|
12
|
+
let testUserId = 'bead71jr45u1';
|
|
13
|
+
let testRoleId = '0fwcgs8okjy7lav216sb3';
|
|
14
|
+
beforeAll(async () => {
|
|
15
|
+
const module = await testing_1.Test.createTestingModule({
|
|
16
|
+
imports: [
|
|
17
|
+
config_1.ConfigModule.forRoot({
|
|
18
|
+
envFilePath: `env/.env.${process.env.NODE_ENV}`,
|
|
19
|
+
isGlobal: true,
|
|
20
|
+
})
|
|
21
|
+
],
|
|
22
|
+
providers: [
|
|
23
|
+
{
|
|
24
|
+
provide: token_1.LogtoTokenVerifierToken,
|
|
25
|
+
useClass: token_1.LogtoTokenVerifier
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
provide: __1.LogtoLoggerServiceToken,
|
|
29
|
+
useClass: common_1.ConsoleLogger
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
}).compile();
|
|
33
|
+
m2mClient = module.get(__1.LogtoM2MClientToken);
|
|
34
|
+
const randomNumber = Math.floor(1000 + Math.random() * 9000);
|
|
35
|
+
testUser = {
|
|
36
|
+
username: point3_common_tool_1.p3Values.Guid.create('test').toString().replace(/-/g, '_'),
|
|
37
|
+
name: 'test' + randomNumber,
|
|
38
|
+
primaryEmail: 'test' + randomNumber + '@test.com',
|
|
39
|
+
password: 'test123',
|
|
40
|
+
primaryPhone: '0101111' + randomNumber,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
it('유저 생성', async () => {
|
|
44
|
+
const userId = await m2mClient.createUser(testUser);
|
|
45
|
+
expect(userId).toBeDefined();
|
|
46
|
+
testUserId = userId;
|
|
47
|
+
});
|
|
48
|
+
it('토큰 발급', async () => {
|
|
49
|
+
await m2mClient.fetchAccessToken();
|
|
50
|
+
});
|
|
51
|
+
it('유저 정보 수정', async () => {
|
|
52
|
+
await m2mClient.updateUserClientInfo(testUserId);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=m2m-client.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"m2m-client.spec.js","sourceRoot":"","sources":["../../../client/__tests__/m2m-client.spec.ts"],"names":[],"mappings":";;AACA,6CAAsD;AACtD,2CAA8C;AAC9C,2DAA8C;AAE9C,0BAA6F;AAC7F,uCAA0E;AAC1E,2CAA+C;AAE/C,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC1C,IAAI,SAAyB,CAAC;IAC9B,IAAI,QAAoB,CAAC;IACzB,IAAI,UAAU,GAAY,cAAc,CAAC;IACzC,IAAI,UAAU,GAAY,uBAAuB,CAAC;IAClD,SAAS,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,MAAM,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YACzD,OAAO,EAAE;gBACL,qBAAY,CAAC,OAAO,CAAC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BAAoB,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const testing_1 = require("@nestjs/testing");
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const config_1 = require("@nestjs/config");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const token_1 = require("../../token");
|
|
8
|
+
describe('OAuthClient', () => {
|
|
9
|
+
let oauthClient;
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
const testingModule = await testing_1.Test.createTestingModule({
|
|
12
|
+
imports: [
|
|
13
|
+
config_1.ConfigModule.forRoot({
|
|
14
|
+
envFilePath: `env/.env.${process.env.NODE_ENV}`,
|
|
15
|
+
isGlobal: true,
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
providers: [
|
|
19
|
+
{
|
|
20
|
+
provide: __1.LogtoLoggerServiceToken,
|
|
21
|
+
useClass: common_1.ConsoleLogger
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
provide: __1.OAuthClientToken,
|
|
25
|
+
useClass: __1.OAuthClient
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
provide: token_1.LogtoTokenVerifierToken,
|
|
29
|
+
useClass: token_1.LogtoTokenVerifier
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
}).compile();
|
|
33
|
+
oauthClient = testingModule.get(__1.OAuthClientToken);
|
|
34
|
+
});
|
|
35
|
+
it('로그인/ 회원가입을 위한 로그인 페이지 요청 URI 생성', () => {
|
|
36
|
+
const uri = oauthClient.getSignInURI(__1.SignInType.Admin);
|
|
37
|
+
expect(uri).toContain('prompt=login');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=oauth-client.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-client.spec.js","sourceRoot":"","sources":["../../../client/__tests__/oauth-client.spec.ts"],"names":[],"mappings":";;AAAA,6CAAuC;AACvC,0BAAwF;AACxF,2CAA8C;AAC9C,2CAA+C;AAC/C,uCAA0E;AAE1E,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IACzB,IAAI,WAAwB,CAAC;IAE7B,UAAU,CAAC,KAAK,IAAI,EAAE;QAClB,MAAM,aAAa,GAAG,MAAM,cAAI,CAAC,mBAAmB,CAAC;YACjD,OAAO,EAAE;gBACL,qBAAY,CAAC,OAAO,CAAC;oBACnB,WAAW,EAAE,YAAY,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;oBAC/C,QAAQ,EAAE,IAAI;iBACf,CAAC;aACH;YACH,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,2BAAuB;oBAChC,QAAQ,EAAE,sBAAa;iBAC1B;gBACD;oBACI,OAAO,EAAE,oBAAgB;oBACzB,QAAQ,EAAE,eAAW;iBACxB;gBACD;oBACI,OAAO,EAAE,+BAAuB;oBAChC,QAAQ,EAAE,0BAAkB;iBAC/B;aACJ;SACJ,CAAC,CAAC,OAAO,EAAE,CAAC;QAEb,WAAW,GAAG,aAAa,CAAC,GAAG,CAAc,oBAAgB,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QAEvC,MAAM,GAAG,GAAG,WAAW,CAAC,YAAY,CAAC,cAAU,CAAC,KAAK,CAAC,CAAC;QAEvD,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type LogtoConfig = {
|
|
2
|
+
endpoint: string;
|
|
3
|
+
appId: string;
|
|
4
|
+
grantType: GrantType;
|
|
5
|
+
appSecret: string;
|
|
6
|
+
scopes?: string[];
|
|
7
|
+
resources?: string[];
|
|
8
|
+
prompt?: Prompt;
|
|
9
|
+
includeReservedScopes?: boolean;
|
|
10
|
+
redirectUri?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare enum Prompt {
|
|
13
|
+
None = "none",
|
|
14
|
+
Consent = "consent",
|
|
15
|
+
Login = "login"
|
|
16
|
+
}
|
|
17
|
+
export declare enum GrantType {
|
|
18
|
+
AuthorizationCode = "authorization_code",
|
|
19
|
+
ClientCredentials = "client_credentials",
|
|
20
|
+
RefreshToken = "refresh_token"
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GrantType = exports.Prompt = void 0;
|
|
4
|
+
var Prompt;
|
|
5
|
+
(function (Prompt) {
|
|
6
|
+
Prompt["None"] = "none";
|
|
7
|
+
Prompt["Consent"] = "consent";
|
|
8
|
+
Prompt["Login"] = "login";
|
|
9
|
+
})(Prompt || (exports.Prompt = Prompt = {}));
|
|
10
|
+
var GrantType;
|
|
11
|
+
(function (GrantType) {
|
|
12
|
+
GrantType["AuthorizationCode"] = "authorization_code";
|
|
13
|
+
GrantType["ClientCredentials"] = "client_credentials";
|
|
14
|
+
GrantType["RefreshToken"] = "refresh_token";
|
|
15
|
+
})(GrantType || (exports.GrantType = GrantType = {}));
|
|
16
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":";;;AA4DA,IAAY,MAIX;AAJD,WAAY,MAAM;IACd,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,yBAAe,CAAA;AACnB,CAAC,EAJW,MAAM,sBAAN,MAAM,QAIjB;AAUD,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,2CAA8B,CAAA;AAClC,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./config"), exports);
|
|
18
|
+
__exportStar(require("./m2m-client"), exports);
|
|
19
|
+
__exportStar(require("./oauth-client"), exports);
|
|
20
|
+
__exportStar(require("./logto-login-session"), exports);
|
|
21
|
+
__exportStar(require("./types"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B;AAC7B,iDAA+B;AAC/B,wDAAsC;AACtC,0CAAwB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LoggerService } from "@nestjs/common";
|
|
2
|
+
import { ConfigService } from "@nestjs/config";
|
|
3
|
+
import { AxiosResponse } from "axios";
|
|
4
|
+
import { OAuthClient, SignInType } from "./oauth-client";
|
|
5
|
+
export declare const LogtoLoginSessionToken: unique symbol;
|
|
6
|
+
export declare class LogtoLoginSession {
|
|
7
|
+
private readonly logger;
|
|
8
|
+
private readonly configService;
|
|
9
|
+
private readonly oauthClient;
|
|
10
|
+
private readonly apiRestTemplate;
|
|
11
|
+
constructor(logger: LoggerService, configService: ConfigService, oauthClient: OAuthClient);
|
|
12
|
+
createSignInSession(signInType: SignInType): Promise<{
|
|
13
|
+
response: AxiosResponse | undefined;
|
|
14
|
+
state: string;
|
|
15
|
+
}>;
|
|
16
|
+
experienceSignIn(cookie: string): Promise<any>;
|
|
17
|
+
verificationPassword(cookie: string, dto: {
|
|
18
|
+
identifier: {
|
|
19
|
+
type: string;
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
password: string;
|
|
23
|
+
}): Promise<any>;
|
|
24
|
+
identify(cookie: string, verificationId: string): Promise<any>;
|
|
25
|
+
submit(cookie: string): Promise<any>;
|
|
26
|
+
redirectToConsent(redirectTo: string, cookie: string): Promise<AxiosResponse>;
|
|
27
|
+
consent(cookie: string): Promise<any>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.LogtoLoginSession = exports.LogtoLoginSessionToken = void 0;
|
|
19
|
+
const common_1 = require("@nestjs/common");
|
|
20
|
+
const config_1 = require("@nestjs/config");
|
|
21
|
+
const axios_1 = __importDefault(require("axios"));
|
|
22
|
+
const oauth_client_1 = require("./oauth-client");
|
|
23
|
+
const types_1 = require("./types");
|
|
24
|
+
exports.LogtoLoginSessionToken = Symbol.for("LogtoLoginSession");
|
|
25
|
+
let LogtoLoginSession = class LogtoLoginSession {
|
|
26
|
+
constructor(logger, configService, oauthClient) {
|
|
27
|
+
this.logger = logger;
|
|
28
|
+
this.configService = configService;
|
|
29
|
+
this.oauthClient = oauthClient;
|
|
30
|
+
const baseURL = this.configService.get("LOGTO_M2M_API_URL");
|
|
31
|
+
this.apiRestTemplate = new types_1.LogtoOAuthRESTTemplate(this.logger, baseURL);
|
|
32
|
+
}
|
|
33
|
+
async createSignInSession(signInType) {
|
|
34
|
+
const { uri, state } = this.oauthClient.getSignInURI(signInType);
|
|
35
|
+
const response = await axios_1.default.get(uri, {
|
|
36
|
+
maxRedirects: 0,
|
|
37
|
+
validateStatus: (status) => status >= 200 && status <= 400,
|
|
38
|
+
withCredentials: true,
|
|
39
|
+
});
|
|
40
|
+
return { response, state };
|
|
41
|
+
}
|
|
42
|
+
async experienceSignIn(cookie) {
|
|
43
|
+
try {
|
|
44
|
+
const response = await this.apiRestTemplate.put(`/experience`, { interactionEvent: 'SignIn' }, {
|
|
45
|
+
headers: {
|
|
46
|
+
'Content-Type': 'application/json',
|
|
47
|
+
Cookie: cookie,
|
|
48
|
+
},
|
|
49
|
+
withCredentials: true,
|
|
50
|
+
});
|
|
51
|
+
return response.data;
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
this.logger.error('Failed to start login experience');
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async verificationPassword(cookie, dto) {
|
|
59
|
+
try {
|
|
60
|
+
const response = await this.apiRestTemplate.post(`/experience/verification/password`, {
|
|
61
|
+
identifier: dto.identifier,
|
|
62
|
+
password: dto.password,
|
|
63
|
+
}, {
|
|
64
|
+
headers: { Cookie: cookie, "Accept-Language": 'ko-KR, ko;' },
|
|
65
|
+
withCredentials: true,
|
|
66
|
+
});
|
|
67
|
+
return response.data;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async identify(cookie, verificationId) {
|
|
74
|
+
try {
|
|
75
|
+
const response = await this.apiRestTemplate.post(`/experience/identification`, { verificationId }, {
|
|
76
|
+
headers: { Cookie: cookie },
|
|
77
|
+
withCredentials: true,
|
|
78
|
+
});
|
|
79
|
+
return response.data;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async submit(cookie) {
|
|
86
|
+
try {
|
|
87
|
+
const response = await this.apiRestTemplate.post(`/experience/submit`, {}, {
|
|
88
|
+
headers: { Cookie: cookie },
|
|
89
|
+
withCredentials: true,
|
|
90
|
+
});
|
|
91
|
+
return response.data;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async redirectToConsent(redirectTo, cookie) {
|
|
98
|
+
const response = await axios_1.default.get(redirectTo, {
|
|
99
|
+
maxRedirects: 0,
|
|
100
|
+
validateStatus: (status) => status >= 200 && status <= 400,
|
|
101
|
+
withCredentials: true,
|
|
102
|
+
headers: { Cookie: cookie },
|
|
103
|
+
});
|
|
104
|
+
return response;
|
|
105
|
+
}
|
|
106
|
+
async consent(cookie) {
|
|
107
|
+
try {
|
|
108
|
+
const response = await this.apiRestTemplate.post(`/interaction/consent`, {}, {
|
|
109
|
+
headers: { Cookie: cookie },
|
|
110
|
+
withCredentials: true,
|
|
111
|
+
});
|
|
112
|
+
return response.data;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
throw error;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
exports.LogtoLoginSession = LogtoLoginSession;
|
|
120
|
+
exports.LogtoLoginSession = LogtoLoginSession = __decorate([
|
|
121
|
+
(0, common_1.Injectable)(),
|
|
122
|
+
__param(0, (0, common_1.Inject)(types_1.LogtoLoggerServiceToken)),
|
|
123
|
+
__param(1, (0, common_1.Inject)(config_1.ConfigService)),
|
|
124
|
+
__param(2, (0, common_1.Inject)(oauth_client_1.OAuthClientToken)),
|
|
125
|
+
__metadata("design:paramtypes", [Object, config_1.ConfigService,
|
|
126
|
+
oauth_client_1.OAuthClient])
|
|
127
|
+
], LogtoLoginSession);
|
|
128
|
+
//# sourceMappingURL=logto-login-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logto-login-session.js","sourceRoot":"","sources":["../../client/logto-login-session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAmE;AACnE,2CAA+C;AAC/C,kDAA6C;AAG7C,iDAIwB;AAExB,mCAGiB;AAGJ,QAAA,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAoB/D,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAa1B,YAEqB,MAAqB,EAGrB,aAA4B,EAG5B,WAAwB;QANxB,WAAM,GAAN,MAAM,CAAe;QAGrB,kBAAa,GAAb,aAAa,CAAe;QAG5B,gBAAW,GAAX,WAAW,CAAa;QAGzC,MAAM,OAAO,G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AAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG;YAC1D,eAAe,EAAE,IAAI;YACrB,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;SAC9B,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IACpB,CAAC;IASM,KAAK,CAAC,OAAO,CAAC,MAAc;QAC/B,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAC5C,sBAAsB,EACtB,EAAE,EACF;gBACI,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;gBAC3B,eAAe,EAAE,IAAI;aACxB,CACJ,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC;CACJ,CAAA;AAzMY,8CAAiB;4BAAjB,iBAAiB;IAlB7B,IAAA,mBAAU,GAAE;IAgCJ,WAAA,IAAA,eAAM,EAAC,+BAAuB,CAAC,CAAA;IAG/B,WAAA,IAAA,eAAM,EAAC,sBAAa,CAAC,CAAA;IAGrB,WAAA,IAAA,eAAM,EAAC,+BAAgB,CAAC,CAAA;6CAFO,sBAAa;QAGf,0BAAW;GArBpC,iBAAiB,CAyM7B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LoggerService } from "@nestjs/common";
|
|
2
|
+
import { ConfigService } from "@nestjs/config";
|
|
3
|
+
import { LogtoTokenVerifier } from "../token";
|
|
4
|
+
import { LogtoRole, LogtoRoleResponse, LogtoUser, LogtoUserResponse } from "./types";
|
|
5
|
+
import { p3Values } from "point3-common-tool";
|
|
6
|
+
export declare const LogtoM2MClientToken: unique symbol;
|
|
7
|
+
export declare class LogtoM2MClient {
|
|
8
|
+
private readonly configService;
|
|
9
|
+
private readonly tokenVerifier;
|
|
10
|
+
private readonly logger;
|
|
11
|
+
private logtoConfig;
|
|
12
|
+
private accessToken?;
|
|
13
|
+
private readonly authRestTemplate;
|
|
14
|
+
private readonly apiRestTemplate;
|
|
15
|
+
constructor(configService: ConfigService, tokenVerifier: LogtoTokenVerifier, logger: LoggerService);
|
|
16
|
+
fetchAccessToken(): Promise<void>;
|
|
17
|
+
fetchAccessTokenByPAT(pat: string): Promise<{
|
|
18
|
+
accessToken: string;
|
|
19
|
+
}>;
|
|
20
|
+
private getAccessToken;
|
|
21
|
+
getRoles(): Promise<LogtoRoleResponse[]>;
|
|
22
|
+
getRoleByName(name: string): Promise<LogtoRoleResponse>;
|
|
23
|
+
createRole(role: LogtoRole): Promise<LogtoRoleResponse>;
|
|
24
|
+
assignRoleToUser(userId: string, roleId: string): Promise<void>;
|
|
25
|
+
createUser(user: LogtoUser): Promise<string>;
|
|
26
|
+
updateUserClientInfo(userId: string, clientId?: string): Promise<void>;
|
|
27
|
+
getUser(id: string): Promise<LogtoUserResponse>;
|
|
28
|
+
getUsersByEmailAndPhone(email: string, phone: string): Promise<LogtoUserResponse>;
|
|
29
|
+
getUserByUsername(username: string): Promise<LogtoUserResponse>;
|
|
30
|
+
suspendUser(userId: string): Promise<LogtoUserResponse>;
|
|
31
|
+
deleteUser(userId: string): Promise<void>;
|
|
32
|
+
deleteUserRole(userId: string, roleId: string): Promise<void>;
|
|
33
|
+
unsuspendUser(userId: string): Promise<LogtoUserResponse>;
|
|
34
|
+
sendVerificationCode(identifier: p3Values.PhoneNumber | p3Values.Email): Promise<void>;
|
|
35
|
+
verifyCode(identifier: p3Values.PhoneNumber | p3Values.Email, code: string): Promise<void>;
|
|
36
|
+
updateUserPassword(userId: string, password: string): Promise<LogtoUserResponse>;
|
|
37
|
+
}
|
|
38
|
+
export declare function generatePhoneNumberWithCountryCode(countryCode: string, phoneNumber: string): string;
|
|
@@ -0,0 +1,225 @@
|
|
|
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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LogtoM2MClient = exports.LogtoM2MClientToken = void 0;
|
|
16
|
+
exports.generatePhoneNumberWithCountryCode = generatePhoneNumberWithCountryCode;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const config_1 = require("@nestjs/config");
|
|
19
|
+
const config_2 = require("./config");
|
|
20
|
+
const token_1 = require("../token");
|
|
21
|
+
const types_1 = require("./types");
|
|
22
|
+
const point3_common_tool_1 = require("point3-common-tool");
|
|
23
|
+
const errors_1 = require("../errors");
|
|
24
|
+
exports.LogtoM2MClientToken = Symbol.for("LogtoM2MClient");
|
|
25
|
+
let LogtoM2MClient = class LogtoM2MClient {
|
|
26
|
+
constructor(configService, tokenVerifier, logger) {
|
|
27
|
+
this.configService = configService;
|
|
28
|
+
this.tokenVerifier = tokenVerifier;
|
|
29
|
+
this.logger = logger;
|
|
30
|
+
this.logtoConfig = {
|
|
31
|
+
endpoint: this.configService.get('LOGTO_AUTH_ENDPOINT'),
|
|
32
|
+
appId: this.configService.get('LOGTO_M2M_CLIENT_ID'),
|
|
33
|
+
appSecret: this.configService.get('LOGTO_M2M_CLIENT_SECRET'),
|
|
34
|
+
scopes: ['all'],
|
|
35
|
+
resources: [this.configService.get('LOGTO_M2M_RESOURCE')],
|
|
36
|
+
grantType: config_2.GrantType.ClientCredentials,
|
|
37
|
+
};
|
|
38
|
+
this.authRestTemplate = new types_1.LogtoOAuthRESTTemplate(this.logger, this.logtoConfig.endpoint);
|
|
39
|
+
this.authRestTemplate.setBasic(this.logtoConfig.appId, this.logtoConfig.appSecret);
|
|
40
|
+
this.apiRestTemplate = new types_1.LogtoOAuthRESTTemplate(this.logger, this.configService.get('LOGTO_M2M_API_URL'));
|
|
41
|
+
}
|
|
42
|
+
async fetchAccessToken() {
|
|
43
|
+
const params = new URLSearchParams();
|
|
44
|
+
params.set('grant_type', this.logtoConfig.grantType);
|
|
45
|
+
params.set('scope', this.logtoConfig.scopes.join(' '));
|
|
46
|
+
params.set('resource', this.logtoConfig.resources.join(' '));
|
|
47
|
+
const response = await this.authRestTemplate.post('/token', params.toString(), {
|
|
48
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
49
|
+
});
|
|
50
|
+
const { access_token, expires_in } = response.data;
|
|
51
|
+
const payload = await this.tokenVerifier.verifyToken(access_token);
|
|
52
|
+
this.accessToken = new token_1.AccessToken(payload.sub, access_token, expires_in);
|
|
53
|
+
this.apiRestTemplate.setBearer(access_token);
|
|
54
|
+
}
|
|
55
|
+
async fetchAccessTokenByPAT(pat) {
|
|
56
|
+
try {
|
|
57
|
+
const parameters = new URLSearchParams();
|
|
58
|
+
parameters.set("grant_type", "urn:ietf:params:oauth:grant-type:token-exchange");
|
|
59
|
+
parameters.set("scope", this.logtoConfig.scopes.join(" "));
|
|
60
|
+
parameters.set("resource", this.logtoConfig.resources.join(" "));
|
|
61
|
+
parameters.set("subject_token", pat);
|
|
62
|
+
parameters.set("subject_token_type", "urn:logto:token-type:personal_access_token");
|
|
63
|
+
const response = await this.authRestTemplate.post(`${this.logtoConfig.endpoint}/token`, parameters.toString(), {
|
|
64
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
65
|
+
});
|
|
66
|
+
console.log(response);
|
|
67
|
+
return {
|
|
68
|
+
accessToken: response.data["access_token"],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
throw new Error(pat);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async getAccessToken() {
|
|
76
|
+
if (!this.accessToken || this.accessToken.isExpired()) {
|
|
77
|
+
await this.fetchAccessToken();
|
|
78
|
+
}
|
|
79
|
+
return this.accessToken.token;
|
|
80
|
+
}
|
|
81
|
+
async getRoles() {
|
|
82
|
+
await this.getAccessToken();
|
|
83
|
+
const response = await this.apiRestTemplate.get('/roles');
|
|
84
|
+
return response.data;
|
|
85
|
+
}
|
|
86
|
+
async getRoleByName(name) {
|
|
87
|
+
await this.getAccessToken();
|
|
88
|
+
const params = new URLSearchParams();
|
|
89
|
+
params.set('search.name', name);
|
|
90
|
+
const response = await this.apiRestTemplate.get(`/roles?${params.toString()}`);
|
|
91
|
+
return response.data[0];
|
|
92
|
+
}
|
|
93
|
+
async createRole(role) {
|
|
94
|
+
await this.getAccessToken();
|
|
95
|
+
const body = {
|
|
96
|
+
name: role.name,
|
|
97
|
+
description: role.description,
|
|
98
|
+
type: role.type,
|
|
99
|
+
};
|
|
100
|
+
const response = await this.apiRestTemplate.post('/roles', body);
|
|
101
|
+
if (response instanceof point3_common_tool_1.axiosAdapter.ValidationError) {
|
|
102
|
+
if (response.code === 'role.name_in_use') {
|
|
103
|
+
this.logger.error(`이미 존재하는 역할: ${response.code}`, this.constructor.name);
|
|
104
|
+
return this.getRoleByName(role.name);
|
|
105
|
+
}
|
|
106
|
+
throw response;
|
|
107
|
+
}
|
|
108
|
+
return response.data;
|
|
109
|
+
}
|
|
110
|
+
async assignRoleToUser(userId, roleId) {
|
|
111
|
+
await this.getAccessToken();
|
|
112
|
+
const body = { roleIds: [roleId] };
|
|
113
|
+
await this.apiRestTemplate.post(`/users/${userId}/roles`, body);
|
|
114
|
+
this.logger.log(`사용자에 역할 할당: ${userId}`, this.constructor.name);
|
|
115
|
+
}
|
|
116
|
+
async createUser(user) {
|
|
117
|
+
await this.getAccessToken();
|
|
118
|
+
if (user.username && user.primaryEmail && user.password && user.primaryPhone && user.name) {
|
|
119
|
+
user.passwordAlgorithm = user.passwordAlgorithm ?? types_1.LogtoPasswordAlgorithm.Argon2i;
|
|
120
|
+
const response = await this.apiRestTemplate.post('/users', user);
|
|
121
|
+
return response.data.id;
|
|
122
|
+
}
|
|
123
|
+
this.logger.error(`필수 필드 누락`, this.constructor.name);
|
|
124
|
+
throw new errors_1.UserMissingRequiredFieldsError();
|
|
125
|
+
}
|
|
126
|
+
async updateUserClientInfo(userId, clientId) {
|
|
127
|
+
await this.getAccessToken();
|
|
128
|
+
await this.apiRestTemplate.patch(`/users/${userId}`, {
|
|
129
|
+
customData: { clientId },
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
async getUser(id) {
|
|
133
|
+
await this.getAccessToken();
|
|
134
|
+
const response = await this.apiRestTemplate.get(`/users/${id}`);
|
|
135
|
+
return response.data;
|
|
136
|
+
}
|
|
137
|
+
async getUsersByEmailAndPhone(email, phone) {
|
|
138
|
+
await this.getAccessToken();
|
|
139
|
+
const params = new URLSearchParams();
|
|
140
|
+
params.set('search.primaryEmail', email);
|
|
141
|
+
params.set('search.primaryPhone', generatePhoneNumberWithCountryCode('82', phone));
|
|
142
|
+
params.set('joint', 'and');
|
|
143
|
+
params.set('mode.primaryEmail', 'exact');
|
|
144
|
+
params.set('mode.primaryPhone', 'exact');
|
|
145
|
+
const response = await this.apiRestTemplate.get(`/users?${params.toString()}`);
|
|
146
|
+
const logtoUsers = response.data;
|
|
147
|
+
if (logtoUsers.length === 1) {
|
|
148
|
+
return logtoUsers[0];
|
|
149
|
+
}
|
|
150
|
+
if (logtoUsers.length === 0) {
|
|
151
|
+
this.logger.error(`사용자 없음: email=${email}, phone=${phone}`, this.constructor.name);
|
|
152
|
+
throw new errors_1.UserNotFoundError(email, phone);
|
|
153
|
+
}
|
|
154
|
+
this.logger.error(`여러 사용자 발견: email=${email}, phone=${phone}`, this.constructor.name);
|
|
155
|
+
this.logger.error(JSON.stringify(logtoUsers), this.constructor.name);
|
|
156
|
+
throw new errors_1.MultipleUsersFoundError(email, phone);
|
|
157
|
+
}
|
|
158
|
+
async getUserByUsername(username) {
|
|
159
|
+
await this.getAccessToken();
|
|
160
|
+
const params = new URLSearchParams();
|
|
161
|
+
params.set('search.username', username);
|
|
162
|
+
params.set('mode.username', 'exact');
|
|
163
|
+
const response = await this.apiRestTemplate.get(`/users?${params.toString()}`);
|
|
164
|
+
return response.data[0];
|
|
165
|
+
}
|
|
166
|
+
async suspendUser(userId) {
|
|
167
|
+
await this.getAccessToken();
|
|
168
|
+
const response = await this.apiRestTemplate.patch(`/users/${userId}/is-suspended`, { isSuspended: true });
|
|
169
|
+
return response.data;
|
|
170
|
+
}
|
|
171
|
+
async deleteUser(userId) {
|
|
172
|
+
await this.getAccessToken();
|
|
173
|
+
await this.apiRestTemplate.delete(`/users/${userId}`);
|
|
174
|
+
}
|
|
175
|
+
async deleteUserRole(userId, roleId) {
|
|
176
|
+
await this.getAccessToken();
|
|
177
|
+
await this.apiRestTemplate.delete(`/roles/${roleId}/users/${userId}`);
|
|
178
|
+
}
|
|
179
|
+
async unsuspendUser(userId) {
|
|
180
|
+
await this.getAccessToken();
|
|
181
|
+
const response = await this.apiRestTemplate.patch(`/users/${userId}/is-suspended`, { isSuspended: false });
|
|
182
|
+
return response.data;
|
|
183
|
+
}
|
|
184
|
+
async sendVerificationCode(identifier) {
|
|
185
|
+
await this.getAccessToken();
|
|
186
|
+
const method = identifier instanceof types_1.VerificationMethodType.email
|
|
187
|
+
? "email"
|
|
188
|
+
: "phone";
|
|
189
|
+
await this.apiRestTemplate.post('/verification-codes', {
|
|
190
|
+
[method]: identifier.toString(),
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
async verifyCode(identifier, code) {
|
|
194
|
+
await this.getAccessToken();
|
|
195
|
+
const method = identifier instanceof types_1.VerificationMethodType.email
|
|
196
|
+
? 'email'
|
|
197
|
+
: 'phone';
|
|
198
|
+
await this.apiRestTemplate.post(`/verification-codes/verify`, {
|
|
199
|
+
[method]: identifier.toString(),
|
|
200
|
+
verificationCode: code,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
async updateUserPassword(userId, password) {
|
|
204
|
+
await this.getAccessToken();
|
|
205
|
+
const response = await this.apiRestTemplate.patch(`/users/${userId}/password`, { password });
|
|
206
|
+
return response.data;
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
exports.LogtoM2MClient = LogtoM2MClient;
|
|
210
|
+
exports.LogtoM2MClient = LogtoM2MClient = __decorate([
|
|
211
|
+
(0, common_1.Global)(),
|
|
212
|
+
(0, common_1.Injectable)(),
|
|
213
|
+
__param(0, (0, common_1.Inject)(config_1.ConfigService)),
|
|
214
|
+
__param(1, (0, common_1.Inject)(token_1.LogtoTokenVerifierToken)),
|
|
215
|
+
__param(2, (0, common_1.Inject)(types_1.LogtoLoggerServiceToken)),
|
|
216
|
+
__metadata("design:paramtypes", [config_1.ConfigService,
|
|
217
|
+
token_1.LogtoTokenVerifier, Object])
|
|
218
|
+
], LogtoM2MClient);
|
|
219
|
+
function generatePhoneNumberWithCountryCode(countryCode, phoneNumber) {
|
|
220
|
+
if (phoneNumber.startsWith('0')) {
|
|
221
|
+
phoneNumber = phoneNumber.slice(1);
|
|
222
|
+
}
|
|
223
|
+
return `${countryCode}${phoneNumber}`;
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=m2m-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"m2m-client.js","sourceRoot":"","sources":["../../client/m2m-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA+cA,gFAKC;AA5cD,2CA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