forked from TrueCloudLab/frostfs-node
c378c353d5
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
31 lines
855 B
Go
31 lines
855 B
Go
package main
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-api-go/v2/session"
|
|
sessionGRPC "github.com/nspcc-dev/neofs-api-go/v2/session/grpc"
|
|
sessionTransportGRPC "github.com/nspcc-dev/neofs-node/pkg/network/transport/session/grpc"
|
|
sessionSvc "github.com/nspcc-dev/neofs-node/pkg/services/session"
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/session/storage"
|
|
)
|
|
|
|
func initSessionService(c *cfg) {
|
|
c.privateTokenStore = storage.New()
|
|
|
|
metaHdr := new(session.ResponseMetaHeader)
|
|
xHdr := new(session.XHeader)
|
|
xHdr.SetKey("test X-Header key")
|
|
xHdr.SetValue("test X-Header value")
|
|
metaHdr.SetXHeaders([]*session.XHeader{xHdr})
|
|
|
|
sessionGRPC.RegisterSessionServiceServer(c.cfgGRPC.server,
|
|
sessionTransportGRPC.New(
|
|
sessionSvc.NewSignService(
|
|
c.key,
|
|
sessionSvc.NewExecutionService(
|
|
c.privateTokenStore,
|
|
metaHdr,
|
|
),
|
|
),
|
|
),
|
|
)
|
|
}
|