1
1
# uw-saml
2
2
3
- [ ![ Build Status] ( https://travis-ci.org/UWIT-IAM/uw-saml-python.svg?branch=master )] ( https://travis-ci.org/UWIT-IAM/uw-saml-python )
4
- [ ![ Coverage Status] ( https://coveralls.io/repos/github/UWIT-IAM/uw-saml-python/badge.svg?branch=master )] ( https://coveralls.io/github/UWIT-IAM/uw-saml-python?branch=master )
5
-
6
3
A UW-specific adapter to the
7
4
[ python3-saml] ( https://github.com/onelogin/python3-saml ) package. This package
8
5
was built to federate with other IdPs, but the default case is to use the UW
@@ -22,6 +19,18 @@ library. Therefore, it's an optional requirement, causing a runtime error
22
19
instead of an install-time error. Alternatively, you can use a mock
23
20
interface by setting ` uw_saml2.python3_saml.MOCK = True ` .
24
21
22
+ If you are able to run your app as a Docker container, you can base your image on
23
+ [ ghcr.io/uwit-iam/uw-saml-poetry: latest ] ( https://ghcr.io/uwit-iam/uw-saml-poetry:latest )
24
+ which comes with all dependencies pre-installed. Here is an example. Note that you
25
+ don't have to use poetry in your install process to use this image.
26
+
27
+ ```
28
+ FROM ghcr.io/uwit-iam/uw-saml-poetry:latest AS dependencies
29
+ RUN pip install flask uw-saml # uw-saml and python3-saml are already installed!
30
+ COPY app.py ./
31
+ CMD flask run app
32
+ ```
33
+
25
34
## Example login endpoint using flask
26
35
27
36
In this example you've gone to
@@ -35,6 +44,8 @@ Response.
35
44
from flask import request, session, redirect
36
45
import uw_saml2
37
46
47
+ app = Flask(__name__ )
48
+
38
49
@app.route (' /saml/login' , methods = [' GET' , ' POST' ])
39
50
def login ():
40
51
session.clear()
@@ -88,3 +99,44 @@ uw_saml2.auth.CACHE = werkzeug.contrib.cache.RedisCache()
88
99
```
89
100
90
101
Django's cache backend uses the same methods so that could be injected as well.
102
+
103
+ # Developers
104
+
105
+ ## Maintenance
106
+
107
+ People who are developing this package should have either [ poetry] or a docker daemon
108
+ installed. This is so that you can run validations before pushing your code.
109
+
110
+ ### Using docker (recommended)
111
+
112
+ This is recommended because this is the script the CI pipeline uses,
113
+ so if this works for you, it ought to work in the pipeline, too!
114
+
115
+ ```
116
+ ./scripts/pre-push.sh
117
+ ```
118
+
119
+ ### Using poetry
120
+
121
+ Running directly is helpful when you want to attach debuggers, etc.
122
+
123
+ ```
124
+ poetry install
125
+ poetry run pytest
126
+ poetry run black uw_saml2 tests
127
+ ```
128
+
129
+
130
+ ## Pull Requests
131
+
132
+ When creating a pull request for this repository, a ` semver-guidance ` label must be
133
+ applied to the PR. If you do not have write access, a reviewer must do this for
134
+ you.
135
+
136
+ Use the following guidelines to select a version level for your change:
137
+
138
+ - ` no-bump ` if the change is only for documentation, CI workflow, etc.
139
+ - ` patch ` if the change is a simple update or bugfix (e.g., idp metadata update,
140
+ certificate renewal, etc.), or if dependencies are updated (` poetry.lock ` changes)
141
+ - ` minor ` if new features are added or deprecated but the change is backwards-compatible
142
+ - ` major ` if the change is not backwards compatible and will break consumers
0 commit comments