Skip to content

chore: Add JWT Algorithm Choices ✨ - #143

Merged
yezz123 merged 2 commits into
mainfrom
JWT
Nov 11, 2021
Merged

yezz123 merged 2 commits into
mainfrom
JWT

Conversation

@yezz123

@yezz123 yezz123 commented Nov 11, 2021

Copy link
Copy Markdown
Owner

Relate to this #122 discussion, i choose to give the user the option to choose the Algorithm, also the RS256 still the default one 🚀

@yezz123 yezz123 added the enhancement New feature or request label Nov 11, 2021
@yezz123 yezz123 self-assigned this Nov 11, 2021
@codecov

codecov Bot commented Nov 11, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #143 (07c6dd0) into main (e6ea4cd) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 07c6dd0 differs from pull request most recent head 5d4020c. Consider uploading reports for the commit 5d4020c to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
- Coverage   72.03%   72.01%   -0.03%     
==========================================
  Files          34       34              
  Lines        1241     1240       -1     
==========================================
- Hits          894      893       -1     
  Misses        347      347              
Impacted Files Coverage Δ
authx/core/jwt.py 100.00% <ø> (ø)
authx/main.py 37.66% <ø> (ø)
authx/routers/social.py 89.13% <ø> (ø)
authx/core/config.py 100.00% <100.00%> (ø)

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 e6ea4cd...5d4020c. Read the comment docs.

@pull-request-quantifier-deprecated

Copy link
Copy Markdown

This PR has 27 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Small
Size       : +11 -16
Percentile : 10.8%

Total files changed: 5

Change summary by file extension:
.coveragerc : +4 -0
.py : +7 -16

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detetcted.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@sourcery-ai

sourcery-ai Bot commented Nov 11, 2021

Copy link
Copy Markdown
Contributor

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.08%.

Quality metrics Before After Change
Complexity 1.94 ⭐ 1.95 ⭐ 0.01 👎
Method Length 43.87 ⭐ 44.19 ⭐ 0.32 👎
Working memory 8.54 🙂 8.54 🙂 0.00
Quality 73.40% 🙂 73.32% 🙂 -0.08% 👎
Other metrics Before After Change
Lines 515 507 -8
Changed files Quality Before Quality After Quality Change
authx/main.py 77.88% ⭐ 77.88% ⭐ 0.00%
authx/core/config.py 69.64% 🙂 68.61% 🙂 -1.03% 👎
authx/core/jwt.py 83.14% ⭐ 83.14% ⭐ 0.00%
authx/routers/social.py 62.62% 🙂 62.62% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
authx/routers/social.py get_router 6 ⭐ 230 ⛔ 10 😞 50.45% 🙂 Try splitting into smaller methods. Extract out complex expressions
authx/main.py Authentication.__init__ 0 ⭐ 129 😞 21 ⛔ 52.43% 🙂 Try splitting into smaller methods. Extract out complex expressions
authx/routers/social.py get_router.callback 2 ⭐ 137 😞 9 🙂 64.41% 🙂 Try splitting into smaller methods
authx/core/jwt.py JWTBackend._create_token 2 ⭐ 57 ⭐ 10 😞 73.38% 🙂 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!

@yezz123
yezz123 merged commit 4f313ed into main Nov 11, 2021
@yezz123
yezz123 deleted the JWT branch November 11, 2021 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Extra Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant