Skip to content

Implement media service#8

Open
adrianpk wants to merge 29 commits into
mainfrom
feat/media-service
Open

Implement media service#8
adrianpk wants to merge 29 commits into
mainfrom
feat/media-service

Conversation

@adrianpk
Copy link
Copy Markdown
Contributor

@adrianpk adrianpk commented Nov 4, 2025

No description provided.

- Provide context helpers and middleware to guarantee X-Request-ID on inbound calls
- Propagate correlation identifiers in core HTTP client requests, including health probes
- Register the middleware across admin, authn, authz, and estate routers
- Document the tracing and correlation approach for future gateways
- Apply shared chi middleware stack with tracing, recovery, compression, and timeouts across services
- Emit structured request logs through the chi RequestLogger backed by the core logger
- Provide lightweight CORS helpers and enable credentialled calls for API services
- Disable browser caching on admin responses to reduce inadvertent form resubmissions
- Switch handler log helpers to use core.RequestIDFrom so correlation IDs never drop to empty strings
- Remove remaining chi RequestID middleware dependency across authn, authz, and estate handlers
- Introduce NewXParams across services so logger and config are mandatory while tracer defaults to core.NoopTracer()
- Add SetTracer helper to opt into custom tracing later without touching struct fields
- Update all callers/tests to use the accessors and seed the constructor
- Wire golangci-lint forbidigo rule to ban struct literals
- Move HTTP middleware helpers into pkg/lib/core so services import a single package
- Re-export ApplyStack/RedirectNotFound/DefaultCORSOptions directly from core and update all main entrypoints
- Add RedirectNotFound usage to admin and adjust tracing docs to the new file path
- Add core.NewRouter/NewWebRouter to preconfigure chi stacks from XParams providers
- Switch admin to web router variant (NoCache + RedirectNotFound) and APIs to the standard router factory
- Make NewRouter/NewWebRouter accept XParams
- Update service mains to call the new helpers
- Replace log.Fatal with explicit os.Exit(1) after logging structured errors
- Add core.Metrics with noop implementation and wire request metrics middleware into ApplyStack
- Extend XParams with Metrics()/SetMetrics() so services can pass real collectors
- Update router helpers to default StackOptions.Metrics from XParams
- Introduce Health Registry with dynamic liveness/readiness checks and richer probe responses
- Update Setup to return the registry and auto-register component checks
Integrate basic panic capture and reporter hook into core flow.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date:      Fri Oct 24 17:06:17 2025 +0200
#
# interactive rebase in progress; onto 65ca7b1
# Last command done (1 command done):
#    reword e405fa9 # Add error reporter plumbing
# Next commands to do (3 remaining commands):
#    reword 0bcf86e # Normalize core filenames
#    reword 48e26ff # Consolidate middleware into existing core files
# You are currently editing a commit while rebasing branch 'new/wip' on '65ca7b1'.
#
# Changes to be committed:
#	modified:   docs/draft/observability.md
#	new file:   pkg/lib/core/error_reporter.go
#	new file:   pkg/lib/core/error_reporting_middleware.go
#	modified:   pkg/lib/core/http_stack.go
#	modified:   pkg/lib/core/router.go
#	modified:   services/admin/internal/config/xparams.go
#	modified:   services/authn/internal/config/xparams.go
#	modified:   services/authz/internal/config/xparams.go
#	modified:   services/estate/internal/config/xparams.go
#
- Rename core helpers
- Update documentation reference accordingly
Estate Service:
- Add Classification, Location, Features, Price value objects
- Implement dictionary client interface with fake seed data

Admin Service:
- Add property CRUD operations in admin panel
- Create PropertyRepo interface with Fake and API implementations
- Add complete dictionary service for managing Sets and Options with hierarchical support.
- Include admin UI with CRUD operations for both entities.
@adrianpk adrianpk changed the title Introduce media service Implement media service Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant