twisted / twisted/twisted

twisted.web._auth.digest.DigestedCredentials duplicates digest calculation code between checkPassword and checkHash methods

Open
#3,451 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement new priority-normal web
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

exarkun's avatar @exarkun reported
Trac ID trac#3451
Type enhancement
Created 2008-09-29 16:25:06Z

There's a lot of duplication between these two methods. It could be refactored into a third method and used by each of these. As a bonus, this would perhaps be code useful to a client library which also needs to construct an appropriate value for the response field.

Searchable metadata
trac-id__3451 3451
type__enhancement enhancement
reporter__exarkun exarkun
priority__normal normal
milestone__ 
branch__ 
branch_author__ 
status__new new
resolution__None None
component__web web
keywords__ 
time__1222705506000000 1222705506000000
changetime__1222705506000000 1222705506000000
version__None None
owner__ 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at twisted.web._auth.digest.DigestedCredentials and compare the checkPassword and checkHash methods to identify their duplicated digest calculation. Review existing web authentication tests before extracting the shared behavior, and confirm both methods retain their current results while the common calculation can also support constructing the response value.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.