[FTL-1954] Reorganize packages - #155
Conversation
|
|
||
| export default class JwtService { | ||
| static getDidFromToken(jwt: string) { | ||
| keyIdToDid: (keyId: string) => { |
There was a problem hiding this comment.
@inga-affinidi why this logic is moved there? This related logic how to get did from keyId its about didDocument and not JWT really
There was a problem hiding this comment.
Maybe I misunderstood things.
JwtService uses it (e.g. in buildJWTInteractionToken), and it is totally independent from the rest of affinidi code, so I thought it should belong here.
(Originally I tried to break did-auth-lib -> common dependency, replacing it with did-auth-lib -> tools-common, before I realized I should break internal-api-clients -> did-auth-lib instead)
|
|
||
| export type DidAuthAdapterType = { | ||
| readonly did: string | ||
| createDidAuthResponseToken(didAuthRequestToken: string): Promise<string> |
There was a problem hiding this comment.
if we change this method to return Promise<T> where T is an interface that has isExpiredAt(now: number) and toString(): string methods. It could simplify the code in common-libs/internal-api-clients/src/helpers/DidAuthManager.ts
There was a problem hiding this comment.
But then it will also have to accept request time as an argument.
That's another valid approach, but I don't see now if any of these is better than another.
did-auth-lib is now a part of monorepo; fixed cyclical dependency
common->internal-api-clients->did-auth-lib->common