feat: add private r2 bucket
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user