Documentation
¶
Index ¶
- Constants
- func ApplyClaimTrust(md map[string]string, level ClaimTrustLevel) map[string]string
- func IsClaimKey(key string) bool
- func SanitizeInbound(md map[string]string, trustClaims bool) map[string]string
- type ClaimTrustLevel
- type CloudEvents
- type CloudTasks
- type Codec
- type GCPPubSub
- type Inbound
- type Raw
Constants ¶
const ( HeaderTaskName = "X-Cloudtasks-Taskname" HeaderQueueName = "X-Cloudtasks-Queuename" HeaderTaskRetryCount = "X-Cloudtasks-Taskretrycount" HeaderTaskExecCount = "X-Cloudtasks-Taskexecutioncount" HeaderTaskETA = "X-Cloudtasks-Tasketa" )
Cloud Tasks HTTP target headers (canonical MIME form used by net/http.Header.Get).
const ( ProtocolAuto = "auto" ProtocolRaw = "raw" ProtocolCloudEvents = "cloudevents" ProtocolCloudTasks = "cloudtasks" ProtocolGCPPubSub = "gcppubsub" )
Protocol preference from subscriber URL query protocol=.
Variables ¶
This section is empty.
Functions ¶
func ApplyClaimTrust ¶ added in v2.0.14
func ApplyClaimTrust(md map[string]string, level ClaimTrustLevel) map[string]string
ApplyClaimTrust filters metadata according to trust level.
func IsClaimKey ¶
IsClaimKey reports whether key is claim-shaped authentication metadata.
func SanitizeInbound ¶
SanitizeInbound applies trust policy to inbound metadata before processDelivery. When trustClaims is false, claim-shaped keys are dropped (TrustNone). When true, all keys are kept (TrustAll). Prefer ApplyClaimTrust for finer control.
Types ¶
type ClaimTrustLevel ¶ added in v2.0.14
type ClaimTrustLevel int
ClaimTrustLevel controls which claim-shaped metadata keys are accepted when reconstructing auth claims on consumers.
const ( // TrustNone drops all claim-shaped keys (push default via SanitizeInbound false). TrustNone ClaimTrustLevel = iota // TrustTenancyOnly keeps tenant/partition/identity keys but strips roles/service_name // so metadata cannot force tenancy.Claims.Skip via roles=internal. TrustTenancyOnly // TrustAll accepts full ClaimsFromMap input (legacy pull default). TrustAll )
type CloudEvents ¶
type CloudEvents struct{}
CloudEvents decodes CloudEvents 1.0 binary and structured content modes.
func (CloudEvents) Name ¶
func (CloudEvents) Name() string
type CloudTasks ¶
type CloudTasks struct{}
CloudTasks matches Cloud Tasks push requests and maps headers into metadata.
func (CloudTasks) Name ¶
func (CloudTasks) Name() string
type Codec ¶
type Codec interface {
Name() string
Match(r *http.Request) bool
Decode(r *http.Request) (*Inbound, error)
}
Codec decodes an HTTP push request into body + metadata.
func DefaultCodecs ¶
func DefaultCodecs() []Codec
DefaultCodecs returns the ordered codec list for protocol=auto.
type GCPPubSub ¶ added in v2.0.10
type GCPPubSub struct{}
GCPPubSub decodes Google Cloud Pub/Sub push envelopes:
{
"message": {
"data": "<base64>",
"attributes": { ... },
"messageId": "...",
"publishTime": "..."
},
"subscription": "projects/.../subscriptions/..."
}