projects/guix·blob javascript-team · refs

242 lines · 9.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice <[email protected]>
3;;; Copyright © 2019, 2020, 2022 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2020 B. Wilson <[email protected]>
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages authentication)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages autotools)
24 #:use-module (gnu packages documentation)
25 #:use-module (gnu packages gnupg)
26 #:use-module (gnu packages golang)
27 #:use-module (gnu packages golang-build)
28 #:use-module (gnu packages golang-web)
29 #:use-module (gnu packages golang-xyz)
30 #:use-module (gnu packages linux)
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages security-token)
33 #:use-module (gnu packages tls)
34 #:use-module (gnu packages xml)
35 #:use-module (guix build-system cmake)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system go)
38 #:use-module (guix download)
39 #:use-module (guix gexp)
40 #:use-module (guix git-download)
41 #:use-module ((guix licenses) #:prefix license:)
42 #:use-module (guix packages))
43
44(define-public libcotp
45 (package
46 (name "libcotp")
47 (version "4.0.0")
48 (source
49 (origin
50 (method git-fetch)
51 (uri (git-reference
52 (url "https://github.com/paolostivanin/libcotp")
53 (commit (string-append "v" version))))
54 (file-name (git-file-name name version))
55 (sha256
56 (base32 "0p5z04klbb3p9ljkz6qmdb4fk9sx79yv7zcac005c0zk875pz1py"))))
57 (build-system cmake-build-system)
58 (arguments `(#:tests? #f))
59 ;; TODO: tests:
60 ;; Tests can be built with -DBUILD_TESTS=on.
61 ;; Tests don't have a general `check` target so they have to be run manually.
62 ;; Tests require `criterion`, which is not included in guix and has several
63 ;; bundled dependencies.
64 (inputs (list libgcrypt))
65 (native-inputs (list pkg-config))
66 (home-page "https://github.com/paolostivanin/libcotp")
67 (synopsis "One-Time Passwords")
68 (description "This package provides a library to generate
69@acronym{HOTP, HMAC-base One-Time Password}s as specified in RFC 4226 and
70@acronym{TOTP, Time-based One-Time Password}s as specified in RFC 6238.")
71 (license license:asl2.0)))
72
73(define-public oath-toolkit
74 (package
75 (name "oath-toolkit")
76 (version "2.6.11")
77 (source
78 (origin
79 (method url-fetch)
80 (uri (string-append "https://download.savannah.nongnu.org/releases/"
81 name "/" name "-" version ".tar.gz"))
82 (sha256
83 (base32 "1d1c3r1jhd72l5ppsfa9wvvm8kffzs4k2v2qn0xc9x26bd52llgw"))))
84 (build-system gnu-build-system)
85 (arguments
86 ;; TODO ‘--enable-pskc’ causes xmlsec-related test suite failures.
87 `(#:configure-flags
88 (list "--enable-pam"
89 "--enable-pskc"
90 "--with-xmlsec-crypto-engine=openssl")
91 #:phases
92 (modify-phases %standard-phases
93 (add-after 'install 'delete-static-libraries
94 (lambda* (#:key outputs #:allow-other-keys)
95 (let* ((out (assoc-ref outputs "out"))
96 (lib (string-append out "/lib")))
97 (for-each delete-file (find-files lib "\\.a$"))))))))
98 (native-inputs
99 (list pkg-config
100 ;; XXX: Perhaps this should be propagated from xmlsec.
101 libltdl))
102 (inputs
103 (list linux-pam openssl xmlsec-openssl))
104 (home-page "https://www.nongnu.org/oath-toolkit/")
105 (synopsis "@acronym{OTP, one-time password} components")
106 (description
107 "The @acronym{OATH, Open AuTHentication} Toolkit provides various
108components for building @acronym{OTP, One-Time Password} authentication systems:
109
110@itemize
111@item @command{oathtool}, a command-line tool for generating & validating OTPs.
112@item @code{liboath}, a C library for OATH handling.
113@item @command{pskctool}, a command-line tool for manipulating secret key
114files in the @acronym{PSKC, Portable Symmetric Key Container} format
115described in RFC6030.
116@item @code{libpskc}, a shared and static C library for PSKC handling.
117@item @code{pam_oath}, a PAM module for pluggable login authentication.
118@end itemize
119
120Supported technologies include the event-based @acronym{HOTP, Hash-based Message
121Authentication Code One-Time Password} algorithm (RFC4226), the time-based
122@acronym{TOTP, Time-based One-Time Password} algorithm (RFC6238), and
123PSKC (RFC6030) to manage secret key data.")
124 (license (list license:lgpl2.1+ ; the libraries (liboath/ & libpskc/)
125 license:gpl3+)))) ; the tools (everything else)
126
127(define-public oauth2l
128 (package
129 (name "oauth2l")
130 (version "1.3.3")
131 (source
132 (origin
133 (method git-fetch)
134 (uri (git-reference
135 (url "https://github.com/google/oauth2l")
136 (commit (string-append "v" version))))
137 (file-name (git-file-name name version))
138 (sha256
139 (base32 "0qpgbbyjvvdw944d7ppa9ccmcp0gyyc9ik0bhq8agsia40biagwc"))
140 (snippet
141 #~(begin (use-modules (guix build utils))
142 (delete-file-recursively "vendor")))))
143 (build-system go-build-system)
144 (arguments
145 (list
146 #:install-source? #f
147 #:import-path "github.com/google/oauth2l"
148 #:test-flags
149 #~(list "-skip"
150 ;; Tests requiring network access.
151 (string-join
152 (list "Test2LOFlow/curl._2lo"
153 "Test3LOFlow/curl._3lo"
154 "Test3LOFlow/fetch._3lo_cached"
155 "Test3LOFlow/fetch._3lo_insert_expired_token_into_cache"
156 "Test3LOLoopbackFlow/curl._3lo_loopback"
157 "Test3LOLoopbackFlow/fetch._3lo_loopback_cached"
158 "Test3LOLoopbackFlow/fetch._3lo_loopback_insert_expired_token_into_cache"
159 "TestCLI/info._invalid_token"
160 "TestSSOFlow/fetch._sso"
161 "TestSSOFlow/fetch._sso._old_interface"
162 "TestServiceAccountImpersonationFlow/fetch._sso.*"
163 "TestStsFlow/fetch._2lo._sts"
164 "TestStsFlow/fetch._sso._sts")
165 "|")
166 ;; go 1.24 runs -vet by default, but oauth2l isn't ready
167 "-vet=off")
168 #:phases
169 #~(modify-phases %standard-phases
170 (add-before 'check 'pre-check
171 (lambda _
172 (setenv "HOME" "/tmp"))))))
173 (native-inputs
174 (list go-github-com-google-uuid
175 go-github-com-jessevdk-go-flags
176 go-golang-org-x-oauth2))
177 (home-page "https://github.com/google/oauth2l")
178 (synopsis "Simple CLI for interacting with Google API authentication")
179 (description
180 "@code{oauth2l} (pronounced ``oauth tool'') is a simple command-line tool
181for working with @url{https://developers.google.com/identity/protocols/OAuth2,
182Google OAuth 2.0} written in Go. Its primary use is to fetch and print OAuth
1832.0 access tokens, which can be used with other command-line tools and
184scripts.")
185 (license license:asl2.0)))
186
187(define-public yubico-pam
188 (package
189 (name "yubico-pam")
190 (version "2.27")
191 (source (origin
192 (method git-fetch)
193 (uri (git-reference
194 (url "https://github.com/Yubico/yubico-pam")
195 (commit version)))
196 (file-name (git-file-name name version))
197 (sha256
198 (base32
199 "0hb773zlf11xz4bwmsqv2mq5d4aq2g0crdr5cp9xwc4ivi5gd4kg"))))
200 (build-system gnu-build-system)
201 (arguments
202 ;; The pam_test fails because ykclient fails to build a Curl handle.
203 '(#:make-flags '("TESTS=util_test")))
204 (inputs
205 (list linux-pam libyubikey ykclient yubikey-personalization))
206 (native-inputs
207 (list autoconf automake libtool asciidoc pkg-config))
208 (home-page "https://developers.yubico.com/yubico-pam")
209 (synopsis "Yubico pluggable authentication module")
210 (description "The Yubico PAM module provides an easy way to integrate the
211YubiKey into your existing user authentication infrastructure.")
212 (license license:bsd-2)))
213
214(define-public pamtester
215 (package
216 (name "pamtester")
217 (version "0.1.2")
218 (source
219 (origin
220 (method url-fetch)
221 (uri (string-append
222 "mirror://sourceforge/pamtester/pamtester/"
223 version "/pamtester-" version ".tar.gz"))
224 (sha256
225 (base32 "1mdj1wj0adcnx354fs17928yn2xfr1hj5mfraq282dagi873sqw3"))))
226 (build-system gnu-build-system)
227 (arguments
228 `(#:phases
229 (modify-phases %standard-phases
230 (add-after 'unpack 'force-reconfigure
231 (lambda _ (delete-file "configure"))))))
232 (native-inputs
233 (list autoconf automake libtool pkg-config))
234 (inputs
235 (list linux-pam))
236 (home-page "https://pamtester.sourceforge.net/")
237 (synopsis "Utility for testing pluggable authentication modules (PAM) facility")
238 (description
239 "Pamtester is a tiny utility program to test the pluggable authentication
240modules (PAM) facility, specifically designed to help PAM module authors to
241intensively test their own modules.")
242 (license license:bsd-3)))