about summary refs log tree commit diff
path: root/arunisaac
diff options
context:
space:
mode:
authorArun Isaac2025-11-29 03:57:48 +0000
committerArun Isaac2025-11-29 03:58:20 +0000
commitb890134c8e999973b26834c9581214c95fe82088 (patch)
tree784b02fa53619b813758e0f114259e49ddcc1ce6 /arunisaac
parente896fce077549bfd85ce3f9c79599010146a6f33 (diff)
downloadguix-arunisaac-b890134c8e999973b26834c9581214c95fe82088.tar.gz
guix-arunisaac-b890134c8e999973b26834c9581214c95fe82088.tar.lz
guix-arunisaac-b890134c8e999973b26834c9581214c95fe82088.zip
Add openconnect-sso. HEAD main
openconnect-sso was removed from Guix upstream.
Diffstat (limited to 'arunisaac')
-rw-r--r--arunisaac/openconnect.scm102
1 files changed, 102 insertions, 0 deletions
diff --git a/arunisaac/openconnect.scm b/arunisaac/openconnect.scm
new file mode 100644
index 0000000..45238e4
--- /dev/null
+++ b/arunisaac/openconnect.scm
@@ -0,0 +1,102 @@
+;;; guix-arunisaac --- arunisaac's Guix odds and ends
+;;; Copyright © 2025 Arun Isaac <arunisaac@systemreboot.net>
+;;;
+;;; This file is part of guix-arunisaac.
+;;;
+;;; guix-arunisaac is free software: you can redistribute it and/or
+;;; modify it under the terms of the GNU General Public License as
+;;; published by the Free Software Foundation, either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; guix-arunisaac is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with guix-arunisaac.  If not, see
+;;; <https://www.gnu.org/licenses/>.
+
+(define-module (arunisaac openconnect)
+  #:use-module ((gnu packages check)
+                #:select (python-pytest python-pytest-asyncio python-pytest-httpserver))
+  #:use-module ((gnu packages freedesktop) #:select (python-pyxdg))
+  #:use-module ((gnu packages python-build)
+                #:select (python-poetry-core python-toml))
+  #:use-module ((gnu packages python-crypto)
+                #:select (python-keyring python-pyotp))
+  #:use-module ((gnu packages python-web) #:select (python-requests))
+  #:use-module ((gnu packages python-xyz)
+                #:select (python-attrs python-colorama
+                          python-prompt-toolkit python-pysocks python-structlog))
+  #:use-module ((gnu packages qt) #:select (python-pyqt-6
+                                            python-pyqtwebengine-6))
+  #:use-module ((gnu packages vpn) #:select (openconnect))
+  #:use-module ((gnu packages xml) #:select (python-lxml-4.9))
+  #:use-module (guix build-system pyproject)
+  #:use-module (guix git-download)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages))
+
+(define-public openconnect-sso
+  (package
+    (name "openconnect-sso")
+    ;; 0.8.0 was released in 2021, the latest update on master HEAD is
+    ;; from 2023.
+    (properties '((commit . "94128073ef49acb3bad84a2ae19fdef926ab7bdf")
+                  (revision . "0")))
+    (version (git-version "0.8.0"
+                          (assoc-ref properties 'revision)
+                          (assoc-ref properties 'commit)))
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/vlaci/openconnect-sso")
+              (commit (assoc-ref properties 'commit))))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32 "08cqd40p9vld1liyl6qrsdrilzc709scyfghfzmmja3m1m7nym94"))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+          (add-after 'unpack 'use-poetry-core
+            (lambda _
+              ;; Patch to use the core poetry API.
+              (substitute* "pyproject.toml"
+                (("poetry.masonry.api")
+                 "poetry.core.masonry.api"))))
+         (add-after 'unpack 'patch-openconnect
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "openconnect_sso/app.py"
+               (("\"openconnect\"")
+                (string-append "\""
+                               (search-input-file inputs "/sbin/openconnect")
+                               "\""))))))))
+    (inputs
+     (list openconnect
+           python-attrs
+           python-colorama
+           python-keyring
+           python-lxml-4.9
+           python-prompt-toolkit
+           python-pyotp
+           python-pyqt-6
+           python-pyqtwebengine-6
+           python-pysocks
+           python-pyxdg
+           python-requests
+           python-structlog
+           python-toml))
+    (native-inputs
+     (list python-poetry-core
+           python-pytest
+           python-pytest-asyncio
+           python-pytest-httpserver))
+    (home-page "https://github.com/vlaci/openconnect-sso")
+    (synopsis "OpenConnect wrapper script supporting Azure AD (SAMLv2)")
+    (description
+     "This package provides a wrapper script for OpenConnect supporting Azure AD
+(SAMLv2) authentication to Cisco SSL-VPNs.")
+    (license license:gpl3)))