Move all 88 service modules (66 individual + 22 platform) from modules/kubernetes/<service>/ into their corresponding stack directories: - Service stacks: stacks/<service>/module/ - Platform stack: stacks/platform/modules/<service>/ This collocates module source code with its Terragrunt definition. Only shared utility modules remain in modules/kubernetes/: ingress_factory, setup_tls_secret, dockerhub_secret, oauth-proxy. All cross-references to shared modules updated to use correct relative paths. Verified with terragrunt run --all -- plan: 0 adds, 0 destroys across all 68 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
|
|
}
|