blob: 897345acdf4202ad13cbf279ba5fa02cf96c9613 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
;;; guix-arunisaac --- arunisaac's Guix odds and ends
;;; Copyright © 2025, 2026 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 shared-mime-info))
#:use-module ((gnu packages gnome) #:select (hicolor-icon-theme))
#:use-module ((gnu packages python-build)
#:select (python-colorama
python-jaraco-classes
python-poetry-core
python-setuptools
python-setuptools-scm
python-toml
python-wheel))
#:use-module ((gnu packages python-crypto)
#:select (python-keyring
python-pyotp
python-secretstorage))
#:use-module ((gnu packages python-web)
#:select (python-requests
python-urllib3))
#:use-module ((gnu packages python-xyz)
#:select (python-attrs
python-charset-normalizer
python-prompt-toolkit
python-pysocks
python-structlog))
#:use-module ((gnu packages qt) #:select (python-pyqt
python-pyqtwebengine
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 build-system python) #:hide (pypi-uri))
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils))
(define python-keyring-23.9
(package
(inherit python-keyring)
(version "23.9.3")
(source (origin
(method url-fetch)
(uri (pypi-uri "keyring" version))
(sha256
(base32
"19f4jpsxng9sjfqi8ww5hgg196r2zh1zb8g71wjr1xa27kc1vc39"))))
(arguments
(list #:tests? #f))
(native-inputs
(list python-toml
python-pytest
python-setuptools
python-setuptools-scm
python-wheel))
(propagated-inputs
(list python-jaraco-classes
python-secretstorage))))
(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-23.9
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)))
(define python-charset-normalizer-2.10
(package
(inherit python-charset-normalizer)
(version "2.1.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "charset-normalizer" version))
(sha256
(base32 "04zlajr77f6c7ai59l46as1idi0jjgbvj72lh4v5wfpz2s070pjp"))))
(build-system python-build-system)
(arguments (list #:tests? #f))))
(define python-urllib3-1.26
(package
(inherit python-urllib3)
(version "1.26.15")
(source
(origin
(method url-fetch)
(uri (pypi-uri "urllib3" version))
(sha256
(base32
"01dkqv0rsjqyw4wrp6yj8h3bcnl7c678qkj845596vs7p4bqff4a"))))
(build-system python-build-system)))
(define python-requests-2.28
(package
(inherit python-requests)
(name "python-requests")
(version "2.28.1")
(source (origin
(method url-fetch)
(uri (pypi-uri "requests" version))
(sha256
(base32
"10vrr7bijzrypvms3g2sgz8vya7f9ymmcv423ikampgy0aqrjmbw"))))
(build-system python-build-system)
(arguments (list #:tests? #f))
(native-inputs
(modify-inputs (package-native-inputs python-requests)
(delete "python-pytest" "python-pytest-mock")))
(propagated-inputs
(modify-inputs (package-propagated-inputs python-requests)
(replace "python-charset-normalizer" python-charset-normalizer-2.10)
(replace "python-urllib3" python-urllib3-1.26)))))
;; Login to the UTHSC VPN fails with an SSLV3_ALERT_HANDSHAKE_FAILURE on newer
;; python-requests.
(define-public openconnect-sso-uthsc
(package
(inherit openconnect-sso)
(name "openconnect-sso-uthsc")
(inputs
(modify-inputs (package-inputs openconnect-sso)
(replace "python-requests" python-requests-2.28)))))
(define python-pyxdg-0.27
(package
(inherit python-pyxdg)
(version "0.27")
(source (origin
(method url-fetch)
(uri (pypi-uri "pyxdg" version))
(sha256
(base32
"19f5j5mxp7ff0vp33s32qbpdi65iiwha0bj641gl70pdwnm97gc0"))))
(build-system python-build-system)
(arguments
(list #:tests? #f))
(native-inputs
(list shared-mime-info
hicolor-icon-theme
python-setuptools))))
;; This is a fork of openconnect-sso that works with the UCL VPN. We
;; use this until similar support is added to openconnect-sso
;; upstream.
(define openconnect-sso-ucl
(package
(inherit openconnect-sso)
(name "openconnect-sso-ucl")
(version "1.0.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/Beej126/openconnect-sso-windows-csd")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"1gzpx14ks800kdljvivp43ybj89dqbnsq0naj33s7f54byih5v0c"))))
(arguments
(substitute-keyword-arguments (package-arguments openconnect-sso)
((#:phases phases #~%standard-phases)
#~(modify-phases #$phases
;; Patch in fictitious host scan data to satisfy the VPN
;; authenticator.
(add-after 'unpack 'patch-in-hostscan-data
(lambda _
(substitute* "openconnect_sso/authenticator.py"
(("hostscan-data")
#$(local-file "ucl-vpn-hostscan-data")))))))))
(inputs
(modify-inputs (package-inputs openconnect-sso)
(replace "python-pyqt" python-pyqt)
(replace "python-pyqtwebengine" python-pyqtwebengine)
(replace "python-pyxdg" python-pyxdg-0.27)))))
|