Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
László Vaskó committed Sep 11, 2019
2 parents 47dfa02 + c92edbe commit 1e2f38a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openconnect_sso/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.3.0"
__version__ = "0.3.1"
__description__ = (
"Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication"
)
7 changes: 6 additions & 1 deletion openconnect_sso/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,18 @@ def authenticate_to(host, credentials):


async def run_openconnect(auth_info, host, args):
proc = await asyncio.create_subprocess_exec(
command_line = [
"sudo",
"openconnect",
"--cookie-on-stdin",
"--servercert",
auth_info.server_cert_hash,
*args,
]

logger.debug("Starting OpenConnect", command_line=command_line)
proc = await asyncio.create_subprocess_exec(
*command_line,
host.vpn_url,
stdin=asyncio.subprocess.PIPE,
stdout=None,
Expand Down
8 changes: 8 additions & 0 deletions openconnect_sso/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def create_argparser():
parser.add_argument(
"openconnect_args",
help="Arguments passed to openconnect",
action=StoreOpenConnectArgs,
nargs=argparse.REMAINDER,
)

Expand All @@ -72,6 +73,13 @@ def create_argparser():
return parser


class StoreOpenConnectArgs(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
if "--" in values:
values.remove("--")
setattr(namespace, self.dest, values)


class LogLevel(enum.IntEnum):
ERROR = logging.ERROR
WARNING = logging.WARNING
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openconnect-sso"
version = "0.3.0"
version = "0.3.1"
description = "Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication"
authors = ["László Vaskó <laszlo.vasko@outlook.com>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_openconnect_sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == '0.3.0'
assert __version__ == '0.3.1'

0 comments on commit 1e2f38a

Please sign in to comment.