Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uffd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luca (strifel)
uffd
Commits
9806d8e1
Commit
9806d8e1
authored
3 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Add CI tests for Bullseye and fix remaining compatability issues
parent
482727be
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+65
-4
65 additions, 4 deletions
.gitlab-ci.yml
tests/test_oauth2.py
+1
-1
1 addition, 1 deletion
tests/test_oauth2.py
uffd/mfa/views.py
+1
-0
1 addition, 0 deletions
uffd/mfa/views.py
with
67 additions
and
5 deletions
.gitlab-ci.yml
+
65
−
4
View file @
9806d8e1
...
...
@@ -44,7 +44,8 @@ db_migrations_updated:
-
FLASK_APP=uffd flask db upgrade
-
FLASK_APP=uffd flask db migrate 2>&1 | grep -q 'No changes in schema detected'
linter
:
linter:buster
:
image
:
registry.git.cccv.de/uffd/docker-images/buster
stage
:
test
script
:
-
pip3 install pylint-gitlab pylint-flask-sqlalchemy
# this force-updates jinja2 and some other packages!
...
...
@@ -58,7 +59,24 @@ linter:
reports
:
codequality
:
codeclimate.json
unittests
:
linter:bullseye
:
image
:
registry.git.cccv.de/uffd/docker-images/bullseye
stage
:
test
script
:
-
pip3 install pylint-gitlab pylint-flask-sqlalchemy
# this force-updates jinja2 and some other packages!
-
python3 -m pylint --exit-zero --rcfile .pylintrc --output-format=pylint_gitlab.GitlabCodeClimateReporter uffd > codeclimate.json
-
python3 -m pylint --exit-zero --rcfile .pylintrc --output-format=pylint_gitlab.GitlabPagesHtmlReporter uffd > pylint.html
-
python3 -m pylint --rcfile .pylintrc --output-format=text uffd
artifacts
:
when
:
always
paths
:
-
pylint.html
reports
:
codequality
:
codeclimate.json
unittests:buster
:
image
:
registry.git.cccv.de/uffd/docker-images/buster
stage
:
test
script
:
-
service slapd start
...
...
@@ -77,6 +95,26 @@ unittests:
junit
:
report.xml
coverage
:
'
/^TOTAL.*\s+(\d+\%)$/'
unittests:bullseye
:
image
:
registry.git.cccv.de/uffd/docker-images/bullseye
stage
:
test
script
:
-
service slapd start
-
UNITTEST_OPENLDAP=1 python3-coverage run --include 'uffd/*.py' -m pytest --junitxml=report.xml ||
true
#- python3-coverage report -m
-
python3-coverage html
#- python3-coverage xml
artifacts
:
when
:
always
paths
:
-
htmlcov/index.html
-
htmlcov
expose_as
:
'
Coverage
Report'
reports
:
#cobertura: coverage.xml
junit
:
report.xml
#coverage: '/^TOTAL.*\s+(\d+\%)$/'
html5validator
:
stage
:
test
script
:
...
...
@@ -103,14 +141,37 @@ trans_de:
variables
:
TRANSLATION_LANGUAGE
:
de
test:package:pip
:
test:package:pip:buster
:
image
:
registry.git.cccv.de/uffd/docker-images/buster
stage
:
test
script
:
-
pip3 install dist/*.tar.gz
dependencies
:
-
build:pip
test:package:pip:bullseye
:
image
:
registry.git.cccv.de/uffd/docker-images/bullseye
stage
:
test
script
:
-
pip3 install dist/*.tar.gz
dependencies
:
-
build:pip
test:package:apt
:
test:package:apt:buster
:
image
:
registry.git.cccv.de/uffd/docker-images/buster
stage
:
test
script
:
-
apt -y install ./build/*.deb
-
service uwsgi start uffd || ( service uwsgi status uffd ; sleep 15; cat /var/log/uwsgi/app/uffd.log; )
-
echo "server { listen 127.0.0.1:5000 default_server; include /etc/uffd/nginx.include.conf; }" > /etc/nginx/sites-enabled/uffd.ini
-
service nginx start || ( service nginx status; nginx -t; exit 1; )
-
uffd-admin routes
-
curl -Lv 127.0.0.1:5000
dependencies
:
-
build:apt
test:package:apt:bullseye
:
image
:
registry.git.cccv.de/uffd/docker-images/bullseye
stage
:
test
script
:
-
apt -y install ./build/*.deb
...
...
This diff is collapsed.
Click to expand it.
tests/test_oauth2.py
+
1
−
1
View file @
9806d8e1
...
...
@@ -169,7 +169,7 @@ class TestViews(UffdTestCase):
def
test_token_invalid_code
(
self
):
r
=
self
.
client
.
post
(
path
=
url_for
(
'
oauth2.token
'
),
data
=
{
'
grant_type
'
:
'
authorization_code
'
,
'
code
'
:
'
abcdef
'
,
'
redirect_uri
'
:
'
http://localhost:5009/callback
'
,
'
client_id
'
:
'
test
'
,
'
client_secret
'
:
'
testsecret
'
},
follow_redirects
=
True
)
self
.
assert
Equal
(
r
.
status_code
,
401
)
self
.
assert
In
(
r
.
status_code
,
[
400
,
401
])
# oauthlib behaviour changed between v2.1.0 and v3.1.0
self
.
assertEqual
(
r
.
content_type
,
'
application/json
'
)
def
test_token_invalid_client
(
self
):
...
...
This diff is collapsed.
Click to expand it.
uffd/mfa/views.py
+
1
−
0
View file @
9806d8e1
...
...
@@ -111,6 +111,7 @@ try:
from
fido2.server
import
Fido2Server
,
RelyingParty
as
PublicKeyCredentialRpEntity
from
fido2.ctap2
import
AttestationObject
,
AuthenticatorData
from
fido2
import
cbor
# pylint: disable=no-member
cbor
.
encode
=
cbor
.
dumps
cbor
.
decode
=
lambda
arg
:
cbor
.
loads
(
arg
)[
0
]
elif
fido2
.
__version__
.
startswith
(
'
0.9.
'
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment