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

Авторизация по OAuth #149

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

Conversation

leshchenko1979
Copy link
Owner

Fixes #40

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 5, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.04%.

Quality metrics Before After Change
Complexity 1.34 ⭐ 1.30 ⭐ -0.04 👍
Method Length 42.61 ⭐ 42.91 ⭐ 0.30 👎
Working memory 5.59 ⭐ 5.45 ⭐ -0.14 👍
Quality 83.51% 83.55% 0.04% 👍
Other metrics Before After Change
Lines 780 871 91
Changed files Quality Before Quality After Quality Change
fast_bitrix24/bitrix.py 89.07% ⭐ 88.70% ⭐ -0.37% 👎
fast_bitrix24/srh.py 85.48% ⭐ 85.00% ⭐ -0.48% 👎
tests/test_async.py 80.73% ⭐ 81.45% ⭐ 0.72% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
tests/test_async.py TestMocks.test_get_by_ID 0 ⭐ 187 😞 8 🙂 63.70% 🙂 Try splitting into smaller methods
tests/test_async.py TestMocks.test_mock_get_all 3 ⭐ 108 🙂 10 😞 64.93% 🙂 Extract out complex expressions
tests/test_async.py TestMocks.test_mock_get_all.post_callback 2 ⭐ 63 🙂 10 😞 72.44% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@leshchenko1979
Copy link
Owner Author

Добавляет функциональность авторизации по токену.

Пример кода:

def get_new_token() -> str:
    # Тут идет ваша реализация получения нового токена от сервера авторизации
    return new_token


b = Bitrix(webhook, token_func=get_new_token())

# Дальше идут ваши вызовы к Битриксу. `get_new_token` будет вызываться каждый раз,
# когда старый токен перестает работать.

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.

Авторизация по OAuth
1 participant