package consts

const (
	HeaderAuthorization = "Authorization"
	HeaderAPIToken      = "X-API-TOKEN"
	HeaderAPIKey        = "X-API-KEY"

	// HeaderOperatorType is the type of the operator.
	// Value Type: string
	//
	//  - If caller is a User, the value is OperatorTypeUser.
	//  - If caller is a APIToken, the value is OperatorTypeAPIToken.
	//  - If caller is a APIKey, the value is OperatorTypeAPIKey.
	HeaderOperatorType = "X-Operator-Type"
	// HeaderOperator is the caller of the request.
	// Value Type: string
	//
	//  - If caller is a User, the value is user email.
	//  - If caller is a APIToken, the value is user email.
	//  - If caller is a APIKey, the value is api key name.
	HeaderOperator = "X-Operator"
	// HeaderUserEmail is the user email of the request.
	// Value Type: string
	//
	//  - If caller is a User, the value is user email.
	//  - If caller is a APIToken, the value is user email.
	//  - If caller is a APIKey, the value is the **Owner** of api key.
	HeaderUserEmail        = "X-User-Email"
	HeaderPrincipalProfile = "X-Principal-Profile"
	// HeaderClientIP is set by the trusted gateway from its resolved forwarded client address.
	HeaderClientIP = "X-Client-IP"
)

func GRPCMetadataKeyFromHTTPHeader(header string) string {
	return "Grpc-Metadata-" + header
}
