@@ -37,15 +37,15 @@ class SecretApiController extends OCSController {
3737
3838 use Errors;
3939
40- public function __construct (IRequest $ request ,
41- SecretService $ service ,
40+ public function __construct (IRequest $ request ,
41+ SecretService $ service ,
4242 ISession $ session ,
43- NotificationService $ notificationService ,
43+ NotificationService $ notificationService ,
4444 INotificationManager $ notificationManager ,
45- IURLGenerator $ urlGenerator ,
46- IAppManager $ appManager ,
47- LoggerInterface $ logger ,
48- ?string $ userId ) {
45+ IURLGenerator $ urlGenerator ,
46+ IAppManager $ appManager ,
47+ LoggerInterface $ logger ,
48+ ?string $ userId ) {
4949 parent ::__construct (Application::APP_ID , $ request );
5050 $ this ->service = $ service ;
5151 $ this ->notificationService = $ notificationService ;
@@ -54,7 +54,7 @@ public function __construct(IRequest $request,
5454 $ this ->urlGenerator = $ urlGenerator ;
5555 $ this ->logger = $ logger ;
5656 $ this ->session = $ session ;
57- $ this ->appVersion = $ appManager ->getAppInfo (Application::APP_ID )[" version " ];
57+ $ this ->appVersion = $ appManager ->getAppInfo (Application::APP_ID )[' version ' ];
5858 }
5959
6060 /**
@@ -82,8 +82,8 @@ public function getAll(): DataResponse {
8282 * @param string $uuid The uuid of the secret
8383 *
8484 * @return DataResponse<Http::STATUS_OK, SecretsData, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{message: string}, array{}>
85- * 200: Return secret with given uuid
86- * 404: Secret not found
85+ * 200: Return secret with given uuid
86+ * 404: Secret not found
8787 */
8888 public function get (string $ uuid ): DataResponse {
8989 return $ this ->handleNotFound (function () use ($ uuid ) {
@@ -98,7 +98,7 @@ public function get(string $uuid): DataResponse {
9898 * @NoCSRFRequired
9999 *
100100 * @return DataResponse<Http::STATUS_OK, array{version: string}, array{}>
101- * 200: Return application/api version
101+ * 200: Return application/api version
102102 *
103103 */
104104 #[AnonRateLimit(limit: 120 , period: 60 )]
@@ -116,9 +116,9 @@ public function getVersion(): DataResponse {
116116 * @param string|null $password The password for the secret share
117117 *
118118 * @return DataResponse<Http::STATUS_NOT_FOUND, array{message: string}, array{}>|DataResponse<Http::STATUS_UNAUTHORIZED, array{message: string}, array{}>|DataResponse<Http::STATUS_OK, array{iv: string, encrypted: string}, array{}>
119- * 200: Return requested secret
120- * 404: Secret not found for uuid
121- * 401: Unauthorized
119+ * 200: Return requested secret
120+ * 404: Secret not found for uuid
121+ * 401: Unauthorized
122122 *
123123 */
124124 #[UserRateLimit(limit: 500 , period: 60 )]
@@ -130,23 +130,23 @@ public function retrieveSharedSecret(string $uuid, ?string $password): DataRespo
130130 $ pwHash = null ;
131131 if ($ password ) {
132132 $ pwHash = $ this ->service ->verifyPassword ($ uuid , $ password );
133- if ($ pwHash === null ) {
134- $ pwHash = hash (" sha256 " , $ password . $ uuid );
135- }
133+ if ($ pwHash === null ) {
134+ $ pwHash = hash (' sha256 ' , $ password . $ uuid );
135+ }
136136 } elseif ($ this ->session ->get ('public_link_authenticated_token ' ) === $ uuid ) {
137137 $ pwHash = $ this ->session ->get ('public_link_authenticated_password_hash ' );
138138 } elseif ($ this ->session ->get ('public_link_authenticated_frontend ' )) {
139- $ authPayload = json_decode ($ this ->session ->get ('public_link_authenticated_frontend ' ));
140- $ pwHash = $ authPayload ->$ uuid ;
141- }
139+ $ authPayload = json_decode ($ this ->session ->get ('public_link_authenticated_frontend ' ));
140+ $ pwHash = $ authPayload ->$ uuid ;
141+ }
142142 try {
143143 $ secret = $ this ->service ->retrieveAndInvalidateSecret ($ uuid , $ pwHash );
144144 } catch (SecretNotFound $ e ) {
145- $ resp = new DataResponse ([" message " => " No secret with the given uuid was found " ], Http::STATUS_NOT_FOUND );
145+ $ resp = new DataResponse ([' message ' => ' No secret with the given uuid was found ' ], Http::STATUS_NOT_FOUND );
146146 $ resp ->throttle (['action ' => 'retrieval ' ]);
147147 return $ resp ;
148148 } catch (UnauthorizedException $ e ) {
149- $ resp = new DataResponse ([" message " => " Forbidden " ], Http::STATUS_UNAUTHORIZED );
149+ $ resp = new DataResponse ([' message ' => ' Forbidden ' ], Http::STATUS_UNAUTHORIZED );
150150 $ resp ->throttle (['action ' => 'password ' ]);
151151 return $ resp ;
152152 }
@@ -172,8 +172,8 @@ public function retrieveSharedSecret(string $uuid, ?string $password): DataRespo
172172 * @param ?string $password (Optional) password to protect the secret share
173173 *
174174 * @return DataResponse<Http::STATUS_CREATED, SecretsData, array{}>|DataResponse<Http::STATUS_UNAUTHORIZED, array{message: string}, array{}>
175- * 201: Secret created
176- * 401: Unauthorized
175+ * 201: Secret created
176+ * 401: Unauthorized
177177 */
178178 public function createSecret (string $ title , string $ encrypted , string $ iv , ?string $ expires , ?string $ password ) {
179179 if (!$ this ->userId ) {
@@ -190,8 +190,8 @@ public function createSecret(string $title, string $encrypted, string $iv, ?stri
190190 * @param string $title The new title of the secret
191191 *
192192 * @return DataResponse<Http::STATUS_OK, SecretsData, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{message: string}, array{}>
193- * 200: Return updated secret
194- * 404: Secret not found
193+ * 200: Return updated secret
194+ * 404: Secret not found
195195 */
196196 public function updateTitle (string $ uuid , string $ title ): DataResponse {
197197 return $ this ->handleNotFound (function () use ($ uuid , $ title ) {
@@ -206,8 +206,8 @@ public function updateTitle(string $uuid, string $title): DataResponse {
206206 * @param string $uuid The uuid of the secret
207207 *
208208 * @return DataResponse<Http::STATUS_OK, array{message: string}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{message: string}, array{}>
209- * 200: Secret deleted
210- * 404: Secret not found
209+ * 200: Secret deleted
210+ * 404: Secret not found
211211 */
212212 public function delete (string $ uuid ): DataResponse {
213213 try {
0 commit comments