From d4442941a1f40e06bd301536b05194b4c7f4f72a Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 12 Apr 2022 09:54:14 +0200 Subject: [PATCH] refactor glauth Signed-off-by: Christian Richter --- {glauth => extensions/glauth}/.dockerignore | 0 {glauth => extensions/glauth}/.gitignore | 0 {glauth => extensions/glauth}/Makefile | 12 ++++++------ {glauth => extensions/glauth}/cmd/glauth/main.go | 4 ++-- .../glauth}/docker/Dockerfile.linux.amd64 | 0 .../glauth}/docker/Dockerfile.linux.arm | 0 .../glauth}/docker/Dockerfile.linux.arm64 | 0 {glauth => extensions/glauth}/docker/manifest.tmpl | 0 .../glauth}/pkg/command/health.go | 6 +++--- {glauth => extensions/glauth}/pkg/command/root.go | 2 +- .../glauth}/pkg/command/server.go | 14 +++++++------- .../glauth}/pkg/command/version.go | 2 +- {glauth => extensions/glauth}/pkg/config/config.go | 0 {glauth => extensions/glauth}/pkg/config/debug.go | 0 .../glauth}/pkg/config/defaults/defaultconfig.go | 2 +- {glauth => extensions/glauth}/pkg/config/ldap.go | 0 {glauth => extensions/glauth}/pkg/config/ldaps.go | 0 {glauth => extensions/glauth}/pkg/config/log.go | 0 .../glauth}/pkg/config/parser/parse.go | 4 ++-- .../glauth}/pkg/config/service.go | 0 .../glauth}/pkg/config/tracing.go | 0 .../glauth}/pkg/logging/logging.go | 2 +- .../glauth}/pkg/metrics/metrics.go | 0 {glauth => extensions/glauth}/pkg/mlogr/mlogr.go | 0 .../glauth}/pkg/server/debug/option.go | 2 +- .../glauth}/pkg/server/debug/server.go | 2 +- .../glauth}/pkg/server/glauth/chain.go | 0 .../glauth}/pkg/server/glauth/ocis.go | 0 .../glauth}/pkg/server/glauth/option.go | 0 .../glauth}/pkg/server/glauth/server.go | 2 +- .../glauth}/pkg/tracing/tracing.go | 2 +- {glauth => extensions/glauth}/reflex.conf | 0 ocis-pkg/config/config.go | 2 +- ocis-pkg/config/defaultconfig.go | 2 +- ocis/pkg/command/glauth.go | 2 +- ocis/pkg/runtime/service/service.go | 2 +- 36 files changed, 32 insertions(+), 32 deletions(-) rename {glauth => extensions/glauth}/.dockerignore (100%) rename {glauth => extensions/glauth}/.gitignore (100%) rename {glauth => extensions/glauth}/Makefile (78%) rename {glauth => extensions/glauth}/cmd/glauth/main.go (51%) rename {glauth => extensions/glauth}/docker/Dockerfile.linux.amd64 (100%) rename {glauth => extensions/glauth}/docker/Dockerfile.linux.arm (100%) rename {glauth => extensions/glauth}/docker/Dockerfile.linux.arm64 (100%) rename {glauth => extensions/glauth}/docker/manifest.tmpl (100%) rename {glauth => extensions/glauth}/pkg/command/health.go (84%) rename {glauth => extensions/glauth}/pkg/command/root.go (95%) rename {glauth => extensions/glauth}/pkg/command/server.go (91%) rename {glauth => extensions/glauth}/pkg/command/version.go (95%) rename {glauth => extensions/glauth}/pkg/config/config.go (100%) rename {glauth => extensions/glauth}/pkg/config/debug.go (100%) rename {glauth => extensions/glauth}/pkg/config/defaults/defaultconfig.go (97%) rename {glauth => extensions/glauth}/pkg/config/ldap.go (100%) rename {glauth => extensions/glauth}/pkg/config/ldaps.go (100%) rename {glauth => extensions/glauth}/pkg/config/log.go (100%) rename {glauth => extensions/glauth}/pkg/config/parser/parse.go (85%) rename {glauth => extensions/glauth}/pkg/config/service.go (100%) rename {glauth => extensions/glauth}/pkg/config/tracing.go (100%) rename {glauth => extensions/glauth}/pkg/logging/logging.go (85%) rename {glauth => extensions/glauth}/pkg/metrics/metrics.go (100%) rename {glauth => extensions/glauth}/pkg/mlogr/mlogr.go (100%) rename {glauth => extensions/glauth}/pkg/server/debug/option.go (94%) rename {glauth => extensions/glauth}/pkg/server/debug/server.go (96%) rename {glauth => extensions/glauth}/pkg/server/glauth/chain.go (100%) rename {glauth => extensions/glauth}/pkg/server/glauth/ocis.go (100%) rename {glauth => extensions/glauth}/pkg/server/glauth/option.go (100%) rename {glauth => extensions/glauth}/pkg/server/glauth/server.go (98%) rename {glauth => extensions/glauth}/pkg/tracing/tracing.go (89%) rename {glauth => extensions/glauth}/reflex.conf (100%) diff --git a/glauth/.dockerignore b/extensions/glauth/.dockerignore similarity index 100% rename from glauth/.dockerignore rename to extensions/glauth/.dockerignore diff --git a/glauth/.gitignore b/extensions/glauth/.gitignore similarity index 100% rename from glauth/.gitignore rename to extensions/glauth/.gitignore diff --git a/glauth/Makefile b/extensions/glauth/Makefile similarity index 78% rename from glauth/Makefile rename to extensions/glauth/Makefile index 534484c5c5..d950964251 100644 --- a/glauth/Makefile +++ b/extensions/glauth/Makefile @@ -1,27 +1,27 @@ SHELL := bash NAME := glauth -include ../.make/recursion.mk +include ../../.make/recursion.mk ############ tooling ############ ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI -include ../.bingo/Variables.mk +include ../../.bingo/Variables.mk endif ############ go tooling ############ -include ../.make/go.mk +include ../../.make/go.mk ############ release ############ -include ../.make/release.mk +include ../../.make/release.mk ############ docs generate ############ -include ../.make/docs.mk +include ../../.make/docs.mk .PHONY: docs-generate docs-generate: config-docs-generate ############ generate ############ -include ../.make/generate.mk +include ../../.make/generate.mk .PHONY: ci-go-generate ci-go-generate: # CI runs ci-node-generate automatically before this target diff --git a/glauth/cmd/glauth/main.go b/extensions/glauth/cmd/glauth/main.go similarity index 51% rename from glauth/cmd/glauth/main.go rename to extensions/glauth/cmd/glauth/main.go index 4ecc5b53d9..ecc96b0821 100644 --- a/glauth/cmd/glauth/main.go +++ b/extensions/glauth/cmd/glauth/main.go @@ -3,8 +3,8 @@ package main import ( "os" - "github.com/owncloud/ocis/glauth/pkg/command" - "github.com/owncloud/ocis/glauth/pkg/config/defaults" + "github.com/owncloud/ocis/extensions/glauth/pkg/command" + "github.com/owncloud/ocis/extensions/glauth/pkg/config/defaults" ) func main() { diff --git a/glauth/docker/Dockerfile.linux.amd64 b/extensions/glauth/docker/Dockerfile.linux.amd64 similarity index 100% rename from glauth/docker/Dockerfile.linux.amd64 rename to extensions/glauth/docker/Dockerfile.linux.amd64 diff --git a/glauth/docker/Dockerfile.linux.arm b/extensions/glauth/docker/Dockerfile.linux.arm similarity index 100% rename from glauth/docker/Dockerfile.linux.arm rename to extensions/glauth/docker/Dockerfile.linux.arm diff --git a/glauth/docker/Dockerfile.linux.arm64 b/extensions/glauth/docker/Dockerfile.linux.arm64 similarity index 100% rename from glauth/docker/Dockerfile.linux.arm64 rename to extensions/glauth/docker/Dockerfile.linux.arm64 diff --git a/glauth/docker/manifest.tmpl b/extensions/glauth/docker/manifest.tmpl similarity index 100% rename from glauth/docker/manifest.tmpl rename to extensions/glauth/docker/manifest.tmpl diff --git a/glauth/pkg/command/health.go b/extensions/glauth/pkg/command/health.go similarity index 84% rename from glauth/pkg/command/health.go rename to extensions/glauth/pkg/command/health.go index edc25b50ac..c6e54893ce 100644 --- a/glauth/pkg/command/health.go +++ b/extensions/glauth/pkg/command/health.go @@ -4,9 +4,9 @@ import ( "fmt" "net/http" - "github.com/owncloud/ocis/glauth/pkg/config" - "github.com/owncloud/ocis/glauth/pkg/config/parser" - "github.com/owncloud/ocis/glauth/pkg/logging" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config/parser" + "github.com/owncloud/ocis/extensions/glauth/pkg/logging" "github.com/urfave/cli/v2" ) diff --git a/glauth/pkg/command/root.go b/extensions/glauth/pkg/command/root.go similarity index 95% rename from glauth/pkg/command/root.go rename to extensions/glauth/pkg/command/root.go index 7b1dc51d9c..5fbfbf5760 100644 --- a/glauth/pkg/command/root.go +++ b/extensions/glauth/pkg/command/root.go @@ -4,7 +4,7 @@ import ( "context" "os" - "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" "github.com/owncloud/ocis/ocis-pkg/clihelper" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/thejerf/suture/v4" diff --git a/glauth/pkg/command/server.go b/extensions/glauth/pkg/command/server.go similarity index 91% rename from glauth/pkg/command/server.go rename to extensions/glauth/pkg/command/server.go index d8da2cabbf..fda86d30c1 100644 --- a/glauth/pkg/command/server.go +++ b/extensions/glauth/pkg/command/server.go @@ -8,13 +8,13 @@ import ( glauthcfg "github.com/glauth/glauth/v2/pkg/config" "github.com/oklog/run" - "github.com/owncloud/ocis/glauth/pkg/config" - "github.com/owncloud/ocis/glauth/pkg/config/parser" - "github.com/owncloud/ocis/glauth/pkg/logging" - "github.com/owncloud/ocis/glauth/pkg/metrics" - "github.com/owncloud/ocis/glauth/pkg/server/debug" - "github.com/owncloud/ocis/glauth/pkg/server/glauth" - "github.com/owncloud/ocis/glauth/pkg/tracing" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config/parser" + "github.com/owncloud/ocis/extensions/glauth/pkg/logging" + "github.com/owncloud/ocis/extensions/glauth/pkg/metrics" + "github.com/owncloud/ocis/extensions/glauth/pkg/server/debug" + "github.com/owncloud/ocis/extensions/glauth/pkg/server/glauth" + "github.com/owncloud/ocis/extensions/glauth/pkg/tracing" pkgcrypto "github.com/owncloud/ocis/ocis-pkg/crypto" "github.com/owncloud/ocis/ocis-pkg/service/grpc" "github.com/owncloud/ocis/ocis-pkg/version" diff --git a/glauth/pkg/command/version.go b/extensions/glauth/pkg/command/version.go similarity index 95% rename from glauth/pkg/command/version.go rename to extensions/glauth/pkg/command/version.go index c8e149daf5..a14d81accb 100644 --- a/glauth/pkg/command/version.go +++ b/extensions/glauth/pkg/command/version.go @@ -8,7 +8,7 @@ import ( "github.com/owncloud/ocis/ocis-pkg/version" tw "github.com/olekukonko/tablewriter" - "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" "github.com/urfave/cli/v2" ) diff --git a/glauth/pkg/config/config.go b/extensions/glauth/pkg/config/config.go similarity index 100% rename from glauth/pkg/config/config.go rename to extensions/glauth/pkg/config/config.go diff --git a/glauth/pkg/config/debug.go b/extensions/glauth/pkg/config/debug.go similarity index 100% rename from glauth/pkg/config/debug.go rename to extensions/glauth/pkg/config/debug.go diff --git a/glauth/pkg/config/defaults/defaultconfig.go b/extensions/glauth/pkg/config/defaults/defaultconfig.go similarity index 97% rename from glauth/pkg/config/defaults/defaultconfig.go rename to extensions/glauth/pkg/config/defaults/defaultconfig.go index 12774c4888..4ed303cb3d 100644 --- a/glauth/pkg/config/defaults/defaultconfig.go +++ b/extensions/glauth/pkg/config/defaults/defaultconfig.go @@ -3,7 +3,7 @@ package defaults import ( "path" - "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" "github.com/owncloud/ocis/ocis-pkg/config/defaults" ) diff --git a/glauth/pkg/config/ldap.go b/extensions/glauth/pkg/config/ldap.go similarity index 100% rename from glauth/pkg/config/ldap.go rename to extensions/glauth/pkg/config/ldap.go diff --git a/glauth/pkg/config/ldaps.go b/extensions/glauth/pkg/config/ldaps.go similarity index 100% rename from glauth/pkg/config/ldaps.go rename to extensions/glauth/pkg/config/ldaps.go diff --git a/glauth/pkg/config/log.go b/extensions/glauth/pkg/config/log.go similarity index 100% rename from glauth/pkg/config/log.go rename to extensions/glauth/pkg/config/log.go diff --git a/glauth/pkg/config/parser/parse.go b/extensions/glauth/pkg/config/parser/parse.go similarity index 85% rename from glauth/pkg/config/parser/parse.go rename to extensions/glauth/pkg/config/parser/parse.go index 1d9326a727..532fb51495 100644 --- a/glauth/pkg/config/parser/parse.go +++ b/extensions/glauth/pkg/config/parser/parse.go @@ -3,8 +3,8 @@ package parser import ( "errors" - "github.com/owncloud/ocis/glauth/pkg/config" - "github.com/owncloud/ocis/glauth/pkg/config/defaults" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config/defaults" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/config/envdecode" diff --git a/glauth/pkg/config/service.go b/extensions/glauth/pkg/config/service.go similarity index 100% rename from glauth/pkg/config/service.go rename to extensions/glauth/pkg/config/service.go diff --git a/glauth/pkg/config/tracing.go b/extensions/glauth/pkg/config/tracing.go similarity index 100% rename from glauth/pkg/config/tracing.go rename to extensions/glauth/pkg/config/tracing.go diff --git a/glauth/pkg/logging/logging.go b/extensions/glauth/pkg/logging/logging.go similarity index 85% rename from glauth/pkg/logging/logging.go rename to extensions/glauth/pkg/logging/logging.go index 5282014a62..cb8b54ad67 100644 --- a/glauth/pkg/logging/logging.go +++ b/extensions/glauth/pkg/logging/logging.go @@ -1,7 +1,7 @@ package logging import ( - "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" ) diff --git a/glauth/pkg/metrics/metrics.go b/extensions/glauth/pkg/metrics/metrics.go similarity index 100% rename from glauth/pkg/metrics/metrics.go rename to extensions/glauth/pkg/metrics/metrics.go diff --git a/glauth/pkg/mlogr/mlogr.go b/extensions/glauth/pkg/mlogr/mlogr.go similarity index 100% rename from glauth/pkg/mlogr/mlogr.go rename to extensions/glauth/pkg/mlogr/mlogr.go diff --git a/glauth/pkg/server/debug/option.go b/extensions/glauth/pkg/server/debug/option.go similarity index 94% rename from glauth/pkg/server/debug/option.go rename to extensions/glauth/pkg/server/debug/option.go index 7167499f3a..2ad68fb5d3 100644 --- a/glauth/pkg/server/debug/option.go +++ b/extensions/glauth/pkg/server/debug/option.go @@ -3,7 +3,7 @@ package debug import ( "context" - "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" ) diff --git a/glauth/pkg/server/debug/server.go b/extensions/glauth/pkg/server/debug/server.go similarity index 96% rename from glauth/pkg/server/debug/server.go rename to extensions/glauth/pkg/server/debug/server.go index 5cc9fab7b3..984358a3b1 100644 --- a/glauth/pkg/server/debug/server.go +++ b/extensions/glauth/pkg/server/debug/server.go @@ -4,7 +4,7 @@ import ( "io" "net/http" - "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" "github.com/owncloud/ocis/ocis-pkg/service/debug" "github.com/owncloud/ocis/ocis-pkg/version" ) diff --git a/glauth/pkg/server/glauth/chain.go b/extensions/glauth/pkg/server/glauth/chain.go similarity index 100% rename from glauth/pkg/server/glauth/chain.go rename to extensions/glauth/pkg/server/glauth/chain.go diff --git a/glauth/pkg/server/glauth/ocis.go b/extensions/glauth/pkg/server/glauth/ocis.go similarity index 100% rename from glauth/pkg/server/glauth/ocis.go rename to extensions/glauth/pkg/server/glauth/ocis.go diff --git a/glauth/pkg/server/glauth/option.go b/extensions/glauth/pkg/server/glauth/option.go similarity index 100% rename from glauth/pkg/server/glauth/option.go rename to extensions/glauth/pkg/server/glauth/option.go diff --git a/glauth/pkg/server/glauth/server.go b/extensions/glauth/pkg/server/glauth/server.go similarity index 98% rename from glauth/pkg/server/glauth/server.go rename to extensions/glauth/pkg/server/glauth/server.go index df88d10aa4..2e6394be71 100644 --- a/glauth/pkg/server/glauth/server.go +++ b/extensions/glauth/pkg/server/glauth/server.go @@ -9,7 +9,7 @@ import ( "github.com/glauth/glauth/v2/pkg/handler" "github.com/go-logr/logr" "github.com/nmcclain/ldap" - "github.com/owncloud/ocis/glauth/pkg/mlogr" + "github.com/owncloud/ocis/extensions/glauth/pkg/mlogr" ) // LdapSvc holds the ldap server struct diff --git a/glauth/pkg/tracing/tracing.go b/extensions/glauth/pkg/tracing/tracing.go similarity index 89% rename from glauth/pkg/tracing/tracing.go rename to extensions/glauth/pkg/tracing/tracing.go index 734fd1d523..c2e19cce66 100644 --- a/glauth/pkg/tracing/tracing.go +++ b/extensions/glauth/pkg/tracing/tracing.go @@ -1,7 +1,7 @@ package tracing import ( - "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/extensions/glauth/pkg/config" pkgtrace "github.com/owncloud/ocis/ocis-pkg/tracing" "go.opentelemetry.io/otel/trace" ) diff --git a/glauth/reflex.conf b/extensions/glauth/reflex.conf similarity index 100% rename from glauth/reflex.conf rename to extensions/glauth/reflex.conf diff --git a/ocis-pkg/config/config.go b/ocis-pkg/config/config.go index 192bd2035f..967bdf117f 100644 --- a/ocis-pkg/config/config.go +++ b/ocis-pkg/config/config.go @@ -5,7 +5,7 @@ import ( audit "github.com/owncloud/ocis/audit/pkg/config" accounts "github.com/owncloud/ocis/extensions/accounts/pkg/config" - glauth "github.com/owncloud/ocis/glauth/pkg/config" + glauth "github.com/owncloud/ocis/extensions/glauth/pkg/config" graphExplorer "github.com/owncloud/ocis/graph-explorer/pkg/config" graph "github.com/owncloud/ocis/graph/pkg/config" idm "github.com/owncloud/ocis/idm/pkg/config" diff --git a/ocis-pkg/config/defaultconfig.go b/ocis-pkg/config/defaultconfig.go index b2c4fd7e8d..cc0d9b6661 100644 --- a/ocis-pkg/config/defaultconfig.go +++ b/ocis-pkg/config/defaultconfig.go @@ -3,7 +3,7 @@ package config import ( audit "github.com/owncloud/ocis/audit/pkg/config/defaults" accounts "github.com/owncloud/ocis/extensions/accounts/pkg/config/defaults" - glauth "github.com/owncloud/ocis/glauth/pkg/config/defaults" + glauth "github.com/owncloud/ocis/extensions/glauth/pkg/config/defaults" graphExplorer "github.com/owncloud/ocis/graph-explorer/pkg/config/defaults" graph "github.com/owncloud/ocis/graph/pkg/config/defaults" idm "github.com/owncloud/ocis/idm/pkg/config/defaults" diff --git a/ocis/pkg/command/glauth.go b/ocis/pkg/command/glauth.go index 9d7b09b021..ad91954eb0 100644 --- a/ocis/pkg/command/glauth.go +++ b/ocis/pkg/command/glauth.go @@ -1,7 +1,7 @@ package command import ( - "github.com/owncloud/ocis/glauth/pkg/command" + "github.com/owncloud/ocis/extensions/glauth/pkg/command" "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/config/parser" "github.com/owncloud/ocis/ocis/pkg/register" diff --git a/ocis/pkg/runtime/service/service.go b/ocis/pkg/runtime/service/service.go index 265107e98f..a0bbcba991 100644 --- a/ocis/pkg/runtime/service/service.go +++ b/ocis/pkg/runtime/service/service.go @@ -20,7 +20,7 @@ import ( "github.com/olekukonko/tablewriter" accounts "github.com/owncloud/ocis/extensions/accounts/pkg/command" - glauth "github.com/owncloud/ocis/glauth/pkg/command" + glauth "github.com/owncloud/ocis/extensions/glauth/pkg/command" graphExplorer "github.com/owncloud/ocis/graph-explorer/pkg/command" graph "github.com/owncloud/ocis/graph/pkg/command" idm "github.com/owncloud/ocis/idm/pkg/command"