Skip to content
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

added api call for generating access token and did #98

Closed
wants to merge 8 commits into from

Conversation

varsha766
Copy link
Contributor

@varsha766 varsha766 commented Jul 21, 2023

Implemented api call from sdk to studio-api for creating, registering, resolving and updating a didDoc

this.apiKey = apiKey
}
async generateAccessToken(): Promise<IgenerateToken> {
const studioApiUrl = "https://api.entity.hypersign.id/api/v1/app/oauth"
Copy link
Contributor

@Vishwas1 Vishwas1 Jul 24, 2023

Choose a reason for hiding this comment

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

studioApiUrl should not be hardcoded here, put it in config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya i have added it in separate file now. Yet not commited

const studioApiUrl = "https://api.entity.hypersign.id/api/v1/app/oauth"
const headers = {
"X-Api-Secret-Key": this.apiKey,
"Origin": "https://entity.hypersign.id"
Copy link
Contributor

Choose a reason for hiding this comment

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

Origin should not also be hardcoded, I guess you need to take this in constructor params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need of passing origin. Its working fine without passing origin also

this.accessToken = accessToken.access_token
}
public async generateDid(params: IGenerateDid) {
const apiUrl = "https://api.entity.hypersign.id/api/v1/did/create"
Copy link
Contributor

Choose a reason for hiding this comment

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

this also should not be hardcoded here

const headers = {
"Content-Type": "application/json",
Authorization: `Bearer ${this.accessToken}`,
Origin: "https://entity.hypersign.id"
Copy link
Contributor

Choose a reason for hiding this comment

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

Take this in constructor params

@varsha766 varsha766 requested a review from Vishwas1 July 28, 2023 10:20
@Vishwas1 Vishwas1 closed this Oct 18, 2023
@Vishwas1 Vishwas1 deleted the HSSTUD-218 branch October 18, 2023 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants