package net.northking.cctp.common.security;

import org.springframework.http.HttpHeaders;

/**
 * 安全相关的HTTP常量
 *
 * @author xiusong.xie
 * @since 1.0
 */
public class SecurityHttpConstants
{
  private SecurityHttpConstants()
  {
  }

  /**
   * request header trace Id 的 key
   */
  public static final String HEADER_TRACE = "CCTP-TRACE";

  /**
   * request header 上级SpanId 的 key
   */
  public static final String HEADER_PARENT_SPAN = "CCTP-PARENT-SPAN";
  /**
   * request header 里存放 token的key
   */
  public static final String HEADER_AUTHENTICATION = HttpHeaders.AUTHORIZATION;

  /**
   * 认证 Token 前缀
   */
  public static final String HEADER_AUTHENTICATION_PREFIX = "Bearer ";

  /**
   * Cookies中存放Token的key
   */
  public static final String COOKIE_KEY_TOKEN = "CCTP-SECURITY";

  /**
   * request Attributes 里存放 SpanID 的 Key
   */
  public static final String ATTRIBUTE_SPAN = "CCTP-SPAN-ID";

  /**
   * request Attributes 里存放 TraceID 的 Key
   */
  public static final String ATTRIBUTE_PARENT_SPAN = "CCTP-PARENT-SPAN";

  /**
   * request Attributes 里存放 TraceID 的 Key
   */
  public static final String ATTRIBUTE_TRACE = "CCTP-TRACE-ID";
}
