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

Auth clients: Hide private data from exports #133

Merged
merged 4 commits into from
Jun 1, 2020
Merged

Conversation

eatyourgreens
Copy link
Contributor

@eatyourgreens eatyourgreens commented May 29, 2020

Hide underscored methods and properties from the exported auth and oauth clients.

Change the signature of auth.checkBearerToken() so that it resolves true/false rather than resolving with the bearer token.

npm install zooniverse/panoptes-javascript-client#private-data to try this out.

Export only public methods for the first-party auth client.
Export only public methods for the third-party auth client.
@eatyourgreens eatyourgreens added the security Pull requests that address a security vulnerability label May 29, 2020
@eatyourgreens
Copy link
Contributor Author

I've been able to classify cards on Every Name Counts without problems. Classified subjects show up in my Recents, so auth headers are being sent properly. Comments error on Talk staging, but I see the same errors on master.

@eatyourgreens eatyourgreens requested a review from a team May 29, 2020 13:09
@eatyourgreens
Copy link
Contributor Author

Some consuming apps use the return value from checkBearerToken to set headers, so those changes should be removed from this PR.

Add the listen and stopListening methods. Organise the exports in alphabetical order.
Copy link
Contributor

@wgranger wgranger left a comment

Choose a reason for hiding this comment

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

auth is missing the requestPassword export, which is used here in PFE

@eatyourgreens
Copy link
Contributor Author

I've added resetPassword back to the auth client.

@eatyourgreens eatyourgreens requested a review from wgranger June 1, 2020 11:59
@wgranger
Copy link
Contributor

wgranger commented Jun 1, 2020

Nice. LGTM

@wgranger wgranger merged commit 22c9b36 into master Jun 1, 2020
@wgranger wgranger deleted the private-data branch June 1, 2020 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants