-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #700 from neicnordic/merge/sda-auth
[Merge] sda-auth
- Loading branch information
Showing
79 changed files
with
761 additions
and
2,673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
python -m pip install --upgrade pip | ||
pip install tox | ||
|
||
tox -e unit_tests -c /tests/sda/auth/tox.ini | ||
|
||
echo "auth test completes successfully" |
28 changes: 28 additions & 0 deletions
28
.github/integration/tests/sda/auth/integration/test_auth.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import unittest | ||
import requests | ||
|
||
class TestEGAAuth(unittest.TestCase): | ||
"""Testing EgaAuth.""" | ||
|
||
def setUp(self): | ||
"""Initialise authenticator.""" | ||
self.backend_url = "http://auth-cega:8080/ega" | ||
|
||
|
||
def tearDown(self): | ||
"""Finalise test.""" | ||
print("Finishing test") | ||
|
||
|
||
def test_valid_ega_login(self): | ||
"""Test that the login is successful.""" | ||
creds_payload = { "username":'[email protected]', "password":'dummy', "submit": 'log+in' } | ||
login_response = requests.post(self.backend_url, allow_redirects=False, data=creds_payload, cookies=None) | ||
self.assertEqual(login_response.status_code, 200) | ||
|
||
|
||
def test_invalid_ega_login(self): | ||
"""Test that the login is not successful.""" | ||
creds_payload = { "username":'[email protected]', "password":'wrongpassword', "submit": 'log+in' } | ||
login_response = requests.post(self.backend_url, allow_redirects=False, data=creds_payload, cookies=None) | ||
self.assertEqual(login_response.status_code, 303) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,29 +8,6 @@ on: | |
- '**/go.*' | ||
|
||
jobs: | ||
lint_auth: | ||
name: Lint auth code | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: ['1.21'] | ||
steps: | ||
- name: Set up Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
args: -E bodyclose,gocritic,gofmt,gosec,govet,nestif,nlreturn,revive,rowserrcheck --timeout 5m | ||
working-directory: sda-auth | ||
|
||
lint_download: | ||
name: Lint download code | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.