{"record":{"id":"9100f1b702ae3555","repo":"bytebase/bytebase","slug":"provider-type-is-required","errorCode":null,"errorMessage":"provider_type is required","messagePattern":"provider_type is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/api/v1/workload_identity_service.go","lineNumber":353,"sourceCode":"\t\tif jwksURL != \"\" {\n\t\t\tif err := wif.ValidateJWKSURL(jwksURL); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif len(config.AllowedAudiences) == 0 {\n\t\t\treturn errors.New(\"allowed_audiences is required for OIDC\")\n\t\t}\n\t\tfor _, audience := range config.AllowedAudiences {\n\t\t\tif strings.TrimSpace(audience) == \"\" {\n\t\t\t\treturn errors.New(\"allowed_audiences must not contain an empty value\")\n\t\t\t}\n\t\t}\n\t\tif strings.TrimSpace(config.SubjectPattern) == \"\" {\n\t\t\treturn errors.New(\"subject_pattern is required for OIDC\")\n\t\t}\n\t\treturn nil\n\tcase v1pb.WorkloadIdentityConfig_PROVIDER_TYPE_UNSPECIFIED:\n\t\treturn errors.New(\"provider_type is required\")\n\tdefault:\n\t\treturn errors.New(\"provider_type is invalid\")\n\t}\n}\n\n// convertToWorkloadIdentity converts a store.WorkloadIdentityMessage to a v1pb.WorkloadIdentity.\nfunc convertToWorkloadIdentity(wi *store.WorkloadIdentityMessage) *v1pb.WorkloadIdentity {\n\tresult := &v1pb.WorkloadIdentity{\n\t\tName:  common.FormatWorkloadIdentityEmail(wi.Email),\n\t\tState: convertDeletedToState(wi.MemberDeleted),\n\t\tEmail: wi.Email,\n\t\tTitle: wi.Name,\n\t}\n\n\t// Convert workload identity config\n\tif wi.Config != nil {\n\t\tresult.WorkloadIdentityConfig = convertToAPIWorkloadIdentityConfig(wi.Config)\n\t}","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/bytebase/bytebase/blob/1870550677fe08f0d2a78c07acd27541464eb945/backend/api/v1/workload_identity_service.go#L335-L371","documentation":"validateWorkloadIdentityConfig discriminator check: provider_type was left as PROVIDER_TYPE_UNSPECIFIED. A config must commit to a concrete provider type (OIDC, etc.) before its provider-specific fields are meaningful.","triggerScenarios":"Thrown at backend/api/v1/workload_identity_service.go:353 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set provider_type to a supported value such as OIDC"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1870550677fe08f0d2a78c07acd27541464eb945","analyzedAt":"2026-09-06T21:16:13.665Z","contentChangedAt":"2026-09-06T21:16:13.665Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}