Skip to content

feat: add Huawei auth adapter #7721

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

Open
wants to merge 10 commits into
base: alpha
Choose a base branch
from

Conversation

rltjqdl1138
Copy link

Add huawei auth adapter
I refer to google auth adapter
More information about huawei oauth: Huawei developer

New Pull Request Checklist

Issue Description

Related issue: FILL_THIS_OUT

Approach

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK
  • A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

Add huawei auth adapter
I refer to google auth adapter
@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 26, 2021

Thanks for opening this pull request!

  • ❌ Please edit your post and use the provided template when creating a new pull request. This helps everyone to understand your post better and asks for essential information to quicker review the pull request.

@codecov
Copy link

codecov bot commented Nov 26, 2021

Codecov Report

Merging #7721 (6ccb356) into alpha (0c3feaa) will decrease coverage by 0.15%.
The diff coverage is 19.35%.

Impacted file tree graph

@@            Coverage Diff             @@
##            alpha    #7721      +/-   ##
==========================================
- Coverage   93.95%   93.79%   -0.16%     
==========================================
  Files         183      184       +1     
  Lines       13660    13691      +31     
==========================================
+ Hits        12834    12842       +8     
- Misses        826      849      +23     
Impacted Files Coverage Δ
src/Adapters/Auth/huawei.js 16.66% <16.66%> (ø)
src/Adapters/Auth/index.js 93.65% <100.00%> (+0.10%) ⬆️
src/Adapters/Files/GridFSBucketAdapter.js 80.32% <0.00%> (+0.81%) ⬆️
src/ParseServerRESTController.js 98.50% <0.00%> (+1.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 410a1c7...6ccb356. Read the comment docs.

rltjqdl1138 and others added 2 commits November 29, 2021 16:24
1. Run eslint
eslint src/Adapters/Auth/huawei.js --fix

2. Reformat error message
3. Add new line to last of page
@mtrezza mtrezza changed the title Add huawei auth adapter feat: add Huawei auth adapter Nov 29, 2021
- Add dot to end of message.
- Remove ambiguos message "No SubError"
- Change capitalization
@mtrezza
Copy link
Member

mtrezza commented Dec 2, 2021

Do we need any tests here? Do other auth adapters have specific tests?

@rltjqdl1138
Copy link
Author

Do we need any tests here? Do other auth adapters have specific tests?

I only use Facebook and Huawei now. These two adapters are working well in common case.

  • success
  • expired token
  • wrong token
  • id is not matched

And my service uses very limited APIs

  • Login
  • Signup
  • Link to other users

I only tested upper cases.
If there isn't features to use auth adapter, I think it works well

@mtrezza
Copy link
Member

mtrezza commented Dec 5, 2021

I mean whether there are existing automated tests for other auth adapters, that we also need to add for this new Huawei adapter? See the /spec folder.

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Could you add the tests to cover the adapter? See TwitterAuth.spec.js as an example.

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