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

JWT Cookie Authentication #437

Merged
merged 98 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
8bab455
add jwt support (maybe)
bastihav Aug 24, 2020
14dd3fa
merge user endpoints
bastihav Aug 31, 2020
ab92179
update reverse proxy for cookies
bastihav Sep 2, 2020
3ea935a
add logout
bastihav Sep 2, 2020
795af18
Merge branch 'develop' into feature/jwt
bastihav Sep 2, 2020
f9eda59
change matriculation managemen to work with jwt
bastihav Sep 2, 2020
ac5809f
todo logout
bastihav Sep 2, 2020
a8fa71e
add logout
bastihav Sep 2, 2020
e3b560b
wait so logout is not cancelled
bastihav Sep 2, 2020
9670ab2
load username async from store
bastihav Sep 2, 2020
b567225
re-implement support for login modal
bastihav Sep 7, 2020
1ddfee2
update password changing to work with jwt
bastihav Sep 7, 2020
61feda1
change navbar items to buttons and add optional function prop for logout
bastihav Sep 7, 2020
26aa1b6
change logout function
bastihav Sep 7, 2020
0189f1c
remove default credentials to fix a bug with about page
bastihav Sep 7, 2020
fba31df
add certificate
bastihav Sep 7, 2020
1187d3e
mkdir
bastihav Sep 7, 2020
cdbfc9c
Merge branch 'develop' into feature/jwt
bastihav Sep 7, 2020
100edd5
update package json lock
bastihav Sep 7, 2020
8b58340
Merge branch 'develop' into feature/jwt
bastihav Sep 7, 2020
a2b3130
fix logout
bastihav Sep 7, 2020
c52c40a
add jwt to e2e tests
bastihav Sep 7, 2020
d7711df
add localhost cert that was dropped during merge
bastihav Sep 7, 2020
bccf668
add localhost cert to correct job
bastihav Sep 7, 2020
d47fc36
ask node to kindly ignore self signed certificates for testing
bastihav Sep 7, 2020
739ff57
ignore invalid tls certs
bastihav Sep 7, 2020
4ab1f8f
test
bastihav Sep 7, 2020
bd29656
test
bastihav Sep 7, 2020
1c38d56
try to add certificate to trusted ca store
bastihav Sep 7, 2020
582e1b1
create ca and sign request and trust ca?
bastihav Sep 7, 2020
0fad640
mkdir
bastihav Sep 7, 2020
9c85d38
try to explicitly trust cert using node
bastihav Sep 7, 2020
e2cc25a
change env in workflow
bastihav Sep 7, 2020
6bfdb47
export node env variable to shell
bastihav Sep 7, 2020
0e7f3fb
run tests in unsafe chrome
bastihav Sep 7, 2020
4cd3f15
test with own action
bastihav Sep 8, 2020
92072bb
go back to slow tests
bastihav Sep 8, 2020
fdbcbc1
Update src/api/AuthenticationManagement.ts
bastihav Sep 8, 2020
4a31fdd
Update src/components/account/list/UserRow.vue
bastihav Sep 8, 2020
4426f06
fix login/logout e2e
bastihav Sep 8, 2020
1a58161
Merge remote-tracking branch 'origin/feature/jwt' into feature/jwt
bastihav Sep 8, 2020
ec0983b
only save user if we found one
bastihav Sep 8, 2020
a999c24
Merge branch 'develop' into feature/user_endpoint_merge
bastihav Sep 8, 2020
45e9e7d
Merge branch 'feature/user_endpoint_merge' into feature/jwt
bastihav Sep 8, 2020
36b2854
auto login on every page
bastihav Sep 8, 2020
2faa336
only relogin if not logged in
bastihav Sep 8, 2020
72fe2c2
add logouts to tests
bastihav Sep 8, 2020
6272933
add machine user authentication (first draft) to unit tests
bastihav Sep 14, 2020
3f167de
run tests headless and compress dev server for better performance
bastihav Sep 14, 2020
a93f681
change validation type to new validation error name
bastihav Sep 14, 2020
e73e462
go back to list views to allow for direct navigation to create forms
bastihav Sep 14, 2020
4c2116e
make tests more robust and handle cookies correctly between tests
bastihav Sep 14, 2020
bd90f65
Merge branch 'develop' into feature/jwt
bastihav Sep 14, 2020
9f34448
update admin course management to work with jwt
bastihav Sep 14, 2020
8e49572
delete old files
bastihav Sep 14, 2020
a990844
delete old files
bastihav Sep 14, 2020
9651192
Update src/views/lecturer/EditCreateCourseForm.vue
bastihav Sep 14, 2020
eaa542d
remove unnecessary variable declarations
bastihav Sep 14, 2020
dc2fad2
Merge remote-tracking branch 'origin/feature/jwt' into feature/jwt
bastihav Sep 14, 2020
ada138f
Merge branch 'develop' into feature/jwt
bastihav Sep 14, 2020
d8293ed
cleanup after merge
bastihav Sep 15, 2020
eb6a996
run tests with nginx as reverse proxy
bastihav Sep 15, 2020
40df4a7
fix typo
bastihav Sep 15, 2020
6f8720c
move nginx conf
bastihav Sep 15, 2020
7df5272
forgot mkdir
bastihav Sep 15, 2020
7056eb3
rework docker volumes to mounts
bastihav Sep 15, 2020
7a34200
remove readonly from nginx conf
bastihav Sep 15, 2020
4b5c24e
make paths absolute
bastihav Sep 15, 2020
dc1a814
change mounts to bind
bastihav Sep 15, 2020
31fcdd9
Merge branch 'develop' into feature/jwt
bastihav Sep 15, 2020
74b2542
try again
bastihav Sep 15, 2020
f6186ea
Merge branch 'develop' into feature/jwt
bastihav Sep 15, 2020
4c458e3
only mkdir if it does not exist
bastihav Sep 15, 2020
098bc03
fix typo
bastihav Sep 15, 2020
f01eb9f
change path
bastihav Sep 15, 2020
b98319e
change cypress base url
bastihav Sep 15, 2020
5f1b052
change config to allow for direct navigation
bastihav Sep 15, 2020
58a97a1
try to set node env right before building
bastihav Sep 15, 2020
3ae982f
fix course deletion forwarding
bastihav Sep 15, 2020
3374e1f
fix test
bastihav Sep 16, 2020
e1b9ed2
fix unit tests
bastihav Sep 16, 2020
200e957
randomize student matriculation id
bastihav Sep 16, 2020
d3291d7
fix padding
bastihav Sep 16, 2020
37ec4ec
add rel attribute to all external links on about page
bastihav Sep 18, 2020
527fced
remove variable shadowing
bastihav Sep 18, 2020
9f25785
remove duplicate store definition
bastihav Sep 18, 2020
98b24dc
remove string wrapper object from version calls
bastihav Sep 18, 2020
3ba3941
remove comments
bastihav Sep 18, 2020
189e13e
refactor all api methods to return in promise
bastihav Sep 18, 2020
98f92b7
remove unused imports
bastihav Sep 18, 2020
d8478ea
remove login method and call getRefresh / getLogin token explicitly
bastihav Sep 18, 2020
e4d8fc8
add node env and certs to readme
bastihav Sep 18, 2020
1d07545
run webpack dev server on 443
bastihav Sep 18, 2020
eaada60
fix unit tests
bastihav Sep 21, 2020
2c378ac
use new error types for jwt
bastihav Sep 21, 2020
40ca3dc
fix test
bastihav Sep 22, 2020
76bac76
update changelog, package json and do not run workflow on readme + clg
bastihav Sep 22, 2020
1875649
Merge branch 'develop' into feature/jwt
bastihav Sep 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ CHANGELOG.md
cypress/*
LICENSE
src/assets/*
tests/testOverview.md
tests/testOverview.md
certs/*
47 changes: 40 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Create localhost certificate
run: mkdir certs/ && openssl req -x509 -nodes -days 1024 -newkey rsa:2048 -keyout certs/localhost.key -out certs/localhost.crt -extensions 'v3_req' -subj '/C=DE/ST=NRW/L=Paderborn/CN=localhost'
- name: Use Node.js
uses: actions/setup-node@v1
with:
Expand All @@ -39,7 +41,7 @@ jobs:

- name: Install dependencies
run: npm install

- name: Run unit tests
run: npm run test:unit

Expand All @@ -50,15 +52,46 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Export node conf
run: export NODE_TLS_REJECT_UNAUTHORIZED=0
- name: mkdir
run: mkdir certs/
- name: Create CA certificate
run: openssl req -x509 -newkey rsa:4096 -days 365 -nodes -keyout certs/ca-key.pem -out certs/ca-cert.pem -subj '/C=DE/ST=NRW/L=Paderborn/CN=ca-localhost'
- name: Create certificate request
run: openssl req -newkey rsa:4096 -nodes -keyout certs/server-key.pem -out certs/server-req.pem -subj '/C=DE/ST=NRW/L=Paderborn/CN=localhost'
- name: Sign certificate request
run: openssl x509 -req -in certs/server-req.pem -days 60 -CA certs/ca-cert.pem -CAkey certs/ca-key.pem -CAcreateserial -out certs/server-cert.pem
- name: Trust CA certificate
run: sudo cp certs/ca-cert.pem /usr/local/share/ca-certificates/ && sudo update-ca-certificates

- name: run e2e tests
uses: cypress-io/github-action@v1.16.1

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
config-file: cypress.json
start: npm run serve
wait-on: 'http://localhost:8080'
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install

- name: Start server
run: npm run serve &

- name: Wait for server to start
run: sleep 60

- name: run e2e tests
run: npm run test:e2e:headless
- name: Upload Screenshots
uses: actions/upload-artifact@v1
if: failure()
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ coverage/
# cypress output
cypress/screenshots/
cypress/videos/
cypress/fixtures/
cypress/fixtures/

# localhost tls certificate + key
certs/
2 changes: 1 addition & 1 deletion .jest/env.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
process.env.VUE_APP_API_BASE_URL = "https://uc4.cs.uni-paderborn.de/api/develop";
process.env.VUE_APP_API_BASE_URL = "https://uc4.cs.uni-paderborn.de/api/experimental";
7 changes: 5 additions & 2 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baseUrl": "http://localhost:8080/",
"baseUrl": "https://localhost:8080/",
"defaultCommandTimeout": 8000,
"integrationFolder": "tests/e2e/",
"supportFile": "tests/e2e/support/index.ts",
Expand Down Expand Up @@ -37,6 +37,9 @@
"serverPort": 2121,
"updateSnapshots": false,
"backgroundBlend": "difference"
}
},
"NODE_TLS_REJECT_UNAUTHORIZED": "0",
"NODE_EXTRA_CA_CERTS": "certs/server-cert.pem",
"chromeWebSecurity": false
}
}
154 changes: 0 additions & 154 deletions cypress/integration/navbarMobile.spec.js

This file was deleted.

Loading