Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arthur Brugière
funkwhale
Commits
f7b5214f
Commit
f7b5214f
authored
4 years ago
by
Georg Krause
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Merge branch '876-http-signature' into 'develop'"
This reverts merge request !1120
parent
648abfd9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/funkwhale_api/federation/factories.py
+2
-1
2 additions, 1 deletion
api/funkwhale_api/federation/factories.py
api/funkwhale_api/federation/signing.py
+3
-2
3 additions, 2 deletions
api/funkwhale_api/federation/signing.py
api/requirements/base.txt
+3
-1
3 additions, 1 deletion
api/requirements/base.txt
with
8 additions
and
4 deletions
api/funkwhale_api/federation/factories.py
+
2
−
1
View file @
f7b5214f
...
...
@@ -20,10 +20,11 @@ class SignatureAuthFactory(factory.Factory):
algorithm
=
"
rsa-sha256
"
key
=
factory
.
LazyFunction
(
lambda
:
keys
.
get_key_pair
()[
0
])
key_id
=
factory
.
Faker
(
"
url
"
)
use_auth_header
=
False
headers
=
[
"
(request-target)
"
,
"
user-agent
"
,
"
host
"
,
"
date
"
,
"
accept
"
]
class
Meta
:
model
=
requests_http_signature
.
HTTPSignature
Header
Auth
model
=
requests_http_signature
.
HTTPSignatureAuth
@registry.register
(
name
=
"
federation.SignedRequest
"
)
...
...
This diff is collapsed.
Click to expand it.
api/funkwhale_api/federation/signing.py
+
3
−
2
View file @
f7b5214f
...
...
@@ -46,7 +46,7 @@ def verify(request, public_key):
verify_date
(
date
)
try
:
return
requests_http_signature
.
HTTPSignatureAuth
.
verify
(
request
,
key_resolver
=
lambda
**
kwargs
:
public_key
,
scheme
=
"
Signature
"
request
,
key_resolver
=
lambda
**
kwargs
:
public_key
,
use_auth_header
=
False
)
except
cryptography
.
exceptions
.
InvalidSignature
:
logger
.
warning
(
...
...
@@ -98,7 +98,8 @@ def verify_django(django_request, public_key):
def
get_auth
(
private_key
,
private_key_id
):
return
requests_http_signature
.
HTTPSignatureHeaderAuth
(
return
requests_http_signature
.
HTTPSignatureAuth
(
use_auth_header
=
False
,
headers
=
[
"
(request-target)
"
,
"
user-agent
"
,
"
host
"
,
"
date
"
],
algorithm
=
"
rsa-sha256
"
,
key
=
private_key
.
encode
(
"
utf-8
"
),
...
...
This diff is collapsed.
Click to expand it.
api/requirements/base.txt
+
3
−
1
View file @
f7b5214f
...
...
@@ -45,7 +45,9 @@ uvicorn[standard]~=0.12.0
gunicorn~=20.0.0
cryptography~=2.9.0
requests-http-signature==0.2.0
# requests-http-signature==0.0.3
# clone until the branch is merged and released upstream
git+https://github.com/agateblue/requests-http-signature.git@signature-header-support
django-cleanup~=5.0.0
requests~=2.24.0
pyOpenSSL~=19.1.0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment