Skip to content

Commit 1e4806f

Browse files
committed
feat: grcp communication with auth domain on user domain and folder refactoring
1 parent ab158d9 commit 1e4806f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+974
-116
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ pids
5454

5555
# Diagnostic reports (https://nodejs.org/api/report.html)
5656
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
57+
58+
# grammar
59+
.vale.ini
60+
.vale-styles

.prettierrc

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,20 @@
1010
"quoteProps": "as-needed",
1111
"proseWrap": "preserve",
1212
"htmlWhitespaceSensitivity": "css",
13-
"embeddedLanguageFormatting": "auto"
14-
}
13+
"embeddedLanguageFormatting": "auto",
14+
15+
"useTabs": false,
16+
"bracketSameLine": false,
17+
"jsxSingleQuote": true,
18+
"parser": "typescript",
19+
"requirePragma": false,
20+
"insertPragma": false,
21+
"overrides": [
22+
{
23+
"files": "*.spec.ts",
24+
"options": {
25+
"printWidth": 100
26+
}
27+
}
28+
]
29+
}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ todo project
44

55

66
URL: https://bside.best/projects/detail/P240926112258
7+
8+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* TODO
3+
* @task implement handler to ochastration
4+
* - store user credential
5+
*/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* TODO
3+
* @task implement command for sending to handler
4+
*/

apps/auth/src/auth.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { Module } from '@nestjs/common';
22

3+
/**
4+
* TODO
5+
* @task implement importing the module written so far
6+
*/
37
@Module({
48
imports: [],
59
providers: [],
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { GrpcOptions, Transport } from '@nestjs/microservices';
2+
import { join } from 'path';
3+
4+
export const authGrpcOptions: GrpcOptions = {
5+
transport: Transport.GRPC,
6+
options: {
7+
package: 'auth',
8+
protoPath: join(__dirname, '../../../../proto/auth.proto'),
9+
url: 'auth:50051',
10+
},
11+
};

apps/auth/src/infrastructure/persistence/credentail.repository.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class UserCredentialRepository implements IUserCredentialRepository {
1818
}
1919
async updateUserCredential(entity: UserCredentialEntity): Promise<void> {
2020
const record = UserCredentialMapper.toPersistence(entity);
21+
2122
await this.prisma.userCredentials.update({
2223
where: {
2324
id: entity.id,
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
-- CreateTable
2+
CREATE TABLE `Tokens` (
3+
`id` VARCHAR(191) NOT NULL,
4+
`userId` VARCHAR(191) NOT NULL,
5+
`accessToken` VARCHAR(191) NOT NULL,
6+
`refreshToken` VARCHAR(191) NOT NULL,
7+
`isRevoked` BOOLEAN NOT NULL DEFAULT false,
8+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
9+
`updatedAt` DATETIME(3) NOT NULL,
10+
`expiresAt` DATETIME(3) NOT NULL,
11+
12+
UNIQUE INDEX `Tokens_accessToken_key`(`accessToken`),
13+
UNIQUE INDEX `Tokens_refreshToken_key`(`refreshToken`),
14+
INDEX `Tokens_isRevoked_expiresAt_idx`(`isRevoked`, `expiresAt`),
15+
PRIMARY KEY (`id`)
16+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
17+
18+
-- CreateTable
19+
CREATE TABLE `OAuthProvider` (
20+
`id` VARCHAR(191) NOT NULL,
21+
`provider` ENUM('KAKAO', 'GOOGLE', 'APPLE') NOT NULL,
22+
`providerId` VARCHAR(191) NOT NULL,
23+
`userId` VARCHAR(191) NOT NULL,
24+
`createAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
25+
`updateAt` DATETIME(3) NOT NULL,
26+
27+
INDEX `OAuthProvider_userId_provider_idx`(`userId`, `provider`),
28+
UNIQUE INDEX `OAuthProvider_provider_providerId_key`(`provider`, `providerId`),
29+
PRIMARY KEY (`id`)
30+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
31+
32+
-- CreateTable
33+
CREATE TABLE `UserCredentials` (
34+
`id` VARCHAR(191) NOT NULL,
35+
`userId` VARCHAR(191) NOT NULL,
36+
`email` VARCHAR(191) NOT NULL,
37+
`passwordHash` VARCHAR(191) NOT NULL,
38+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
39+
`updatedAt` DATETIME(3) NOT NULL,
40+
41+
UNIQUE INDEX `UserCredentials_userId_key`(`userId`),
42+
UNIQUE INDEX `UserCredentials_email_key`(`email`),
43+
PRIMARY KEY (`id`)
44+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Please do not edit this file manually
2+
# It should be added in your version-control system (e.g., Git)
3+
provider = "mysql"

0 commit comments

Comments
 (0)