istore: updated
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@ Makefile
|
||||
autom4te.cache/
|
||||
*.service
|
||||
tmp.*
|
||||
tmp/*
|
||||
*.tar.*
|
||||
cmd/certmanagerctl/certmanagerctl
|
||||
cmd/certmanagerd/certmanagerd
|
||||
|
||||
88
Makefile.am
88
Makefile.am
@@ -23,25 +23,98 @@ certmanagerctl$(EXEEXT): $(certmanagerctl_SOURCES) $(EXTRA_certmanagerd_SOURCES)
|
||||
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerctl$(EXEEXT) $(certmanagerctl_SOURCES)
|
||||
|
||||
|
||||
EXTRA_certmanagerd_SOURCES =
|
||||
EXTRA_certmanagerd_SOURCES = \
|
||||
internal/config/config.go \
|
||||
internal/database/database.go \
|
||||
internal/database/issuer.go \
|
||||
internal/database/service.go \
|
||||
internal/descriptor/descriptor.go \
|
||||
internal/grpc/handler/certman.go \
|
||||
internal/grpc/handler/handler.go \
|
||||
internal/grpc/handler/status.go \
|
||||
internal/grpc/service/service.go \
|
||||
internal/logic/auth.go \
|
||||
internal/logic/issuer.go \
|
||||
internal/logic/logic.go \
|
||||
internal/logic/service.go \
|
||||
internal/logic/status.go \
|
||||
internal/server/server.go \
|
||||
internal/wrpc/handler/basauth.go \
|
||||
internal/wrpc/handler/handler.go \
|
||||
internal/wrpc/handler/status.go \
|
||||
internal/wrpc/service/service.go \
|
||||
pkg/aux509/x509cert.go \
|
||||
pkg/auxgin/corsmw.go \
|
||||
pkg/auxgin/logmw.go \
|
||||
pkg/auxgin/reqlog.go \
|
||||
pkg/auxgin/reslog.go \
|
||||
pkg/auxgrpc/error.go \
|
||||
pkg/auxhttp/genres.go \
|
||||
pkg/auxhttp/getbearer.go \
|
||||
pkg/auxhttp/parseauth.go \
|
||||
pkg/auxid/genid.go \
|
||||
pkg/client/auth.go \
|
||||
pkg/client/certman.go \
|
||||
pkg/client/control.go \
|
||||
pkg/cm509/x509.go \
|
||||
pkg/common/common.go \
|
||||
pkg/logger/logger.go \
|
||||
pkg/cmctl/cmctl_grpc.pb.go \
|
||||
pkg/cmctl/cmctl.pb.go
|
||||
|
||||
EXTRA_DIST = $(EXTRA_certmanagerd_SOURCES)
|
||||
|
||||
GENDIR=api/certmanagercontrol
|
||||
EXTRA_DIST = $(EXTRA_certmanagerd_SOURCES) \
|
||||
internal/test/auxfunction_test.go \
|
||||
internal/test/database_test.go \
|
||||
internal/test/logic_issuer_create_test.go \
|
||||
internal/test/logic_issuer_import_test.go \
|
||||
pkg/aux509/x509cert_test.go \
|
||||
pkg/cm509/x509_test.go \
|
||||
internal/test/testchain_a00.crt \
|
||||
internal/test/testchain_a01.crt \
|
||||
internal/test/testchain_a02.crt \
|
||||
internal/test/testchain_a03.crt \
|
||||
pkg/cm509/testchain_a00.crt \
|
||||
pkg/cm509/testchain_a01.crt \
|
||||
pkg/cm509/testchain_a02.crt \
|
||||
pkg/cm509/testchain_a03.crt \
|
||||
internal/test/testchain_a00.key \
|
||||
etc/certmanager/certmanagerd.yaml \
|
||||
proto/cmctl.proto \
|
||||
go.mod \
|
||||
go.sum \
|
||||
README.md
|
||||
|
||||
|
||||
GENDIR=pkg/cmctl
|
||||
grpc:
|
||||
mkdir -p $(GENDIR)
|
||||
protoc --proto_path=proto --go_out=$(GENDIR) --go-grpc_out=$(GENDIR) proto/certmanagercontrol.proto
|
||||
protoc --proto_path=proto --go_out=$(GENDIR) --go-grpc_out=$(GENDIR) proto/cmctl.proto
|
||||
|
||||
SYSTEMD_LIBDIR = /lib/systemd/system
|
||||
|
||||
FREEBSD_LOCALBASE = /usr/local
|
||||
FREEBSD_RCDIR = $(FREEBSD_LOCALBASE)/etc/rc.d
|
||||
LINUX_SYSTEMDDIR = /lib/systemd/system
|
||||
|
||||
|
||||
install-data-local:
|
||||
test -z $(DESTDIR)$(SRV_CONFDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_CONFDIR)
|
||||
test -z $(DESTDIR)$(SRV_LOGDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_LOGDIR)
|
||||
test -z $(DESTDIR)$(SRV_RUNDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_RUNDIR)
|
||||
test -z $(DESTDIR)$(SRV_DATADIR) || $(MKDIR_P) $(DESTDIR)$(SRV_DATADIR)
|
||||
test -z $(DESTDIR)$(SYSTEMD_LIBDIR) || $(MKDIR_P) $(DESTDIR)$(SYSTEMD_LIBDIR)
|
||||
$(INSTALL_DATA) initrc/certmanagerd.service $(DESTDIR)$(SYSTEMD_LIBDIR)
|
||||
|
||||
if FREEBSD_OS
|
||||
test -z $(DESTDIR)$(FREEBSD_RCDIR) || $(MKDIR_P) $(DESTDIR)$(FREEBSD_RCDIR)
|
||||
$(INSTALL_DATA) initrc/certmanagerd $(DESTDIR)$(FREEBSD_RCDIR)
|
||||
chmod a+x $(DESTDIR)$(FREEBSD_RCDIR)/certmanagerd
|
||||
endif
|
||||
if LINUX_OS
|
||||
if SYSTEMD
|
||||
test -z $(DESTDIR)$(LINUX_SYSTEMDDIR) || $(MKDIR_P) $(DESTDIR)$(LINUX_SYSTEMDDIR)
|
||||
$(INSTALL_DATA) initrc/certmanagerd.service $(DESTDIR)$(LINUX_SYSTEMDDIR)
|
||||
endif
|
||||
endif
|
||||
|
||||
goformat: gformat
|
||||
gformat:
|
||||
@@ -62,5 +135,6 @@ clean-local:
|
||||
rm -rf autom4te.cache
|
||||
rm -f cmd/certmanagerd/certmanagerd
|
||||
rm -f cmd/certmanagerctl/certmanagerctl
|
||||
rm -rf tmp.*/
|
||||
rm -rf tmp/
|
||||
rm -rf autom4te.cache/
|
||||
|
||||
|
||||
79
Makefile.in
79
Makefile.in
@@ -301,10 +301,72 @@ certmanagerctl_SOURCES = cmd/certmanagerctl/main.go \
|
||||
cmd/certmanagerctl/servicecli.go \
|
||||
cmd/certmanagerctl/issuercli.go
|
||||
|
||||
EXTRA_certmanagerd_SOURCES =
|
||||
EXTRA_DIST = $(EXTRA_certmanagerd_SOURCES)
|
||||
GENDIR = api/certmanagercontrol
|
||||
EXTRA_certmanagerd_SOURCES = \
|
||||
internal/config/config.go \
|
||||
internal/database/database.go \
|
||||
internal/database/issuer.go \
|
||||
internal/database/service.go \
|
||||
internal/descriptor/descriptor.go \
|
||||
internal/grpc/handler/certman.go \
|
||||
internal/grpc/handler/handler.go \
|
||||
internal/grpc/handler/status.go \
|
||||
internal/grpc/service/service.go \
|
||||
internal/logic/auth.go \
|
||||
internal/logic/issuer.go \
|
||||
internal/logic/logic.go \
|
||||
internal/logic/service.go \
|
||||
internal/logic/status.go \
|
||||
internal/server/server.go \
|
||||
internal/wrpc/handler/basauth.go \
|
||||
internal/wrpc/handler/handler.go \
|
||||
internal/wrpc/handler/status.go \
|
||||
internal/wrpc/service/service.go \
|
||||
pkg/aux509/x509cert.go \
|
||||
pkg/auxgin/corsmw.go \
|
||||
pkg/auxgin/logmw.go \
|
||||
pkg/auxgin/reqlog.go \
|
||||
pkg/auxgin/reslog.go \
|
||||
pkg/auxgrpc/error.go \
|
||||
pkg/auxhttp/genres.go \
|
||||
pkg/auxhttp/getbearer.go \
|
||||
pkg/auxhttp/parseauth.go \
|
||||
pkg/auxid/genid.go \
|
||||
pkg/client/auth.go \
|
||||
pkg/client/certman.go \
|
||||
pkg/client/control.go \
|
||||
pkg/cm509/x509.go \
|
||||
pkg/common/common.go \
|
||||
pkg/logger/logger.go \
|
||||
pkg/cmctl/cmctl_grpc.pb.go \
|
||||
pkg/cmctl/cmctl.pb.go
|
||||
|
||||
EXTRA_DIST = $(EXTRA_certmanagerd_SOURCES) \
|
||||
internal/test/auxfunction_test.go \
|
||||
internal/test/database_test.go \
|
||||
internal/test/logic_issuer_create_test.go \
|
||||
internal/test/logic_issuer_import_test.go \
|
||||
pkg/aux509/x509cert_test.go \
|
||||
pkg/cm509/x509_test.go \
|
||||
internal/test/testchain_a00.crt \
|
||||
internal/test/testchain_a01.crt \
|
||||
internal/test/testchain_a02.crt \
|
||||
internal/test/testchain_a03.crt \
|
||||
pkg/cm509/testchain_a00.crt \
|
||||
pkg/cm509/testchain_a01.crt \
|
||||
pkg/cm509/testchain_a02.crt \
|
||||
pkg/cm509/testchain_a03.crt \
|
||||
internal/test/testchain_a00.key \
|
||||
etc/certmanager/certmanagerd.yaml \
|
||||
proto/cmctl.proto \
|
||||
go.mod \
|
||||
go.sum \
|
||||
README.md
|
||||
|
||||
GENDIR = pkg/cmctl
|
||||
SYSTEMD_LIBDIR = /lib/systemd/system
|
||||
FREEBSD_LOCALBASE = /usr/local
|
||||
FREEBSD_RCDIR = $(FREEBSD_LOCALBASE)/etc/rc.d
|
||||
LINUX_SYSTEMDDIR = /lib/systemd/system
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -804,7 +866,7 @@ certmanagerctl$(EXEEXT): $(certmanagerctl_SOURCES) $(EXTRA_certmanagerd_SOURCES)
|
||||
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerctl$(EXEEXT) $(certmanagerctl_SOURCES)
|
||||
grpc:
|
||||
mkdir -p $(GENDIR)
|
||||
protoc --proto_path=proto --go_out=$(GENDIR) --go-grpc_out=$(GENDIR) proto/certmanagercontrol.proto
|
||||
protoc --proto_path=proto --go_out=$(GENDIR) --go-grpc_out=$(GENDIR) proto/cmctl.proto
|
||||
|
||||
install-data-local:
|
||||
test -z $(DESTDIR)$(SRV_CONFDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_CONFDIR)
|
||||
@@ -812,7 +874,11 @@ install-data-local:
|
||||
test -z $(DESTDIR)$(SRV_RUNDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_RUNDIR)
|
||||
test -z $(DESTDIR)$(SRV_DATADIR) || $(MKDIR_P) $(DESTDIR)$(SRV_DATADIR)
|
||||
test -z $(DESTDIR)$(SYSTEMD_LIBDIR) || $(MKDIR_P) $(DESTDIR)$(SYSTEMD_LIBDIR)
|
||||
$(INSTALL_DATA) initrc/certmanagerd.service $(DESTDIR)$(SYSTEMD_LIBDIR)
|
||||
@FREEBSD_OS_TRUE@ test -z $(DESTDIR)$(FREEBSD_RCDIR) || $(MKDIR_P) $(DESTDIR)$(FREEBSD_RCDIR)
|
||||
@FREEBSD_OS_TRUE@ $(INSTALL_DATA) initrc/certmanagerd $(DESTDIR)$(FREEBSD_RCDIR)
|
||||
@FREEBSD_OS_TRUE@ chmod a+x $(DESTDIR)$(FREEBSD_RCDIR)/certmanagerd
|
||||
@LINUX_OS_TRUE@@SYSTEMD_TRUE@ test -z $(DESTDIR)$(LINUX_SYSTEMDDIR) || $(MKDIR_P) $(DESTDIR)$(LINUX_SYSTEMDDIR)
|
||||
@LINUX_OS_TRUE@@SYSTEMD_TRUE@ $(INSTALL_DATA) initrc/certmanagerd.service $(DESTDIR)$(LINUX_SYSTEMDDIR)
|
||||
|
||||
goformat: gformat
|
||||
gformat:
|
||||
@@ -833,7 +899,8 @@ clean-local:
|
||||
rm -rf autom4te.cache
|
||||
rm -f cmd/certmanagerd/certmanagerd
|
||||
rm -f cmd/certmanagerctl/certmanagerctl
|
||||
rm -rf tmp.*/
|
||||
rm -rf tmp/
|
||||
rm -rf autom4te.cache/
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/base64"
|
||||
"os"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
cmapi "certmanager/pkg/cmctl"
|
||||
"certmanager/pkg/client"
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
cmapi "certmanager/pkg/cmctl"
|
||||
"certmanager/pkg/client"
|
||||
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/base64"
|
||||
"strings"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
cmapi "certmanager/pkg/cmctl"
|
||||
"certmanager/pkg/client"
|
||||
)
|
||||
|
||||
|
||||
6
configure
vendored
6
configure
vendored
@@ -3075,7 +3075,7 @@ fi
|
||||
if test "x$enable_devel_mode" = "xyes"
|
||||
then :
|
||||
|
||||
SRV_LOGDIR="${SRCDIR}/tmp.log"
|
||||
SRV_LOGDIR="${SRCDIR}/tmp/log"
|
||||
|
||||
fi
|
||||
|
||||
@@ -3113,7 +3113,7 @@ fi
|
||||
if test "x$enable_devel_mode" = "xyes"
|
||||
then :
|
||||
|
||||
SRV_RUNDIR="${SRCDIR}/tmp.run"
|
||||
SRV_RUNDIR="${SRCDIR}/tmp/run"
|
||||
|
||||
fi
|
||||
|
||||
@@ -3152,7 +3152,7 @@ fi
|
||||
if test "x$enable_devel_mode" = "xyes"
|
||||
then :
|
||||
|
||||
SRV_DATADIR="${SRCDIR}/tmp.data"
|
||||
SRV_DATADIR="${SRCDIR}/tmp/data"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ AC_ARG_WITH(logdir,
|
||||
fi ])
|
||||
|
||||
AS_IF([test "x$enable_devel_mode" = "xyes"], [
|
||||
SRV_LOGDIR="${SRCDIR}/tmp.log"
|
||||
SRV_LOGDIR="${SRCDIR}/tmp/log"
|
||||
])
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ AC_ARG_WITH(rundir,
|
||||
fi ])
|
||||
|
||||
AS_IF([test "x$enable_devel_mode" = "xyes"], [
|
||||
SRV_RUNDIR="${SRCDIR}/tmp.run"
|
||||
SRV_RUNDIR="${SRCDIR}/tmp/run"
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED(SRV_RUNDIR, "$SRV_RUNDIR", [location of rundir])
|
||||
@@ -172,7 +172,7 @@ AC_ARG_WITH(datadir,
|
||||
|
||||
|
||||
AS_IF([test "x$enable_devel_mode" = "xyes"], [
|
||||
SRV_DATADIR="${SRCDIR}/tmp.data"
|
||||
SRV_DATADIR="${SRCDIR}/tmp/data"
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED(SRV_DATADIR, "$SRV_DATADIR", [location of datadir])
|
||||
|
||||
22
initrc/certmanagerd.in
Normal file
22
initrc/certmanagerd.in
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# PROVIDE: certmanagerd
|
||||
# REQUIRE: DAEMON
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="certmanagerd"
|
||||
rcvar="certmanagerd_enable"
|
||||
|
||||
pidfile="@srv_rundir@"/certmanagerd.pid
|
||||
command="@prefix@/sbin/${name}"
|
||||
command_args="-daemon"
|
||||
procname="@prefix@/sbin/${name}"
|
||||
|
||||
load_rc_config ${name}
|
||||
|
||||
: ${certmanagerd_enable:="NO"}
|
||||
|
||||
run_rc_command "$1"
|
||||
#EOF
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package config
|
||||
|
||||
const (
|
||||
confdirPath = "/home/ziggi/projects/certman/etc/certmanager"
|
||||
rundirPath = "/home/ziggi/projects/certman/tmp.run"
|
||||
logdirPath = "/home/ziggi/projects/certman/tmp.log"
|
||||
datadirPath = "/home/ziggi/projects/certman/tmp.data"
|
||||
confdirPath = "/home/ziggi/Projects/certman/etc/certmanager"
|
||||
rundirPath = "/home/ziggi/Projects/certman/tmp/run"
|
||||
logdirPath = "/home/ziggi/Projects/certman/tmp/log"
|
||||
datadirPath = "/home/ziggi/Projects/certman/tmp/data"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,73 +3,73 @@ package handler
|
||||
import (
|
||||
"context"
|
||||
|
||||
"certmanager/api/certmanagercontrol"
|
||||
"certmanager/pkg/cmctl"
|
||||
)
|
||||
|
||||
func (hand *Handler) CreateIssuerPair(ctx context.Context, req *certmanagercontrol.CreateIssuerPairParams) (*certmanagercontrol.CreateIssuerPairResult, error) {
|
||||
func (hand *Handler) CreateIssuerPair(ctx context.Context, req *cmctl.CreateIssuerPairParams) (*cmctl.CreateIssuerPairResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle CreateIssuerPair request")
|
||||
res, err := hand.lg.CreateIssuerPair(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (hand *Handler) ImportIssuerPair(ctx context.Context, req *certmanagercontrol.ImportIssuerPairParams) (*certmanagercontrol.ImportIssuerPairResult, error) {
|
||||
func (hand *Handler) ImportIssuerPair(ctx context.Context, req *cmctl.ImportIssuerPairParams) (*cmctl.ImportIssuerPairResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle ImportIssuerPair request")
|
||||
res, err := hand.lg.ImportIssuerPair(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (hand *Handler) RevokeIssuerPair(ctx context.Context, req *certmanagercontrol.RevokeIssuerPairParams) (*certmanagercontrol.RevokeIssuerPairResult, error) {
|
||||
func (hand *Handler) RevokeIssuerPair(ctx context.Context, req *cmctl.RevokeIssuerPairParams) (*cmctl.RevokeIssuerPairResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle RevokeIssuerPair request")
|
||||
res, err := hand.lg.RevokeIssuerPair(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (hand *Handler) UnrevokeIssuerPair(ctx context.Context, req *certmanagercontrol.UnrevokeIssuerPairParams) (*certmanagercontrol.UnrevokeIssuerPairResult, error) {
|
||||
func (hand *Handler) UnrevokeIssuerPair(ctx context.Context, req *cmctl.UnrevokeIssuerPairParams) (*cmctl.UnrevokeIssuerPairResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle UnrevokeIssuerPair request")
|
||||
res, err := hand.lg.UnrevokeIssuerPair(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (hand *Handler) ListIssuerPairs(ctx context.Context, req *certmanagercontrol.ListIssuerPairsParams) (*certmanagercontrol.ListIssuerPairsResult, error) {
|
||||
func (hand *Handler) ListIssuerPairs(ctx context.Context, req *cmctl.ListIssuerPairsParams) (*cmctl.ListIssuerPairsResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle ListIssuerPairs request")
|
||||
res, err := hand.lg.ListIssuerPairs(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (hand *Handler) GetIssuerCertificate(ctx context.Context, req *certmanagercontrol.GetIssuerCertificateParams) (*certmanagercontrol.GetIssuerCertificateResult, error) {
|
||||
func (hand *Handler) GetIssuerCertificate(ctx context.Context, req *cmctl.GetIssuerCertificateParams) (*cmctl.GetIssuerCertificateResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle GetIssuerCertificate request")
|
||||
res, err := hand.lg.GetIssuerCertificate(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (hand *Handler) CreateServicePair(ctx context.Context, req *certmanagercontrol.CreateServicePairParams) (*certmanagercontrol.CreateServicePairResult, error) {
|
||||
func (hand *Handler) CreateServicePair(ctx context.Context, req *cmctl.CreateServicePairParams) (*cmctl.CreateServicePairResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle CreateServicePair request")
|
||||
res, err := hand.lg.CreateServicePair(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (hand *Handler) RevokeServicePair(ctx context.Context, req *certmanagercontrol.RevokeServicePairParams) (*certmanagercontrol.RevokeServicePairResult, error) {
|
||||
func (hand *Handler) RevokeServicePair(ctx context.Context, req *cmctl.RevokeServicePairParams) (*cmctl.RevokeServicePairResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle RevokeServicePair request")
|
||||
res, err := hand.lg.RevokeServicePair(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (hand *Handler) ListServicePairs(ctx context.Context, req *certmanagercontrol.ListServicePairsParams) (*certmanagercontrol.ListServicePairsResult, error) {
|
||||
func (hand *Handler) ListServicePairs(ctx context.Context, req *cmctl.ListServicePairsParams) (*cmctl.ListServicePairsResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle ListServicePairs request")
|
||||
res, err := hand.lg.ListServicePairs(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (hand *Handler) GetServicePair(ctx context.Context, req *certmanagercontrol.GetServicePairParams) (*certmanagercontrol.GetServicePairResult, error) {
|
||||
func (hand *Handler) GetServicePair(ctx context.Context, req *cmctl.GetServicePairParams) (*cmctl.GetServicePairResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle GetServicePair request")
|
||||
res, err := hand.lg.GetServicePair(ctx, req)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"certmanager/api/certmanagercontrol"
|
||||
"certmanager/pkg/cmctl"
|
||||
"certmanager/internal/logic"
|
||||
"certmanager/pkg/logger"
|
||||
|
||||
@@ -13,7 +13,7 @@ type HandlerConfig struct {
|
||||
}
|
||||
|
||||
type Handler struct {
|
||||
certmanagercontrol.UnimplementedControlServer
|
||||
cmctl.UnimplementedControlServer
|
||||
lg *logic.Logic
|
||||
log *logger.Logger
|
||||
}
|
||||
@@ -27,5 +27,5 @@ func NewHandler(conf *HandlerConfig) *Handler {
|
||||
}
|
||||
|
||||
func (hand *Handler) Register(gsrv *grpc.Server) {
|
||||
certmanagercontrol.RegisterControlServer(gsrv, hand)
|
||||
cmctl.RegisterControlServer(gsrv, hand)
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ package handler
|
||||
import (
|
||||
"context"
|
||||
|
||||
"certmanager/api/certmanagercontrol"
|
||||
"certmanager/pkg/cmctl"
|
||||
)
|
||||
|
||||
func (hand *Handler) GetStatus(ctx context.Context, req *certmanagercontrol.GetStatusParams) (*certmanagercontrol.GetStatusResult, error) {
|
||||
func (hand *Handler) GetStatus(ctx context.Context, req *cmctl.GetStatusParams) (*cmctl.GetStatusResult, error) {
|
||||
var err error
|
||||
hand.log.Debugf("Handle getStatus request")
|
||||
res, err := hand.lg.GetStatus(ctx, req)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
cmapi "certmanager/pkg/cmctl"
|
||||
"certmanager/internal/descriptor"
|
||||
"certmanager/pkg/cm509"
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
cmapi "certmanager/pkg/cmctl"
|
||||
"certmanager/internal/descriptor"
|
||||
"certmanager/pkg/cm509"
|
||||
)
|
||||
|
||||
@@ -3,12 +3,12 @@ package logic
|
||||
import (
|
||||
"context"
|
||||
|
||||
"certmanager/api/certmanagercontrol"
|
||||
"certmanager/pkg/cmctl"
|
||||
)
|
||||
|
||||
func (lg *Logic) GetStatus(ctx context.Context, params *certmanagercontrol.GetStatusParams) (*certmanagercontrol.GetStatusResult, error) {
|
||||
func (lg *Logic) GetStatus(ctx context.Context, params *cmctl.GetStatusParams) (*cmctl.GetStatusResult, error) {
|
||||
var err error
|
||||
res := &certmanagercontrol.GetStatusResult{
|
||||
res := &cmctl.GetStatusResult{
|
||||
Message: "Hello",
|
||||
}
|
||||
return res, err
|
||||
|
||||
@@ -233,9 +233,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu internal/test/Makefile'; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign internal/test/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu internal/test/Makefile
|
||||
$(AUTOMAKE) --foreign internal/test/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
cmapi "certmanager/pkg/cmctl"
|
||||
"certmanager/internal/config"
|
||||
"certmanager/internal/database"
|
||||
"certmanager/internal/logic"
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
cmapi "certmanager/pkg/cmctl"
|
||||
"certmanager/internal/config"
|
||||
"certmanager/internal/database"
|
||||
"certmanager/internal/logic"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"certmanager/api/certmanagercontrol"
|
||||
"certmanager/pkg/cmctl"
|
||||
"certmanager/pkg/auxhttp"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
func (hand *Handler) GetStatus(gctx *gin.Context) {
|
||||
var err error
|
||||
nReq := &certmanagercontrol.GetStatusParams{}
|
||||
nReq := &cmctl.GetStatusParams{}
|
||||
// Bind request
|
||||
err = gctx.ShouldBind(nReq)
|
||||
if err != nil {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
cmapi "certmanager/pkg/cmctl"
|
||||
"certmanager/pkg/auxgrpc"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
cmapi "certmanager/pkg/cmctl"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,9 +2,9 @@
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v3.21.12
|
||||
// source: certmanagercontrol.proto
|
||||
// source: cmctl.proto
|
||||
|
||||
package certmanagercontrol
|
||||
package cmctl
|
||||
|
||||
import (
|
||||
context "context"
|
||||
@@ -512,5 +512,5 @@ var Control_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "certmanagercontrol.proto",
|
||||
Metadata: "cmctl.proto",
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = ".;certmanagercontrol";
|
||||
option go_package = ".;cmctl";
|
||||
|
||||
package certmanagercontrol;
|
||||
|
||||
@@ -84,7 +84,6 @@ message IssierShortDescriptor {
|
||||
bool revoked = 3;
|
||||
}
|
||||
|
||||
|
||||
message createServicePairParams {
|
||||
string issuerName = 1;
|
||||
int64 issuerID = 2;
|
||||
@@ -143,5 +142,5 @@ message getServicePairResult {
|
||||
string issuerName = 5;
|
||||
bool revoked = 6;
|
||||
string issuerCertificate = 7;
|
||||
|
||||
repeated string issuerCertificates = 8;
|
||||
}
|
||||
Reference in New Issue
Block a user