Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: authorizerdev/authorizer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.1.0
Choose a base ref
...
head repository: authorizerdev/authorizer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.2.0
Choose a head ref
  • 2 commits
  • 34 files changed
  • 1 contributor

Commits on Apr 3, 2026

  1. chore: fix chore build

    lakhansamani committed Apr 3, 2026
    Configuration menu
    Copy the full SHA
    d08594d View commit details
    Browse the repository at this point in the history
  2. feat: add Prometheus metrics, health checks, and readiness endpoints (#…

    …528)
    
    * feat: add prometheus metrics, health checks, and readiness endpoints
    
    - Add github.com/prometheus/client_golang dependency
    - Create internal/metrics package registering HTTPRequestsTotal, HTTPRequestDuration, AuthEventsTotal, and ActiveSessions collectors
    - Add HealthCheck(ctx) method to the storage.Provider interface and implement it for all six DB providers (sql, mongodb, arangodb, cassandradb, dynamodb, couchbase)
    - Replace the simple /health string handler with a storage-backed JSON liveness handler (/healthz) and a new readiness handler (/readyz)
    - Add MetricsMiddleware() and MetricsHandler() to the http_handlers.Provider interface and implement them
    - Register /healthz, /readyz, /metrics routes and MetricsMiddleware in the Gin router
    - Call metrics.Init() during server startup in cmd/root.go
    - Add integration tests for /healthz and /readyz endpoints
    
    * feat: add security metrics, GraphQL error tracking, and auth event instrumentation
    
    - Add security metrics (authorizer_security_events_total) for failed logins,
      invalid credentials, revoked accounts, and failed admin auth
    - Add GraphQL error metrics (authorizer_graphql_errors_total) to capture errors
      in HTTP 200 responses using gqlgen AroundOperations middleware
    - Add GraphQL operation duration histogram (authorizer_graphql_request_duration_seconds)
    - Add DB health check counter (authorizer_db_health_check_total)
    - Instrument auth handlers: login, signup, logout, admin_login, admin_logout,
      forgot_password, reset_password with metrics.RecordAuthEvent calls
    - Track active sessions gauge on login/signup (inc) and logout (dec)
    - Add helper functions RecordAuthEvent, RecordSecurityEvent, RecordGraphQLError
    - Make metrics.Init() idempotent with sync.Once for safe test usage
    - Migrate health_test.go from legacy getTestConfig to runForEachDB pattern
    - Add comprehensive integration tests for all metrics (TestMetricsEndpoint,
      TestMetricsMiddleware, TestDBHealthCheckMetrics, TestAuthEventMetrics,
      TestGraphQLErrorMetrics, TestAdminLoginMetrics, TestForgotPasswordMetrics)
    
    * feat: add audit logs and metrics to OAuth/token HTTP handlers
    
    - oauth_login.go: Add AuditOAuthLoginInitiatedEvent audit log + metrics
    - oauth_callback.go: Add AuditOAuthCallbackFailedEvent for error paths
      (user info failure, revoked account) + success/failure metrics
    - token.go: Add security metric for invalid_client + token success metrics
    - revoke_refresh_token.go: Add EventTokenRevoke metric on success
    - logout.go: Add EventLogout metric + ActiveSessions decrement
    - verify_email.go: Add AuditEmailVerifiedEvent audit log + metrics
    lakhansamani authored Apr 3, 2026
    Configuration menu
    Copy the full SHA
    4f8d1d5 View commit details
    Browse the repository at this point in the history
Loading