mirror of
https://github.com/openziti/zrok.git
synced 2025-06-20 17:58:50 +02:00
config namespacing (#12)
This commit is contained in:
parent
6fcd952d68
commit
01ffe50889
@ -67,7 +67,7 @@ func (self *tunnelHandler) Handle(params tunnel.TunnelParams, principal *rest_mo
|
|||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
return tunnel.NewTunnelInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
|
return tunnel.NewTunnelInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
|
||||||
}
|
}
|
||||||
cfgId, err := self.createConfig(edge)
|
cfgId, err := self.createConfig(svcName, edge)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
return tunnel.NewTunnelInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
|
return tunnel.NewTunnelInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
|
||||||
@ -117,13 +117,12 @@ func (self *tunnelHandler) Handle(params tunnel.TunnelParams, principal *rest_mo
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *tunnelHandler) createConfig(edge *rest_management_api_client.ZitiEdgeManagement) (cfgID string, err error) {
|
func (self *tunnelHandler) createConfig(svcName string, edge *rest_management_api_client.ZitiEdgeManagement) (cfgID string, err error) {
|
||||||
cfg := &model.ZrokAuth{Hello: "World"}
|
cfg := &model.ZrokAuth{Hello: "World"}
|
||||||
name := "zrok.auth.v1"
|
|
||||||
cfgCrt := &rest_model.ConfigCreate{
|
cfgCrt := &rest_model.ConfigCreate{
|
||||||
ConfigTypeID: &zrokAuthV1Id,
|
ConfigTypeID: &zrokAuthV1Id,
|
||||||
Data: cfg,
|
Data: cfg,
|
||||||
Name: &name,
|
Name: &svcName,
|
||||||
}
|
}
|
||||||
cfgReq := &config.CreateConfigParams{
|
cfgReq := &config.CreateConfigParams{
|
||||||
Config: cfgCrt,
|
Config: cfgCrt,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user