OpenConext / OpenConext/Stepup-Gateway
When the Spryng credentials in gateway are wrong, an uncaught exception is thrown
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 6
- Forks
- 3
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 10
Description
This issue is imported from pivotal - Originaly created at May 27, 2024 by Paul Rijke
Whe the credentials aren;t okay for the Spryng gateway, the SmsController fails with an:
{"channel":"request","level":"CRITICAL","message":"Uncaught PHP Exception ErrorException: \"Warning: Illegal string offset \'description\'\" at /var/www/html/src/Surfnet/StepupGateway/ApiBundle/Controller/SmsController.php line 51","context":{"exception":{"class":"ErrorException","message":"Warning: Illegal string offset \'description\'","code":0,"file":"/var/www/html/src/Surfnet/StepupGateway/ApiBundle/Controller/SmsController.php:51"}},"extra":{"art":"37995","server":"gateway.dev.openconext.local","application":"stepup-gateway","request_id":"706ed6fb0d4e2c89baf7ace43572bcf6"}}
debugging of the result gave this result dump
^ Surfnet\StepupGateway\ApiBundle\Sms\SpryngMessageResult {#623 ▼
-message: Spryng\SpryngRestApi\Http\Response {#621 ▼
#curlInstance: curl resource @20 ▶}
#rawResponse: """
HTTP/2 401
date: Mon, 27 May 2024 13:45:36 GMT
content-type: application/json
server: Apache
cache-control: no-cache, private
access-control-allow-origin: *
access-control-expose-headers: *
strict-transport-security: max-age=31536000;
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
referrer-policy: no-referrer
vary: Authorization
x-robots-tag: none
{"error":"Unauthenticated."}
"""
#rawBody: "{"error":"Unauthenticated."}"
#responseCode: 401
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Surfnet/StepupGateway/ApiBundle/Controller/SmsController.php at line 51 and inspect how the SpryngMessageResult handles the 401 response. Reproduce the failure with invalid Spryng credentials and trace the response body containing "Unauthenticated." Done means the controller no longer throws an uncaught illegal string offset exception for this response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100