rez_core 1.0.95 → 1.0.96

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "1.0.95",
3
+ "version": "1.0.96",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -18,11 +18,19 @@ import { RolesGuard } from './guards/role.guard';
18
18
  JwtModule.registerAsync({
19
19
  imports: [ConfigModule],
20
20
  inject: [ConfigService],
21
- useFactory: async (configService: ConfigService) => ({
22
- secret: configService.get('SECRET_KEY'),
23
- signOptions: { expiresIn: '1800s' },
24
- }),
21
+ useFactory: async (configService: ConfigService) => {
22
+ const expiryInHours = parseFloat(
23
+ configService.get('TOKEN_EXPIRY') || '1',
24
+ );
25
+ const expiryInSeconds = expiryInHours * 60 * 60;
26
+
27
+ return {
28
+ secret: configService.get('SECRET_KEY'),
29
+ signOptions: { expiresIn: expiryInSeconds },
30
+ };
31
+ },
25
32
  }),
33
+
26
34
  TypeOrmModule.forFeature([UserSession]),
27
35
  ],
28
36
  providers: [
@@ -39,6 +39,17 @@ export class EntityTableColumn extends BaseEntity {
39
39
  @Column({ name: 'data_type', nullable: true })
40
40
  data_type: string;
41
41
 
42
+ @Column({
43
+ name: 'data_source_type',
44
+ type: 'varchar',
45
+ nullable: true,
46
+ length: 50,
47
+ })
48
+ data_source_type: string;
49
+
50
+ @Column({ name: 'datasource_list', type: 'varchar', nullable: true })
51
+ datasource_list: string;
52
+
42
53
  @Column({ name: 'visible', nullable: true })
43
54
  visible: string;
44
55
  }
@@ -2,7 +2,8 @@ import { UserSession } from '../entity/user-session.entity';
2
2
  import { ClockIDGenService } from '../../../utils/service/clockIDGenUtil.service';
3
3
  import { Injectable } from '@nestjs/common';
4
4
  import { UserSessionRepository } from '../repository/userSession.repository';
5
- import { JwtAuthService } from '../../../module/auth/services/jwt.service';
5
+ import { JwtAuthService } from 'src/module/auth/services/jwt.service';
6
+ import { ConfigService } from '@nestjs/config';
6
7
 
7
8
  @Injectable()
8
9
  export class UserSessionService {
@@ -10,6 +11,7 @@ export class UserSessionService {
10
11
  private readonly userSessionRepository: UserSessionRepository,
11
12
  private readonly jwtAuthService: JwtAuthService,
12
13
  private readonly clockIDGenService: ClockIDGenService,
14
+ private configService: ConfigService,
13
15
  ) {}
14
16
  async createSession(user) {
15
17
  const sessionToken = this.clockIDGenService.idGenerator('SES');
@@ -19,7 +21,10 @@ export class UserSessionService {
19
21
  userSession.session_key = sessionToken;
20
22
  userSession.is_session_loggedout = 0;
21
23
  userSession.login_time = new Date();
22
- userSession.expiry_date = new Date(Date.now() + 60 * 60 * 1000); // 1-hour expiry
24
+ const expiryTokenInHours = this.configService.get('TOKEN_EXPIRY') || 1;
25
+ userSession.expiry_date = new Date(
26
+ Date.now() + expiryTokenInHours * 60 * 60 * 1000,
27
+ );
23
28
 
24
29
  await this.userSessionRepository.saveSession(userSession);
25
30
 
@@ -29,7 +34,7 @@ export class UserSessionService {
29
34
  userSession.access_token = accessToken;
30
35
  await this.userSessionRepository.saveSession(userSession);
31
36
 
32
- return accessToken ;
37
+ return accessToken;
33
38
  }
34
39
 
35
40
  async findBySessionKey(sessionKey: string): Promise<UserSession | null> {
@@ -14,3 +14,10 @@ OTP_EXPIRY: "10"
14
14
  OTP_LENGTH: "6"
15
15
  VERIFY_OTP: "false"
16
16
  DEFAULT_OTP: "123456"
17
+ TOKEN_EXPIRY: 1
18
+ # AWS:
19
+ # S3:
20
+ # AWS_ACCESS_KEY_ID: "AKIAYYKIBDDSQF3KILGE"
21
+ # AWS_SECRET_KEY: "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"
22
+ # AWS_REGION: "ap-south-1"
23
+ # BUCKET_NAME: "testether"
@@ -12,4 +12,5 @@ CALLBACK_URL: "http://localhost:3000/auth/google/callback"
12
12
  OTP_EXPIRY: "10"
13
13
  OTP_LENGTH: "6"
14
14
  VERIFY_OTP: "false"
15
- DEFAULT_OTP: "123456"
15
+ DEFAULT_OTP: "123456"
16
+ TOKEN_EXPIRY: 1