{"record":{"id":"655965f359c13612","repo":"grafana/k6","slug":"curve-is-required","errorCode":null,"errorMessage":"curve is required","messagePattern":"curve is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/webcrypto/jwk.go","lineNumber":133,"sourceCode":"\t// Key type\n\tKty string `json:\"kty\"`\n\t// Canonical Curve\n\tCrv string `json:\"crv\"`\n\t// X coordinate\n\tX string `json:\"x\"`\n\t// Y coordinate\n\tY string `json:\"y\"`\n\t// Private scalar\n\tD string `json:\"d\"`\n}\n\nfunc (jwk *ecJWK) validate() error {\n\tif jwk.Kty != JWKECKeyType {\n\t\treturn fmt.Errorf(\"invalid key type: %s\", jwk.Kty)\n\t}\n\n\tif jwk.Crv == \"\" {\n\t\treturn errors.New(\"curve is required\")\n\t}\n\n\tif jwk.X == \"\" {\n\t\treturn errors.New(\"coordinate X is required\")\n\t}\n\n\tif jwk.Y == \"\" {\n\t\treturn errors.New(\"coordinate Y is required\")\n\t}\n\n\treturn nil\n}\n\n// encodeCurveBigInt encodes the private scalar D of an ECDSA key with padding.\nfunc encodeCurveBigInt(data *big.Int, curveBits int) string {\n\t// Determine the expected byte length for the curve\n\tbyteLength := curveBits / 8\n\t// Add one more byte if the bits are not a multiple of 8","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/webcrypto/jwk.go#L115-L151","documentation":"Error \"curve is required\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/webcrypto/jwk.go:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}