Skip to content
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

Settings #723

Merged
merged 9 commits into from
Mar 4, 2020
Merged

Settings #723

merged 9 commits into from
Mar 4, 2020

Conversation

tpazderka
Copy link
Collaborator

  • Any changes relevant to users are recorded in the CHANGELOG.md.
  • The documentation has been updated, if necessary.
  • New code is annotated.
  • Changes are covered by tests.

Basic idea of settings. Mostly as a proof of concept and for design review.

This attempts to fix several issues regarding documentation (autodoc), too complex init methods and inconsistent settings..

The classes are not complete (they miss any sort of loading from files).

Also the conversion is not finished.

Control TLS server certificate validation.
If set to True the certificate is validated against the global settings,
if set to False, no validation is performed.
If set to a filename his is used as a certificate bundle in openssl format.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

his => this

Copy link
Collaborator

@schlenk schlenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general idea is sound. We have way to many constructor options all over the place.

@tpazderka
Copy link
Collaborator Author

Thanks for the feedback. Will work on this a little bit more to propagate the settings to all necessary classes. We can then expand their content.

@tpazderka
Copy link
Collaborator Author

Thanks, will work on this more during the week to get the basic structure.

@codecov-io
Copy link

codecov-io commented Dec 6, 2019

Codecov Report

Merging #723 into master will decrease coverage by 0.19%.
The diff coverage is 46.2%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #723     +/-   ##
=========================================
- Coverage   63.88%   63.69%   -0.2%     
=========================================
  Files          64       64             
  Lines       11692    11826    +134     
  Branches     2062     2091     +29     
=========================================
+ Hits         7470     7533     +63     
- Misses       3652     3697     +45     
- Partials      570      596     +26
Impacted Files Coverage Δ
src/oic/oic/__init__.py 65.61% <25%> (-0.79%) ⬇️
src/oic/oauth2/__init__.py 69.45% <30.76%> (-1.72%) ⬇️
src/oic/oauth2/consumer.py 77.97% <30.76%> (-4.08%) ⬇️
src/oic/oauth2/base.py 56.33% <33.33%> (-6.38%) ⬇️
src/oic/oic/provider.py 74.19% <45.45%> (-0.27%) ⬇️
src/oic/oauth2/provider.py 70.78% <46.15%> (-0.43%) ⬇️
src/oic/extension/client.py 39.04% <50%> (+0.46%) ⬆️
src/oic/oic/claims_provider.py 79.31% <53.84%> (-3.55%) ⬇️
src/oic/utils/settings.py 86.2% <85.71%> (+86.2%) ⬆️
src/oic/utils/http_util.py 69.82% <0%> (+0.57%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d28a6a...00a6af9. Read the comment docs.

@tpazderka
Copy link
Collaborator Author

I think that the basic design of code is done. I will investigate the failure of integration tests, but the code/documentation is probably ready for review.

I am not sure about the type checking in __setitem__. If we drop 3.5, we could use pydantic for the same effect. But 3.5 still has support... :(

I would like to add some loading methods and other settings in separate issues.

@tpazderka
Copy link
Collaborator Author

OK, test are fixed. I am going to ignore codacy errors as they are mostly false positives.

@tpazderka
Copy link
Collaborator Author

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 2
           

Complexity increasing per file
==============================
- src/oic/oic/claims_provider.py  1
- src/oic/oauth2/consumer.py  1
- src/oic/utils/settings.py  5
         

Clones added
============
- src/oic/oauth2/base.py  2
- src/oic/oauth2/__init__.py  5
- src/oic/oic/__init__.py  4
- src/oic/oic/provider.py  2
- src/oic/oauth2/provider.py  2
         

See the complete overview on Codacy

Copy link
Collaborator

@schlenk schlenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@tpazderka tpazderka merged commit f55b996 into master Mar 4, 2020
@tpazderka tpazderka deleted the settings branch March 4, 2020 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants