{"record":{"id":"5f8e492218a1e648","repo":"JuliusBrussee/caveman","slug":"bedrock-exact-request-payload-hash-is-unavailable","errorCode":null,"errorMessage":"bedrock: exact request payload hash is unavailable","messagePattern":"bedrock: exact request payload hash is unavailable","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/providers/bedrock/signing.go","lineNumber":125,"sourceCode":"\t\t}\n\t}\n\treturn out, nil\n}\n\n// requestPayloadHash returns the hash of the exact post-transform wire body.\n// Gateways install it in context after transforming. Direct adapter callers and\n// verification probes can fall back to net/http's replayable GetBody contract.\n// A non-replayable body without a bound hash fails closed instead of emitting a\n// signature over bytes that may differ from the request on the wire.\nfunc requestPayloadHash(ctx context.Context, req *http.Request) (string, error) {\n\tif hash, ok := providers.RequestPayloadHash(ctx); ok {\n\t\treturn hash, nil\n\t}\n\tif req.Body == nil {\n\t\treturn awssig.HashPayload(nil), nil\n\t}\n\tif req.GetBody == nil {\n\t\treturn \"\", fmt.Errorf(\"bedrock: exact request payload hash is unavailable\")\n\t}\n\tbody, err := req.GetBody()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"bedrock: exact request payload hash is unavailable\")\n\t}\n\tdefer body.Close()\n\traw, err := io.ReadAll(body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"bedrock: exact request payload hash is unavailable\")\n\t}\n\treturn awssig.HashPayload(raw), nil\n}\n\nfunc credentialAuthKind(credential providers.Credential) (string, error) {\n\tkind := strings.ToLower(strings.TrimSpace(credential.AuthKind))\n\tswitch kind {\n\tcase \"bedrock_api_key\", \"aws_access_keys\":\n\t\treturn kind, nil","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/proxy/providers/bedrock/signing.go#L107-L143","documentation":"Error \"bedrock: exact request payload hash is unavailable\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at proxy/providers/bedrock/signing.go:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the exact request payload so its hash can be computed for signing."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}