18805: add a 'static' go build tag that disables the pam login code,
authorWard Vandewege <ward@curii.com>
Fri, 25 Feb 2022 21:50:32 +0000 (16:50 -0500)
committerWard Vandewege <ward@curii.com>
Fri, 25 Feb 2022 21:53:43 +0000 (16:53 -0500)
       because it relies on the shared libraries from the glibc version
       used for linking, at runtime.

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

lib/controller/localdb/login_pam.go
lib/controller/localdb/login_pam_static.go [new file with mode: 0644]

index 237f900a83458b61e695ffe7e6808820419c2cea..14e0a582c13eda01680ccf35b8f239f10bf0892d 100644 (file)
@@ -2,6 +2,8 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
+//go:build !static
+
 package localdb
 
 import (
diff --git a/lib/controller/localdb/login_pam_static.go b/lib/controller/localdb/login_pam_static.go
new file mode 100644 (file)
index 0000000..420a256
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+//go:build static
+
+package localdb
+
+import (
+       "context"
+       "errors"
+
+       "git.arvados.org/arvados.git/sdk/go/arvados"
+)
+
+type pamLoginController struct {
+       Cluster *arvados.Cluster
+       Parent  *Conn
+}
+
+func (ctrl *pamLoginController) Logout(ctx context.Context, opts arvados.LogoutOptions) (arvados.LogoutResponse, error) {
+       return logout(ctx, ctrl.Cluster, opts)
+}
+
+func (ctrl *pamLoginController) Login(ctx context.Context, opts arvados.LoginOptions) (arvados.LoginResponse, error) {
+       return arvados.LoginResponse{}, errors.New("interactive login is not available")
+}
+
+func (ctrl *pamLoginController) UserAuthenticate(ctx context.Context, opts arvados.UserAuthenticateOptions) (arvados.APIClientAuthorization, error) {
+       return arvados.APIClientAuthorization{}, errors.New("support not available due to static compilation")
+}