aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/Testing
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-20 16:47:17 +0800
committer杨宇千 <crupest@outlook.com>2019-10-20 16:47:17 +0800
commit4c1a20746abc3354d67ffd7ef65e8639e70cd63a (patch)
tree504d77d6210fd0d0a251dcf232231d96a0990c54 /Timeline/Controllers/Testing
parent9bc08731aad112f100bcbc105f2cca910948651f (diff)
downloadtimeline-4c1a20746abc3354d67ffd7ef65e8639e70cd63a.tar.gz
timeline-4c1a20746abc3354d67ffd7ef65e8639e70cd63a.tar.bz2
timeline-4c1a20746abc3354d67ffd7ef65e8639e70cd63a.zip
...
Diffstat (limited to 'Timeline/Controllers/Testing')
-rw-r--r--Timeline/Controllers/Testing/TestingAuthController.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/Timeline/Controllers/Testing/TestingAuthController.cs b/Timeline/Controllers/Testing/TestingAuthController.cs
new file mode 100644
index 00000000..488a3cff
--- /dev/null
+++ b/Timeline/Controllers/Testing/TestingAuthController.cs
@@ -0,0 +1,32 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Timeline.Authenticate;
+
+namespace Timeline.Controllers.Testing
+{
+ [Route("testing/auth")]
+ [ApiController]
+ public class TestingAuthController : Controller
+ {
+ [HttpGet("[action]")]
+ [Authorize]
+ public ActionResult Authorize()
+ {
+ return Ok();
+ }
+
+ [HttpGet("[action]")]
+ [UserAuthorize]
+ public new ActionResult User()
+ {
+ return Ok();
+ }
+
+ [HttpGet("[action]")]
+ [AdminAuthorize]
+ public ActionResult Admin()
+ {
+ return Ok();
+ }
+ }
+}