/******************************************************************************
 * Copyright (c)  2022 PingCAP, Inc.                                          *
 * Licensed under the Apache License, Version 2.0 (the "License");            *
 * you may not use this file except in compliance with the License.           *
 * You may obtain a copy of the License at                                    *
 *                                                                            *
 * http://www.apache.org/licenses/LICENSE-2.0                                 *
 *                                                                            *
 * Unless required by applicable law or agreed to in writing, software        *
 * distributed under the License is distributed on an "AS IS" BASIS,          *
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
 * See the License for the specific language governing permissions and        *
 * limitations under the License.                                             *
 ******************************************************************************/

package constants

import "time"

type ProvidedVendor string

// AWS @ Definition of vendors provided by server
const (
	AWS   ProvidedVendor = "aws"
	GCP   ProvidedVendor = "gcp"
	Azure ProvidedVendor = "azure"
)

const DefaultTokenValidPeriod time.Duration = 4 * time.Hour

const (
	EnvDev     = "dev"
	EnvStaging = "staging"
	EnvProd    = "prod"
)

const (
	// AuthorizationHeader API request headers
	AuthorizationHeader = "Authorization"
	BearerPrefix        = "Bearer"
	DefaultCacheTimeout = 5 * time.Minute
)

const (
	//Setup gin ReadHeaderTimeout
	GinReadHeaderTimeout = 5 * time.Second
	GinIdleTimeout       = 5 * time.Minute
	GracefulShutDownWait = 5 * time.Second
	ResourceWorkerGC     = 5 * time.Minute
)

type ctxKey struct{}

var (
	RequestResultCtxKey = ctxKey{}
)

type Auth0ConnectionType string

// cloud auth0
const (
	Auth0DatabaseConnection     Auth0ConnectionType = "custom-email"
	Auth0SocialConnectionGoogle Auth0ConnectionType = "google-oauth2"
	Auth0SocialConnectionGithub Auth0ConnectionType = "github"
)
