3333use OCP \AppFramework \Http \Attribute \ApiRoute ;
3434use OCP \AppFramework \Http \Attribute \BruteForceProtection ;
3535use OCP \AppFramework \Http \Attribute \NoAdminRequired ;
36- use OCP \AppFramework \Http \Attribute \PublicPage ;
3736use OCP \AppFramework \Http \Attribute \UserRateLimit ;
3837use OCP \AppFramework \Http \DataResponse ;
3938use OCP \AppFramework \Http \FileDisplayResponse ;
@@ -69,7 +68,7 @@ public function __construct(
6968 *
7069 * 200: Returns availability status
7170 */
72- #[PublicPage ]
71+ #[NoAdminRequired ]
7372 #[ApiRoute(verb: 'GET ' , url: '/is_available ' , root: '/text2image ' )]
7473 public function isAvailable (): DataResponse {
7574 return new DataResponse ([
@@ -90,9 +89,8 @@ public function isAvailable(): DataResponse {
9089 * 200: Task scheduled successfully
9190 * 412: Scheduling task is not possible
9291 */
93- #[PublicPage ]
92+ #[NoAdminRequired ]
9493 #[UserRateLimit(limit: 20 , period: 120 )]
95- #[AnonRateLimit(limit: 5 , period: 120 )]
9694 #[ApiRoute(verb: 'POST ' , url: '/schedule ' , root: '/text2image ' )]
9795 public function schedule (string $ input , string $ appId , string $ identifier = '' , int $ numberOfImages = 8 ): DataResponse {
9896 $ task = new Task ($ input , $ appId , $ numberOfImages , $ this ->userId , $ identifier );
@@ -126,7 +124,7 @@ public function schedule(string $input, string $appId, string $identifier = '',
126124 * 200: Task returned
127125 * 404: Task not found
128126 */
129- #[PublicPage ]
127+ #[NoAdminRequired ]
130128 #[BruteForceProtection(action: 'text2image ' )]
131129 #[ApiRoute(verb: 'GET ' , url: '/task/{id} ' , root: '/text2image ' )]
132130 public function getTask (int $ id ): DataResponse {
@@ -158,7 +156,7 @@ public function getTask(int $id): DataResponse {
158156 * 200: Image returned
159157 * 404: Task or image not found
160158 */
161- #[PublicPage ]
159+ #[NoAdminRequired ]
162160 #[BruteForceProtection(action: 'text2image ' )]
163161 #[ApiRoute(verb: 'GET ' , url: '/task/{id}/image/{index} ' , root: '/text2image ' )]
164162 public function getImage (int $ id , int $ index ): DataResponse |FileDisplayResponse {
0 commit comments