SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix(authz): improve error messages (#10856)
Vikrant Gupta918cf4dfe559
diff --git a/pkg/modules/serviceaccount/config.go b/pkg/modules/serviceaccount/config.goindex 5630fcc786..a4e03301f5 100644--- a/pkg/modules/serviceaccount/config.go+++ b/pkg/modules/serviceaccount/config.go@@ -32,7 +32,7 @@ func newConfig() factory.Config {Domain: "signozserviceaccount.com",},Analytics: AnalyticsConfig{- Enabled: true,+ Enabled: false,},}}diff --git a/pkg/types/serviceaccounttypes/factor_api_key.go b/pkg/types/serviceaccounttypes/factor_api_key.goindex 5bf39b0383..e9faf62e7b 100644--- a/pkg/types/serviceaccounttypes/factor_api_key.go+++ b/pkg/types/serviceaccounttypes/factor_api_key.go@@ -20,6 +20,7 @@ var (ErrCodeAPIKeyAlreadyExists = errors.MustNewCode("api_key_already_exists")ErrCodeAPIKeytNotFound = errors.MustNewCode("api_key_not_found")ErrCodeAPIKeyExpired = errors.MustNewCode("api_key_expired")+ errInvalidAPIKeyName = errors.New(errors.TypeInvalidInput, ErrCodeAPIKeyInvalidInput, "name must be 1–80 characters long and contain only lowercase letters (a-z) and hyphens (-)"))type FactorAPIKey struct {@@ -112,7 +113,7 @@ func (key *PostableFactorAPIKey) UnmarshalJSON(data []byte) error {}if match := factorAPIKeyNameRegex.MatchString(temp.Name); !match {- return errors.Newf(errors.TypeInvalidInput, ErrCodeAPIKeyInvalidInput, "name must conform to the regex: %s", factorAPIKeyNameRegex.String())+ return errInvalidAPIKeyName}if temp.ExpiresAt != 0 && time.Now().After(time.Unix(int64(temp.ExpiresAt), 0)) {@@ -132,7 +133,7 @@ func (key *UpdatableFactorAPIKey) UnmarshalJSON(data []byte) error {}if match := factorAPIKeyNameRegex.MatchString(temp.Name); !match {- return errors.Newf(errors.TypeInvalidInput, ErrCodeAPIKeyInvalidInput, "name must conform to the regex: %s", factorAPIKeyNameRegex.String())+ return errInvalidAPIKeyName}if temp.ExpiresAt != 0 && time.Now().After(time.Unix(int64(temp.ExpiresAt), 0)) {diff --git a/pkg/types/serviceaccounttypes/service_acccount.go b/pkg/types/serviceaccounttypes/service_acccount.goindex 7111a5f43c..7b67d70974 100644--- a/pkg/types/serviceaccounttypes/service_acccount.go+++ b/pkg/types/serviceaccounttypes/service_acccount.go@@ -23,6 +23,7 @@ var (ErrCodeServiceAccountNotFound = errors.MustNewCode("service_account_not_found")ErrCodeServiceAccountRoleAlreadyExists = errors.MustNewCode("service_account_role_already_exists")ErrCodeServiceAccountOperationUnsupported = errors.MustNewCode("service_account_operation_unsupported")+ errInvalidServiceAccountName = errors.New(errors.TypeInvalidInput, ErrCodeServiceAccountInvalidInput, "name must be 1–50 characters long and contain only lowercase letters (a-z) and hyphens (-)"))var (@@ -214,7 +215,7 @@ func (serviceAccount *PostableServiceAccount) UnmarshalJSON(data []byte) error {}if match := serviceAccountNameRegex.MatchString(temp.Name); !match {- return errors.Newf(errors.TypeInvalidInput, ErrCodeServiceAccountInvalidInput, "name must conform to the regex: %s", serviceAccountNameRegex.String())+ return errInvalidServiceAccountName}*serviceAccount = PostableServiceAccount(temp)