connexion icon indicating copy to clipboard operation
connexion copied to clipboard

Removed internal variable pass_context_arg_name

Open leonardofesta opened this issue 3 years ago • 6 comments

Fixes #1532 .

Changes proposed in this pull request:

  • I removed the parameter pass_context_arg_name passed internally as asked from the various constructors, and left in the SecurityHandlerFactory a constant called context_kw, following the same pattern of required_scopes_kw.

I don't know if it is better to put in uppercase both values (context_kw and required_scopes_kw), now they are constants in the end.

I left as the other one to have consistency, but if you prefer I can change them both.

leonardofesta avatar Jul 21 '22 19:07 leonardofesta

Thanks @leonardofesta! Could you update the failing tests to make them pass?

RobbeSneyders avatar Aug 07 '22 20:08 RobbeSneyders

Hi @leonardofesta, did you have a chance to have another look at this? Let me know if you need support.

RobbeSneyders avatar Aug 23 '22 07:08 RobbeSneyders

Sorry @RobbeSneyders I was on vacation and I didn't saw the emails. Now it should pass all tests.

Should i rebase and force push?

leonardofesta avatar Aug 25 '22 17:08 leonardofesta

Pull Request Test Coverage Report for Build 3108587472

  • 7 of 9 (77.78%) changed or added relevant lines in 3 files are covered.
  • 43 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.09%) to 94.749%

Changes Missing Coverage Covered Lines Changed/Added Lines %
connexion/security/security_handler_factory.py 2 4 50.0%
<!-- Total: 7 9
Files with Coverage Reduction New Missed Lines %
connexion/apps/flask_app.py 1 95.24%
connexion/jsonifier.py 1 92.86%
connexion/middleware/main.py 1 96.43%
connexion/middleware/routing.py 1 96.08%
connexion/operations/openapi.py 1 95.21%
connexion/json_schema.py 2 85.57%
connexion/middleware/swagger_ui.py 3 95.18%
connexion/decorators/validation.py 5 96.41%
connexion/apis/abstract.py 11 90.48%
connexion/middleware/security.py 17 83.66%
<!-- Total: 43
Totals Coverage Status
Change from base Build 2910344107: 0.09%
Covered Lines: 2851
Relevant Lines: 3009

💛 - Coveralls

coveralls avatar Aug 26 '22 09:08 coveralls

Any update @leonardofesta?

RobbeSneyders avatar Sep 20 '22 18:09 RobbeSneyders

Any update @leonardofesta? I just pushed the update, I hope I understood correctly. I'm using context_ as suggested as value, in both cases used as constant.

  • I basically restored the decorator functionality by using a boolean with default == False to maintain the same logic
  • In the security handler part, please recheck but now it should be correct

Let me know

leonardofesta avatar Sep 20 '22 18:09 leonardofesta

Thanks @leonardofesta, looks good to me.

I pushed a change to the test, as it wasn't actually testing the new behavior.

RobbeSneyders avatar Sep 22 '22 20:09 RobbeSneyders