authheader

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package authheader 禁止业务代码直接从 HTTP 请求头读取受框架保护的身份与凭证头。

在 appkit 信任模型中,验签与身份重建只在 authn/严格安全边界完成: 用户身份应从 appkit.ActorFrom(ctx) 获取,租户与分区应从 callctx.From(ctx) 获取。 业务或 transport 代码直接读 Authorization / X-Step-Up / X-Tenant-Id / X-Partition / X-Caller 等头会绕过验签或引入 unsigned 头伪造面(DESIGN §7)。

默认只查非生成生产代码(_test.go 与生成文件不查),-tests=true 连测试一起查。 确需读取的场景(如网关/鉴权提供方本身)可用 //appkit:ignore authheader -- <理由> 豁免。

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "authheader",
	Doc:  "禁止直接从 http.Header 读取受保护的身份/凭证头(Authorization / X-Step-Up / X-Tenant-Id / X-Partition / X-Caller 等);请改用 appkit.ActorFrom(ctx) 或 callctx.From(ctx)",
	Run:  run,
}

Analyzer 是 authheader 检查器。

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL