From 7606324aa25f11f453df835fa0514578bd0d0d13 Mon Sep 17 00:00:00 2001 From: Mahan Zendedel DH Date: Wed, 24 Jul 2024 13:27:30 +0400 Subject: [PATCH] feat: move roles --- pkg/api/role.go | 7 +++++++ pkg/httpclient/request.go | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/api/role.go b/pkg/api/role.go index 1758114..a853449 100644 --- a/pkg/api/role.go +++ b/pkg/api/role.go @@ -5,6 +5,11 @@ import "strings" type Role string const ( + GodUserID = "god-kaytu-user" +) + +const ( + InternalRole Role = "internal" KaytuAdminRole Role = "kaytu-admin" AdminRole Role = "admin" EditorRole Role = "editor" @@ -13,6 +18,8 @@ const ( func GetRole(s string) Role { switch strings.TrimSpace(strings.ToLower(s)) { + case string(InternalRole): + return InternalRole case string(KaytuAdminRole): return KaytuAdminRole case string(AdminRole): diff --git a/pkg/httpclient/request.go b/pkg/httpclient/request.go index 2709348..101be55 100644 --- a/pkg/httpclient/request.go +++ b/pkg/httpclient/request.go @@ -6,14 +6,14 @@ import ( "context" "encoding/json" "fmt" - "github.com/kaytu-io/kaytu-engine/pkg/httpserver" "io" "mime/multipart" "net/http" url2 "net/url" "time" - "github.com/kaytu-io/kaytu-engine/pkg/auth/api" + "github.com/kaytu-io/kaytu-util/pkg/api" + "github.com/kaytu-io/kaytu-util/pkg/httpserver" "github.com/labstack/echo/v4" )