From 66533d799112831c12fd405563ff1f87483119d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Thu, 2 Feb 2017 22:21:39 +0100 Subject: [PATCH] Ignore requiresAuth attribute in RestInterfaceClient. Fixes #1648. Replaces #1649. (cherry picked from commit 992d699a777c0e89175d8fdcb9cb833b7f71a61f) --- source/vibe/web/internal/rest/common.d | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/vibe/web/internal/rest/common.d b/source/vibe/web/internal/rest/common.d index 6f11b562c9..6e35da21ff 100644 --- a/source/vibe/web/internal/rest/common.d +++ b/source/vibe/web/internal/rest/common.d @@ -250,7 +250,9 @@ import std.meta : anySatisfy, Filter; StaticRoute[routeCount] ret; - alias AUTHTP = AuthInfo!TImpl; + static if (is(TImpl == class)) + alias AUTHTP = AuthInfo!TImpl; + else alias AUTHTP = void; foreach (fi, func; RouteFunctions) { StaticRoute route; @@ -684,3 +686,13 @@ unittest { assert(baz.routes[1].fullPattern == "/bar/:barid/baz/test2"); assert(baz.routes[1].pathHasPlaceholders); } + +unittest { // #1648 + import vibe.web.auth; + + @requiresAuth + interface I { + void a(); + } + alias RI = RestInterface!I; +}