Skip to content

feat(raf-993): signing of open payments http payload. #3407

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

koekiebox
Copy link
Collaborator

Changes proposed in this pull request

Context

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Make sure that all checks pass
  • Bruno collection updated (if necessary)
  • Documentation issue created with user-docs label (if necessary)
  • OpenAPI specs updated (if necessary)

@koekiebox koekiebox self-assigned this Apr 22, 2025
@github-actions github-actions bot added the type: tests Testing related label Apr 22, 2025
Copy link

netlify bot commented Apr 22, 2025

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit 5cffe10
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/68172b93844f0500080127a2

Copy link

github-actions bot commented Apr 22, 2025

🚀 Performance Test Results

Test Configuration:

  • VUs: 4
  • Duration: 1m0s

Test Metrics:

  • Requests/s: 46.73
  • Iterations/s: 15.60
  • Failed Requests: 0.00% (0 of 2812)
📜 Logs

> performance@1.0.0 run-tests:testenv /home/runner/work/rafiki/rafiki/test/performance
> ./scripts/run-tests.sh -e test "-k" "-q" "--vus" "4" "--duration" "1m"

Cloud Nine GraphQL API is up: http://localhost:3101/graphql
Cloud Nine Wallet Address is up: http://localhost:3100/
Happy Life Bank Address is up: http://localhost:4100/
cloud-nine-wallet-test-backend already set
cloud-nine-wallet-test-auth already set
happy-life-bank-test-backend already set
happy-life-bank-test-auth already set
     data_received..................: 981 kB 16 kB/s
     data_sent......................: 2.0 MB 34 kB/s
     http_req_blocked...............: avg=5.71µs   min=1.86µs  med=4.87µs   max=535.61µs p(90)=5.92µs   p(95)=6.37µs  
     http_req_connecting............: avg=226ns    min=0s      med=0s       max=156.3µs  p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=84.98ms  min=8.69ms  med=71.17ms  max=543.43ms p(90)=145.76ms p(95)=168.58ms
       { expected_response:true }...: avg=84.98ms  min=8.69ms  med=71.17ms  max=543.43ms p(90)=145.76ms p(95)=168.58ms
     http_req_failed................: 0.00%  ✓ 0         ✗ 2812
     http_req_receiving.............: avg=73.58µs  min=25.06µs med=68.4µs   max=1.39ms   p(90)=98.56µs  p(95)=120µs   
     http_req_sending...............: avg=32.4µs   min=7.8µs   med=24.83µs  max=3.66ms   p(90)=37.4µs   p(95)=49.77µs 
     http_req_tls_handshaking.......: avg=0s       min=0s      med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=84.87ms  min=8.57ms  med=70.98ms  max=539.71ms p(90)=145.63ms p(95)=168.49ms
     http_reqs......................: 2812   46.725538/s
     iteration_duration.............: avg=256.02ms min=154.6ms med=246.03ms max=1.06s    p(90)=317.39ms p(95)=346.15ms
     iterations.....................: 939    15.602873/s
     vus............................: 4      min=4       max=4 
     vus_max........................: 4      min=4       max=4 

Comment on lines 84 to 116
app.post('/http-signature-verify', async function handler(ffReq, ffReply) {
const requestBody = JSON.parse(JSON.stringify(ffReq.body))
if (!validateBodyVerifySignature(requestBody as RequestBodySignatureVerify)) {
return {
statusCode: '400',
body: 'Insufficient data in request body'
}
}
const { method, url, headers, body } = requestBody

if (!headers['signature'] || !headers['signature-input']) {
return {
statusCode: '400',
body: '[signature-input] and/or [signature] headers are missing'
}
}

if (!validateSignatureHeaders({
method,
url,
headers,
body
})) {
return {
statusCode: '401',
body: 'Signature verification failed'
}
}

ffReply.code(200).send({
signatureVerified: true
})
})

Check failure

Code scanning / CodeQL

Missing rate limiting High test

This route handler performs
authorization
, but is not rate-limited.

Copilot Autofix

AI 6 days ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant