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

Add QQ provider #86

Open
wants to merge 116 commits into
base: master
Choose a base branch
from
Open

Add QQ provider #86

wants to merge 116 commits into from

Conversation

bealking
Copy link

@bealking bealking commented Oct 7, 2017

Add provider for QQ, which is the most used online communication tool in China.

bealking and others added 30 commits September 25, 2017 14:43
CI against Ruby 2.2.8/2.3.5/2.4.2
* add new ArgumentError for not defined user_class in config

* updated grammar
Most users use BCrypt and don't change defaults, which means that the default value would be 10. That makes tests run slowly.

Setting the number of stretches in test env to 1 can decrease the test suite up to 2x times (although BCrypt minimal cost is 4, we can use 1 for SHA algorithms).
* Add magic login feature

* Use `.nil?` instead of `== nil`

* Prepare for setting up database

- create a migration file for spec
- create a spec to be run and a shared_expmple file

* Add configration tests

change the default of `@magic_login_mailer_disabled` into true because
 the default breaks the tests

* Change the configuration key, magic_login_mailer into magic_login_mailer_class

* Add specs of `.generate_magic_login_token`

* Add specs of `.clear_magic_login_token`

* Add faliure case specs of `.magic_login_email`

* Add success case specs of `.magic_login_email`

* Refactoring: split the success case of the `.generate_magic_login_token` spec into two

* Fix posix compliance offence: No newline at end of file
Another choice of implemention is like this:

```
@model.class.find_by(:"#{primary_key}" =>
@model.send(:"#{primary_key}")).update(attrs)
```

but for some reasons I don't adopt it.
First it makes 2 queries instead of one.
Secondly it has potential risk to race conditions.
Added PR Sorcery#99 and removed duplicate entry for PR Sorcery#100
* Add rubocop config and todo

* Update changelog.md
Sorcery#109)

* Add required version parameter when requesting user information from vk provider
[fix Sorcery#108]

Seems like now vk provider requires v (version) parameter to be present when calling their API:

```
curl -XGET https://api.vk.com/method/getProfiles\?user_id\=1
=> {"error":{"error_code":8,"error_msg":"Invalid request: v (version) is required","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"getProfiles"},{"key":"user_id","value":"1"}]}}

curl -XGET https://api.vk.com/method/getProfiles\?user_id\=1\&v\=5.71
{"response":[{"id":1,"first_name":"Павел","last_name":"Дуров"}]}
```

* Developer can specify vk API version in sorcery config
[Sorcery#108]

* Fix indentation

* Extract authorize with vk request stub into a method

* Add VK api version to the sorcery initializer template
[Sorcery#108]

* Update changelog.md
* Add access_count_to_reset_password_page to migration/reset_password.rb

* Add #increment_password_reset_page_access_counter and #reset_password_reset_page_access_counter.

* Add #increment_password_reset_page_access_counter and #reset_password_reset_page_access_counter

* Add test suites related to #increment_password_reset_page_access_counter and #reset_password_reset_page_access_counter.

* Refactor `#increment_password_reset_page_access_counter`

Change manual increment into using
Sorcery::Adapters::ActiveRecordAdapter.increment.
* Add the request spec helper method, #login_user.

* Fix codacy failure because of `Redundant `self` detected.`
Add CHANGELOG entries for Sorcery#56 and Sorcery#57
Rails 5.2 appears to have deprecations that break our test suite, and solving
the issue would take more time than I have available currently. Updating to
5.1 for now.
* Rails 5.2 support

* Fix specs for Rails 4
joshbuker and others added 19 commits July 22, 2020 22:29
This is essentially 1:1 with Rubocop's Code of Conduct, which itself uses Ruby's
Code of Conduct as a base. It's minimal and easy to understand, which mirrors
the ethos of the Sorcery library itself.
* Add BattleNet Provider
* Add Changelog Info for BattleNet Provider
* Add  BattleNet Tests
* Fix Errors
* Fix Typo in Battlenet Provider
* Add Site config to initializer
* Fix Typo
* Remove conditional set of code arg
* Test against ruby 3

* Switch from Travis to GH Workflows

* Add metastep for simplified require GH checks

* Fix typo in matrix

* Remove TravisCI config

* Exclude rails 5.2 from ruby 3, deprecation conflicts

Co-authored-by: Josh Buker <[email protected]>
Honestly, I don't know if I want to even bother with rubocop in the legacy
codebase. The styling is being closely monitored in the rework, and code style
isn't really critical when it comes to security patches and bug fixes.

All to say, I may just disable the rubocop job for the legacy code again at some
point, if it gets annoying.
@joshbuker
Copy link
Member

This will be implemented via Omniauth strategies in v1.

@joshbuker joshbuker added the to be implemented in v1 This issue or pull request will be resolved in the v1 rework, but has not yet been completed. label May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be implemented in v1 This issue or pull request will be resolved in the v1 rework, but has not yet been completed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.