diff --git a/database/boltdb.go b/database/boltdb.go index 435aa1f..b493210 100644 --- a/database/boltdb.go +++ b/database/boltdb.go @@ -79,17 +79,10 @@ func (b *BoltDBStorage) GetAllRoutes(ctx context.Context, user string) ([]Route, } // PutRoute creates a new route in the database. -func (b *BoltDBStorage) PutRoute(ctx context.Context, domain, kind string) (Route, error) { - switch kind { - case "tcp", "http": - // empty case, do nothing - default: - return Route{}, ErrInvalidKind - } - +func (b *BoltDBStorage) PutRoute(ctx context.Context, domain, creator string) (Route, error) { r := Route{ ID: uuid.New(), - Creator: ctx.Value("creator").(string), + Creator: creator, Hostname: domain, } diff --git a/server/route.go b/server/route.go index 2b5a75e..5e180e1 100644 --- a/server/route.go +++ b/server/route.go @@ -69,7 +69,7 @@ func (r *Route) Put(ctx context.Context, rt *proto.Route) (*proto.IDResponse, er return nil, handleError(ctx, clitok, err, ln.F{"action": "Route.Put_getAuth"}) } - drt, err := r.db.PutRoute(ctx, rt.Host, "http") + drt, err := r.db.PutRoute(ctx, rt.Host, clitok.Owner) if err != nil { ln.Error(err, ln.F{"action": "Route.Put"})