Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Implement Saml integration #21

Merged

Conversation

javierdelapuente
Copy link
Collaborator

@javierdelapuente javierdelapuente commented Jun 6, 2024

Applicable spec: ISD140

Overview

This PR adds Saml support to paas-app-charmer using the saml-integrator charm.

All the following env variables will be available to the paas-app-charmer workload if Saml is integrated correctly with a paas-app-charmer generated project:

SAML_SINGLE_SIGN_ON_REDIRECT_URL
SAML_METADATA_URL
SAML_ENTITY_ID
SAML_SIGNING_CERTIFICATE

These variables contain enough information about the IdP for the SP, so projects (or frameworks) based on libraries like python3-saml and pysaml2 could easily use Saml with those env variables.

An integration test that generates the env variables from the saml-integration has been written. However, no real Saml authentication has been done in this test, as that would introduce extra complexity to the test that will test a Saml library, not the injection of the env variables.

Rationale

Saml is a widely used standard for authentication/authorization, and paas-app-charmer apps can benefit from it.

Juju Events Changes

Module Changes

Library Changes

Checklist

@javierdelapuente javierdelapuente marked this pull request as ready for review June 7, 2024 10:27
@javierdelapuente javierdelapuente requested a review from a team as a code owner June 7, 2024 10:27
arturo-seijas
arturo-seijas previously approved these changes Jun 7, 2024
cbartz
cbartz previously approved these changes Jun 10, 2024
Copy link

@cbartz cbartz left a comment

Choose a reason for hiding this comment

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

LGTM

@javierdelapuente javierdelapuente dismissed stale reviews from cbartz and arturo-seijas via 1412556 June 10, 2024 07:05
Copy link

Test coverage for e0e5f0b

Name                                            Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------------------------------------
paas_app_charmer/__init__.py                       29     14      0      0    52%   13-14, 19-20, 26-27, 33-34, 40-41, 47-48, 54-55
paas_app_charmer/_gunicorn/__init__.py              0      0      0      0   100%
paas_app_charmer/_gunicorn/charm.py               164     25     26      4    84%   32-33, 40-41, 160-161, 163-164, 185->exit, 197-201, 215-217, 284-285, 290, 295, 300, 310, 315, 320, 325, 330, 345
paas_app_charmer/_gunicorn/charm_state.py         103      1     18      1    98%   175
paas_app_charmer/_gunicorn/charm_utils.py          23      0      0      0   100%
paas_app_charmer/_gunicorn/observability.py        13      0      2      0   100%
paas_app_charmer/_gunicorn/secret_storage.py       13      0      0      0   100%
paas_app_charmer/_gunicorn/webserver.py            75      4     14      1    94%   156, 168-174
paas_app_charmer/_gunicorn/workload_config.py      19      0      0      0   100%
paas_app_charmer/_gunicorn/wsgi_app.py             78      0     38      0   100%
paas_app_charmer/database_migration.py             33      0      2      0   100%
paas_app_charmer/databases.py                      25      2     11      1    92%   89-90
paas_app_charmer/django/__init__.py                 1      0      0      0   100%
paas_app_charmer/django/charm.py                   45      6      6      1    86%   73-77, 99, 114-115
paas_app_charmer/exceptions.py                      5      0      0      0   100%
paas_app_charmer/flask/__init__.py                  1      0      0      0   100%
paas_app_charmer/flask/charm.py                    37      0      2      0   100%
paas_app_charmer/secret_storage.py                 39      3     16      5    85%   50, 54->53, 55->57, 85, 104
paas_app_charmer/utils.py                          11      0     12      0   100%
-------------------------------------------------------------------------------------------
TOTAL                                             714     55    147     13    92%

Static code analysis report

Run started:2024-06-10 07:26:52.188597

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 1572
  Total lines skipped (#nosec): 0
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@javierdelapuente javierdelapuente requested a review from cbartz June 10, 2024 07:28
@javierdelapuente javierdelapuente merged commit 304aa40 into main Jun 10, 2024
30 checks passed
@javierdelapuente javierdelapuente deleted the ISD-1984-Implement-SAML-integration-for-Paas-App-Charmer branch June 10, 2024 07:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants