1717use OCP \AppFramework \Http \Attribute \ApiRoute ;
1818use OCP \AppFramework \Http \Attribute \BruteForceProtection ;
1919use OCP \AppFramework \Http \Attribute \NoAdminRequired ;
20- use OCP \AppFramework \Http \Attribute \PublicPage ;
2120use OCP \AppFramework \Http \Attribute \UserRateLimit ;
2221use OCP \AppFramework \Http \DataResponse ;
2322use OCP \AppFramework \Http \FileDisplayResponse ;
@@ -54,7 +53,7 @@ public function __construct(
5453 *
5554 * 200: Returns availability status
5655 */
57- #[PublicPage ]
56+ #[NoAdminRequired ]
5857 #[ApiRoute(verb: 'GET ' , url: '/is_available ' , root: '/text2image ' )]
5958 public function isAvailable (): DataResponse {
6059 return new DataResponse ([
@@ -75,9 +74,8 @@ public function isAvailable(): DataResponse {
7574 * 200: Task scheduled successfully
7675 * 412: Scheduling task is not possible
7776 */
78- #[PublicPage ]
77+ #[NoAdminRequired ]
7978 #[UserRateLimit(limit: 20 , period: 120 )]
80- #[AnonRateLimit(limit: 5 , period: 120 )]
8179 #[ApiRoute(verb: 'POST ' , url: '/schedule ' , root: '/text2image ' )]
8280 public function schedule (string $ input , string $ appId , string $ identifier = '' , int $ numberOfImages = 8 ): DataResponse {
8381 $ task = new Task ($ input , $ appId , $ numberOfImages , $ this ->userId , $ identifier );
@@ -111,7 +109,7 @@ public function schedule(string $input, string $appId, string $identifier = '',
111109 * 200: Task returned
112110 * 404: Task not found
113111 */
114- #[PublicPage ]
112+ #[NoAdminRequired ]
115113 #[BruteForceProtection(action: 'text2image ' )]
116114 #[ApiRoute(verb: 'GET ' , url: '/task/{id} ' , root: '/text2image ' )]
117115 public function getTask (int $ id ): DataResponse {
@@ -143,7 +141,7 @@ public function getTask(int $id): DataResponse {
143141 * 200: Image returned
144142 * 404: Task or image not found
145143 */
146- #[PublicPage ]
144+ #[NoAdminRequired ]
147145 #[BruteForceProtection(action: 'text2image ' )]
148146 #[ApiRoute(verb: 'GET ' , url: '/task/{id}/image/{index} ' , root: '/text2image ' )]
149147 public function getImage (int $ id , int $ index ): DataResponse |FileDisplayResponse {
0 commit comments