feat: add private r2 bucket

This commit is contained in:
Krispire Admin
2026-08-29 01:11:22 +05:30
parent 623935df22
commit 3b10e726b7
12 changed files with 731 additions and 14 deletions
+7
View File
@@ -100,6 +100,13 @@ func OptionalAuth(issuer *auth.Issuer, users *repository.UserRepo) func(http.Han
}
}
// WithUserID returns a context carrying userID, as RequireAuth would set it.
// The exported counterpart to UserID: it lets handlers be exercised in tests
// without standing up a JWT issuer and a user repository.
func WithUserID(ctx context.Context, userID string) context.Context {
return context.WithValue(ctx, userIDKey, userID)
}
// UserID returns the authenticated user's id from the request context.
// Returns "" if RequireAuth has not run.
func UserID(ctx context.Context) string {