Documentation
¶
Overview ¶
Package edgeauth authenticates Cloudflare edge-subscribe Workers. It is kept separate from user and admin authentication so an edge credential cannot be used against any other PPanel API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateManifestRequest ¶
func AuthenticateManifestRequest(authorization, token, requestID string, cfg config.EdgeSubscribeConfig, now time.Time) (string, bool)
AuthenticateManifestRequest checks the HMAC format emitted by edge-subscribe. The signed bytes are: v2\nGET\n/api/edge/v1/manifest\nSHA256(token)\nUnixTimestamp\nSHA256(requestID). The returned key ID is safe to use as a replay-cache partition key.
func ClaimManifestRequest ¶
func ClaimManifestRequest(ctx context.Context, client redis.Cmdable, kid, requestID string, cfg config.EdgeSubscribeConfig) (bool, error)
ClaimManifestRequest records a valid request ID for the entire time window in which its signature could be accepted. A replay is rejected. Redis errors are returned to the caller so the endpoint can fail closed.
Types ¶
This section is empty.