OpenConext / OpenConext/Monitor-bundle

session_start shouldn't be called in CLI context

Open
#24 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
6
Forks
2
Avg merge
17d 43m
Merged PRs (30d)
1

Description

I ran into an issue with a monitoring tool that checks all the routes. It is failing on the session check because it's calling session_start(), even though that won't work from the CLI.

https://github.com/Pierstoval/SmokeTesting/issues/14

I think better would be to inject the RequestStack and get the session from there, and ignore the test if it fails or isn't available.

I realize that test is specifically about testing the session, and this is an edge case (calling the controller from a service that doesn't have a browser context).

Contributor guide

No contributing guide indexed for this repository

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

Locate the session-check test and its controller or service entry point, then reproduce it in a CLI context. Review how the session is currently obtained and assess using RequestStack instead; done means CLI monitoring no longer calls session_start() and the check is ignored when no session is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.