Skip to content
This repository was archived by the owner on Aug 29, 2024. It is now read-only.

[FTL-1954] Reorganize packages - #155

Merged
inga-affinidi merged 7 commits into
masterfrom
inga.l/FTL-1954/reorganize-packages
Oct 13, 2021
Merged

[FTL-1954] Reorganize packages#155
inga-affinidi merged 7 commits into
masterfrom
inga.l/FTL-1954/reorganize-packages

Conversation

@inga-affinidi

Copy link
Copy Markdown
Contributor

did-auth-lib is now a part of monorepo; fixed cyclical dependency common -> internal-api-clients -> did-auth-lib -> common


export default class JwtService {
static getDidFromToken(jwt: string) {
keyIdToDid: (keyId: string) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@inga-affinidi why this logic is moved there? This related logic how to get did from keyId its about didDocument and not JWT really

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@inga-affinidi
inga-affinidi merged commit 0ee6d87 into master Oct 13, 2021
@inga-affinidi
inga-affinidi deleted the inga.l/FTL-1954/reorganize-packages branch October 13, 2021 15:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants