SecurityMiddlewareController.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace Test\AppFramework\Middleware\Security\Mock;
  8. use OCP\AppFramework\Http\Attribute\ExAppRequired;
  9. use OCP\AppFramework\Http\Attribute\NoAdminRequired;
  10. use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
  11. use OCP\AppFramework\Http\Attribute\PublicPage;
  12. use OCP\AppFramework\Http\Attribute\StrictCookiesRequired;
  13. use OCP\AppFramework\Http\Attribute\SubAdminRequired;
  14. class SecurityMiddlewareController extends \OCP\AppFramework\Controller {
  15. /**
  16. * @PublicPage
  17. * @NoCSRFRequired
  18. */
  19. public function testAnnotationNoCSRFRequiredPublicPage() {
  20. }
  21. /**
  22. * @NoCSRFRequired
  23. */
  24. #[PublicPage]
  25. public function testAnnotationNoCSRFRequiredAttributePublicPage() {
  26. }
  27. /**
  28. * @PublicPage
  29. */
  30. #[NoCSRFRequired]
  31. public function testAnnotationPublicPageAttributeNoCSRFRequired() {
  32. }
  33. #[NoCSRFRequired]
  34. #[PublicPage]
  35. public function testAttributeNoCSRFRequiredPublicPage() {
  36. }
  37. public function testNoAnnotationNorAttribute() {
  38. }
  39. /**
  40. * @NoCSRFRequired
  41. */
  42. public function testAnnotationNoCSRFRequired() {
  43. }
  44. #[NoCSRFRequired]
  45. public function testAttributeNoCSRFRequired() {
  46. }
  47. /**
  48. * @PublicPage
  49. */
  50. public function testAnnotationPublicPage() {
  51. }
  52. #[PublicPage]
  53. public function testAttributePublicPage() {
  54. }
  55. /**
  56. * @PublicPage
  57. * @StrictCookieRequired
  58. */
  59. public function testAnnotationPublicPageStrictCookieRequired() {
  60. }
  61. /**
  62. * @StrictCookieRequired
  63. */
  64. #[PublicPage]
  65. public function testAnnotationStrictCookieRequiredAttributePublicPage() {
  66. }
  67. /**
  68. * @PublicPage
  69. */
  70. #[StrictCookiesRequired]
  71. public function testAnnotationPublicPageAttributeStrictCookiesRequired() {
  72. }
  73. #[PublicPage]
  74. #[StrictCookiesRequired]
  75. public function testAttributePublicPageStrictCookiesRequired() {
  76. }
  77. /**
  78. * @PublicPage
  79. * @NoCSRFRequired
  80. * @StrictCookieRequired
  81. */
  82. public function testAnnotationNoCSRFRequiredPublicPageStrictCookieRequired() {
  83. }
  84. #[NoCSRFRequired]
  85. #[PublicPage]
  86. #[StrictCookiesRequired]
  87. public function testAttributeNoCSRFRequiredPublicPageStrictCookiesRequired() {
  88. }
  89. /**
  90. * @NoCSRFRequired
  91. * @NoAdminRequired
  92. */
  93. public function testAnnotationNoAdminRequiredNoCSRFRequired() {
  94. }
  95. #[NoAdminRequired]
  96. #[NoCSRFRequired]
  97. public function testAttributeNoAdminRequiredNoCSRFRequired() {
  98. }
  99. /**
  100. * @NoCSRFRequired
  101. * @SubAdminRequired
  102. */
  103. public function testAnnotationNoCSRFRequiredSubAdminRequired() {
  104. }
  105. /**
  106. * @SubAdminRequired
  107. */
  108. #[NoCSRFRequired]
  109. public function testAnnotationNoCSRFRequiredAttributeSubAdminRequired() {
  110. }
  111. /**
  112. * @NoCSRFRequired
  113. */
  114. #[SubAdminRequired]
  115. public function testAnnotationSubAdminRequiredAttributeNoCSRFRequired() {
  116. }
  117. #[NoCSRFRequired]
  118. #[SubAdminRequired]
  119. public function testAttributeNoCSRFRequiredSubAdminRequired() {
  120. }
  121. /**
  122. * @PublicPage
  123. * @NoAdminRequired
  124. * @NoCSRFRequired
  125. */
  126. public function testAnnotationNoAdminRequiredNoCSRFRequiredPublicPage() {
  127. }
  128. #[NoAdminRequired]
  129. #[NoCSRFRequired]
  130. #[PublicPage]
  131. public function testAttributeNoAdminRequiredNoCSRFRequiredPublicPage() {
  132. }
  133. /**
  134. * @ExAppRequired
  135. */
  136. public function testAnnotationExAppRequired() {
  137. }
  138. #[ExAppRequired]
  139. public function testAttributeExAppRequired() {
  140. }
  141. }