-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
187 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[run] | ||
branch = True | ||
parallel = True | ||
|
||
source = | ||
openconnect_sso |
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 |
---|---|---|
|
@@ -17,6 +17,7 @@ eggs/ | |
lib/ | ||
lib64/ | ||
parts/ | ||
pip-wheel-metadata/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
|
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__version__ = "0.3.3" | ||
__version__ = "0.3.4" | ||
__description__ = "Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "openconnect-sso" | ||
version = "0.3.3" | ||
version = "0.3.4" | ||
description = "Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs" | ||
authors = ["László Vaskó <[email protected]>"] | ||
readme = "README.md" | ||
|
@@ -31,8 +31,12 @@ structlog = "^19.1" | |
toml = "^0.10" | ||
|
||
[tool.poetry.dev-dependencies] | ||
coverage_enable_subprocess = "^1.0" | ||
pytest = "^3.0" | ||
black = "=19.3b0" | ||
pytest-asyncio = "^0.10.0" | ||
pytest-cov = "^2.7" | ||
pytest-httpserver = "^0.3.4" | ||
reno = "^2.11" | ||
|
||
[build-system] | ||
|
15 changes: 15 additions & 0 deletions
15
releasenotes/notes/browser-stop-if-invalid-creds-6d7031efa2fa691a.yaml
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,15 @@ | ||
--- | ||
prelude: > | ||
It is strongly suggested to remove the ``[auto_fill_rules]`` section from | ||
the configuration file or delete the entire file located at | ||
``$XDG_CONFIG_HOME/openconnect-sso/config.toml`` (most probably | ||
``~/.config/openconnect-sso/config.toml``). The fix of #4 involves an update | ||
of the auto-fill rules but unfortulately they are persisted when the | ||
application is first started. Removing them from the configuration forces | ||
the updated set of rules to be written in the configuration. | ||
fixes: | ||
- | | ||
The embedded browser will now stop and waits for user input when the | ||
previously stored credentials are invalid. This still not the proper | ||
solution as saved credentials are not updated in that case but at least the | ||
infinite login loop is circumvenied. |
2 changes: 1 addition & 1 deletion
2
releasenotes/notes/python-3.6_compatibility-3c6eeb53de22ab20.yaml
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
fixes: | ||
- | | ||
Python 3.6 compatibilty has been fixedhowever The problem was caused by the | ||
Python 3.6 compatibilty has been fixed. The problem was caused by the | ||
usage of ``asyncio.create_task(coro)``. Its usage was replaced with | ||
``asyncio.ensure_future(core)``. |
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,5 @@ | ||
--- | ||
fixes: | ||
- | | ||
A potential crash upon closing the browser window is fixed. The issue was | ||
caused by the mismatch between Python's and Qt's memory management model. |
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,3 @@ | ||
import os | ||
|
||
os.environ["COVERAGE_PROCESS_START"] = ".coveragerc" |
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,43 @@ | ||
import attr | ||
import pytest | ||
|
||
from openconnect_sso.browser import Browser | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_browser_context_manager_should_work_in_empty_context_manager(): | ||
async with Browser() as browser: | ||
pass | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_browser_reports_loaded_url(httpserver): | ||
async with Browser() as browser: | ||
auth_url = httpserver.url_for("/authenticate") | ||
|
||
await browser.authenticate_at(auth_url, credentials=None) | ||
|
||
assert browser.url is None | ||
await browser.page_loaded() | ||
assert browser.url == auth_url | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_browser_cookies_accessible(httpserver): | ||
async with Browser() as browser: | ||
httpserver.expect_request("/authenticate").respond_with_data( | ||
"<html><body>Hello</body></html>", | ||
headers={"Set-Cookie": "cookie-name=cookie-value"}, | ||
) | ||
auth_url = httpserver.url_for("/authenticate") | ||
cred = Credentials("username", "password") | ||
|
||
await browser.authenticate_at(auth_url, cred) | ||
await browser.page_loaded() | ||
assert browser.cookies == {"cookie-name": "cookie-value"} | ||
|
||
|
||
@attr.s | ||
class Credentials: | ||
username = attr.ib() | ||
password = attr.ib() |
This file was deleted.
Oops, something went wrong.