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

expose trackVerified() #107

Merged
merged 7 commits into from
Jul 31, 2023
Merged

expose trackVerified() #107

merged 7 commits into from
Jul 31, 2023

Conversation

nickpatrick
Copy link
Contributor

Exposes trackVerified(), which calls POST /track on desktop agent running on localhost:52516. Need to add error handling (e.g., case where desktop agent not installed or not running)

@tderouin
Copy link

I tested this out with Radar Verify, and it worked well.

@nickpatrick nickpatrick marked this pull request as ready for review July 28, 2023 21:08
src/index.ts Outdated
try {
return VerifyAPI.trackVerified(params);
} finally {
ConfigAPI.getConfig(params); // call with updated permissions
Copy link
Collaborator

Choose a reason for hiding this comment

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

It doesn't seem like trackVerified is making any calls that would modify permissions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, will simplify

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

src/http.ts Outdated
}: {
method: HttpMethod;
path: string;
data?: any;
host?: string | undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this can just be host?: string;, then you don't need the default argument above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@nickpatrick nickpatrick changed the title expose trackVerified() [WIP] expose trackVerified() Jul 31, 2023
src/http.ts Outdated
@@ -129,7 +132,11 @@ class Http {
}

xhr.onerror = function() {
reject(new RadarServerError());
if (host && host.includes('localhost')) {
Copy link
Collaborator

@kochis kochis Jul 31, 2023

Choose a reason for hiding this comment

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

We should include the port here, it's possible that localhost can be a valid host (ie. developing against dashboard locally)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, done

@kochis kochis merged commit a21c72a into master Jul 31, 2023
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.

3 participants