diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-19 11:41:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-19 12:59:52 +0200 |
commit | f7509cbec875ec4ee3201cce08839f2a02676c1c (patch) | |
tree | 5dbfcff41a175aa7d4b7d396ca90fe26049d0164 /server/initializers/constants.ts | |
parent | 333210d862fdba4bb114b756d4f964789f480196 (diff) | |
download | PeerTube-f7509cbec875ec4ee3201cce08839f2a02676c1c.tar.gz PeerTube-f7509cbec875ec4ee3201cce08839f2a02676c1c.tar.zst PeerTube-f7509cbec875ec4ee3201cce08839f2a02676c1c.zip |
Add HTTP signature check before linked signature
It's faster, and will allow us to use RSA signature 2018 (with upstream
jsonld-signature module) without too much incompatibilities in the
peertube federation
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 1a3b52015..fd2308eb6 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -529,6 +529,12 @@ const ACTIVITY_PUB_ACTOR_TYPES: { [ id: string ]: ActivityPubActorType } = { | |||
529 | APPLICATION: 'Application' | 529 | APPLICATION: 'Application' |
530 | } | 530 | } |
531 | 531 | ||
532 | const HTTP_SIGNATURE = { | ||
533 | HEADER_NAME: 'signature', | ||
534 | ALGORITHM: 'rsa-sha256', | ||
535 | HEADERS_TO_SIGN: [ 'date', 'host', 'digest', '(request-target)' ] | ||
536 | } | ||
537 | |||
532 | // --------------------------------------------------------------------------- | 538 | // --------------------------------------------------------------------------- |
533 | 539 | ||
534 | const PRIVATE_RSA_KEY_SIZE = 2048 | 540 | const PRIVATE_RSA_KEY_SIZE = 2048 |
@@ -728,6 +734,7 @@ export { | |||
728 | VIDEO_EXT_MIMETYPE, | 734 | VIDEO_EXT_MIMETYPE, |
729 | CRAWL_REQUEST_CONCURRENCY, | 735 | CRAWL_REQUEST_CONCURRENCY, |
730 | JOB_COMPLETED_LIFETIME, | 736 | JOB_COMPLETED_LIFETIME, |
737 | HTTP_SIGNATURE, | ||
731 | VIDEO_IMPORT_STATES, | 738 | VIDEO_IMPORT_STATES, |
732 | VIDEO_VIEW_LIFETIME, | 739 | VIDEO_VIEW_LIFETIME, |
733 | buildLanguages | 740 | buildLanguages |