-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/service token #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
refactor team invitation
Auth bug/fix
…path Refactor/verifier api path
| appId: string, | ||
| user, | ||
| ): Promise<{ access_token; expiresIn; tokenType }> { | ||
| const context = Context.idDashboard; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any where else in this function , use of this variable context ??
I can see its used in const sessionId = ${appId}_${context};
but if we do not use it anywhere elese then we can directly use this like const sessionId = ${appId}_${Context.idDashboard}` ?
| public async getAccessToken(data, expiresin = 4) { | ||
| const secret = this.config.get('JWT_SECRET'); | ||
| const token = await this.jwt.signAsync(data, { | ||
| expiresIn: expiresin.toString() + 'h', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if I want to issue tokens in like min , I can not do becuae the expiry is always in hourh?
| subdomain: app.subdomain, | ||
| sessionId, | ||
| }; | ||
| return this.getAccessToken(dataToStore, 12); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep this expiry 12 some where in one place? so that we can look at that file and would know whats this exipry for?
| sessionId, | ||
| }; | ||
| await this.storeDataInRedis(grantType, app, accessList, sessionId); | ||
| return this.getAccessToken(tokenPayload, 12); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep this expiry 12 some where in one place? so that we can look at that file and would know whats this exipry for?
| sessionId, | ||
| JSON.stringify(creditPayload), | ||
| 'EX', | ||
| 5 * TIME.MINUTE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also keep all redis related expiry at one place.
| customerOnboardingData.kycSubdomain, | ||
| sessionId: kycRedisKey, | ||
| }, | ||
| 4, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this expiry 4 somewhere at one place
src/utils/time-constant.ts
Outdated
| VERIFIER_TOKEN: { | ||
| name: 'verifierPageToken', | ||
| expiry: 30 * TIME.MINUTE, | ||
| jwtExpiry: 0.5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this expiry 0.5 somewhere at one place
| sessionId: ssiServiceId, | ||
| subdomain: ssiServiceDetail.subdomain, | ||
| }, | ||
| 0.5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this expiry 0.5 somewhere at one place
| sessionId: appId, | ||
| subdomain: kycServiceDetail.subdomain, | ||
| }, | ||
| 0.5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this expiry 0.5 somewhere at one place
| Logger.log('generateAccessToken() method: ends....', 'AppAuthService'); | ||
|
|
||
| return { access_token: token, expiresIn, tokenType: 'Bearer' }; | ||
| redisClient.set(sessionId, JSON.stringify(payload), 'EX', TIME.WEEK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep expiry in one place for reddis
🎯 Purpose
Why is this change needed? (problem it solves or value it adds)
📝 Changes
🔄 Type
🧪 Testing
How did you test this? (unit/integration/manual)
✅ Checklist