package auth

import (
	"github.com/pingcap/errors"
	"github.com/tidbcloud/pkgv2/auth/kong"
)

// params in http ctx
const (
	OrgID              = "org_id"
	ProjectID          = "project_id"
	ClusterID          = "cluster_id"
	DataflowDefineUser = "dataflow_define_user"
)

const (
	RBACOrgIdKey     = "org_id"
	RBACProjectIdKey = "project_id"
	RBACClusterIdKey = "cluster_id"
)

// auth type key
const (
	APIAuthTypeKey     = "X-Auth-Type"
	APIAuthTypeOpenAPI = kong.AuthTypeOpenAPI

	ConsoleAPITokenKey   = "Authorization"
	ConsoleAPITokenParam = "bearer"

	OpenAPIAKKey = "X-Auth-Content"
)

var (
	// error msg
	NoRouteError                          = errors.New("The resource does not exist")
	UnauthenticatedError                  = errors.New("Access denied. Please login or provide valid credentials")
	ResourceNotFoundError                 = errors.New("Resource not found")
	APIKeyPermissionDeniedError           = errors.New("API key does not have permission to access the resource")
	UserPermissionDeniedError             = errors.New("the user does not have permission to access the resource")
	InternalError                         = errors.New("Internal Server Error")
	InvalidOrgIdError                     = errors.New("Invalid Organization ID")
	ImpersonatedUserPermissionDeniedError = errors.New("impersonated user is a read only user")
)
