Remove the module "xxx" { source = "./module" } indirection layer
from all 66 service stacks. Resources are now defined directly in
each stack's main.tf instead of through a wrapper module.
- Merge module/main.tf contents into stack main.tf
- Apply variable replacements (var.tier -> local.tiers.X, renamed vars)
- Fix shared module paths (one fewer ../ at each level)
- Move extra files/dirs (factory/, chart_values, subdirs) to stack root
- Update state files to strip module.<name>. prefix
- Update CLAUDE.md to reflect flat structure
Verified: terragrunt plan shows 0 add, 0 destroy across all stacks.
20 lines
372 B
Go
20 lines
372 B
Go
package auth
|
|
|
|
import (
|
|
"context"
|
|
|
|
"f1-stream/internal/models"
|
|
)
|
|
|
|
type contextKey string
|
|
|
|
const userKey contextKey = "user"
|
|
|
|
func ContextWithUser(ctx context.Context, user *models.User) context.Context {
|
|
return context.WithValue(ctx, userKey, user)
|
|
}
|
|
|
|
func UserFromContext(ctx context.Context) *models.User {
|
|
user, _ := ctx.Value(userKey).(*models.User)
|
|
return user
|
|
}
|