SecurityMiddlewareController.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com>
  5. *
  6. * @author Joas Schilling <coding@schilljs.com>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. */
  23. namespace Test\AppFramework\Middleware\Security\Mock;
  24. use OCP\AppFramework\Http\Attribute\NoAdminRequired;
  25. use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
  26. use OCP\AppFramework\Http\Attribute\PublicPage;
  27. use OCP\AppFramework\Http\Attribute\StrictCookiesRequired;
  28. use OCP\AppFramework\Http\Attribute\SubAdminRequired;
  29. class SecurityMiddlewareController extends \OCP\AppFramework\Controller {
  30. /**
  31. * @PublicPage
  32. * @NoCSRFRequired
  33. */
  34. public function testAnnotationNoCSRFRequiredPublicPage() {
  35. }
  36. /**
  37. * @NoCSRFRequired
  38. */
  39. #[PublicPage]
  40. public function testAnnotationNoCSRFRequiredAttributePublicPage() {
  41. }
  42. /**
  43. * @PublicPage
  44. */
  45. #[NoCSRFRequired]
  46. public function testAnnotationPublicPageAttributeNoCSRFRequired() {
  47. }
  48. #[NoCSRFRequired]
  49. #[PublicPage]
  50. public function testAttributeNoCSRFRequiredPublicPage() {
  51. }
  52. public function testNoAnnotationNorAttribute() {
  53. }
  54. /**
  55. * @NoCSRFRequired
  56. */
  57. public function testAnnotationNoCSRFRequired() {
  58. }
  59. #[NoCSRFRequired]
  60. public function testAttributeNoCSRFRequired() {
  61. }
  62. /**
  63. * @PublicPage
  64. */
  65. public function testAnnotationPublicPage() {
  66. }
  67. #[PublicPage]
  68. public function testAttributePublicPage() {
  69. }
  70. /**
  71. * @PublicPage
  72. * @StrictCookieRequired
  73. */
  74. public function testAnnotationPublicPageStrictCookieRequired() {
  75. }
  76. /**
  77. * @StrictCookieRequired
  78. */
  79. #[PublicPage]
  80. public function testAnnotationStrictCookieRequiredAttributePublicPage() {
  81. }
  82. /**
  83. * @PublicPage
  84. */
  85. #[StrictCookiesRequired]
  86. public function testAnnotationPublicPageAttributeStrictCookiesRequired() {
  87. }
  88. #[PublicPage]
  89. #[StrictCookiesRequired]
  90. public function testAttributePublicPageStrictCookiesRequired() {
  91. }
  92. /**
  93. * @PublicPage
  94. * @NoCSRFRequired
  95. * @StrictCookieRequired
  96. */
  97. public function testAnnotationNoCSRFRequiredPublicPageStrictCookieRequired() {
  98. }
  99. #[NoCSRFRequired]
  100. #[PublicPage]
  101. #[StrictCookiesRequired]
  102. public function testAttributeNoCSRFRequiredPublicPageStrictCookiesRequired() {
  103. }
  104. /**
  105. * @NoCSRFRequired
  106. * @NoAdminRequired
  107. */
  108. public function testAnnotationNoAdminRequiredNoCSRFRequired() {
  109. }
  110. #[NoAdminRequired]
  111. #[NoCSRFRequired]
  112. public function testAttributeNoAdminRequiredNoCSRFRequired() {
  113. }
  114. /**
  115. * @NoCSRFRequired
  116. * @SubAdminRequired
  117. */
  118. public function testAnnotationNoCSRFRequiredSubAdminRequired() {
  119. }
  120. /**
  121. * @SubAdminRequired
  122. */
  123. #[NoCSRFRequired]
  124. public function testAnnotationNoCSRFRequiredAttributeSubAdminRequired() {
  125. }
  126. /**
  127. * @NoCSRFRequired
  128. */
  129. #[SubAdminRequired]
  130. public function testAnnotationSubAdminRequiredAttributeNoCSRFRequired() {
  131. }
  132. #[NoCSRFRequired]
  133. #[SubAdminRequired]
  134. public function testAttributeNoCSRFRequiredSubAdminRequired() {
  135. }
  136. /**
  137. * @PublicPage
  138. * @NoAdminRequired
  139. * @NoCSRFRequired
  140. */
  141. public function testAnnotationNoAdminRequiredNoCSRFRequiredPublicPage() {
  142. }
  143. #[NoAdminRequired]
  144. #[NoCSRFRequired]
  145. #[PublicPage]
  146. public function testAttributeNoAdminRequiredNoCSRFRequiredPublicPage() {
  147. }
  148. }