You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This endpoint falls under the `postpastes` ratelimit bucket.
122
+
The `postpastes` bucket has a default ratelimit of {__config['ratelimits']['postpastes']}, and a ratelimit of {__config['ratelimits']['authed_postpastes']} when signed in
This endpoint falls under the `postpastes` ratelimit bucket.
138
-
The `postpastes` bucket has a default ratelimit of {__config['ratelimits']['postpastes']}, and a ratelimit of {__config['ratelimits']['authed_postpastes']} when signed in
This endpoint falls under the `getpaste` ratelimit bucket.
174
+
The `getpaste` bucket has a default ratelimit of {__config['ratelimits']['getpaste']}, and a ratelimit of {__config['ratelimits']['authed_getpaste']} when signed in
This endpoint falls under the `getpaste` ratelimit bucket.
187
-
The `getpaste` bucket has a default ratelimit of {__config['ratelimits']['getpaste']}, and a ratelimit of {__config['ratelimits']['authed_getpaste']} when signed in
desc=f"""Get all pastes for the user you are signed in as via the Authorization header.
202
+
* Requires authentication.
203
+
204
+
This endpoint falls under the `getpaste` ratelimit bucket.
205
+
The `getpaste` bucket has a default ratelimit of {__config['ratelimits']['getpaste']}, and a ratelimit of {__config['ratelimits']['authed_getpaste']} when signed in
f"""Get all pastes for the user you are signed in as via the Authorization header.
216
-
* Requires authentication.
217
-
218
-
This endpoint falls under the `getpaste` ratelimit bucket.
219
-
The `getpaste` bucket has a default ratelimit of {__config['ratelimits']['getpaste']}, and a ratelimit of {__config['ratelimits']['authed_getpaste']} when signed in
220
-
"""
221
224
user=request.state.user
222
225
ifnotuser:
223
226
returnUJSONResponse({"error": "Unathorized", "notice": "You must be signed in to use this route"}, status_code=401)
@@ -227,6 +230,15 @@ async def get_all_pastes(
227
230
228
231
returnUJSONResponse({"pastes": pastes})
229
232
233
+
desc=f"""Edit a paste.
234
+
You must be the author of the paste (IE, the paste must be created under your account).
235
+
236
+
* Requires authentication
237
+
238
+
This endpoint falls under the `postpastes` ratelimit bucket.
239
+
The `postpastes` bucket has a default ratelimit of {__config['ratelimits']['postpastes']}, and a ratelimit of {__config['ratelimits']['authed_postpastes']} when signed in
You must be the author of the paste (IE, the paste must be created under your account).
250
-
251
-
* Requires authentication
252
-
253
-
This endpoint falls under the `postpastes` ratelimit bucket.
254
-
The `postpastes` bucket has a default ratelimit of {__config['ratelimits']['postpastes']}, and a ratelimit of {__config['ratelimits']['authed_postpastes']} when signed in
255
-
"""
256
261
author=request.state.user
257
262
ifnotauthor:
258
263
returnUJSONResponse({"error": "Unathorized", "notice": "You must be signed in to use this route"}, status_code=401)
@@ -271,6 +276,14 @@ async def edit_paste(
271
276
272
277
returnUJSONResponse(dict(paste[0]))
273
278
279
+
desc=f"""Deletes pastes on MystBin.
280
+
You must be the author of the paste (IE, the paste must be created under your account).
281
+
282
+
* Requires authentication.
283
+
284
+
This endpoint falls under the `deletepaste` ratelimit bucket.
285
+
The `deletepaste` bucket has a default ratelimit of {__config['ratelimits']['deletepaste']}, and a ratelimit of {__config['ratelimits']['authed_deletepaste']} when signed in
You must be the author of the paste (IE, the paste must be created under your account).
289
-
290
-
* Requires authentication.
291
-
292
-
This endpoint falls under the `deletepaste` ratelimit bucket.
293
-
The `deletepaste` bucket has a default ratelimit of {__config['ratelimits']['deletepaste']}, and a ratelimit of {__config['ratelimits']['authed_deletepaste']} when signed in
294
-
"""
295
301
user=request.state.user
296
302
ifnotuser:
297
303
returnUJSONResponse({"error": "Unathorized", "notice": "You must be signed in to use this route"}, status_code=401)
You must be the author of the pastes (IE, the pastes must be created under your account).
317
+
318
+
* Requires authentication.
319
+
320
+
This endpoint falls under the `deletepaste` ratelimit bucket.
321
+
The `deletepaste` bucket has a default ratelimit of {__config['ratelimits']['deletepaste']}, and a ratelimit of {__config['ratelimits']['authed_deletepaste']} when signed in
You must be the author of the pastes (IE, the pastes must be created under your account).
336
-
337
-
* Requires authentication.
338
-
339
-
This endpoint falls under the `deletepaste` ratelimit bucket.
340
-
The `deletepaste` bucket has a default ratelimit of {__config['ratelimits']['deletepaste']}, and a ratelimit of {__config['ratelimits']['authed_deletepaste']} when signed in
341
-
"""
342
350
# We will filter out the pastes that are authorized and unauthorized, and return a clear response
343
351
response= {"succeeded": [], "failed": []}
344
352
@@ -357,22 +365,24 @@ async def delete_pastes(
357
365
358
366
returnUJSONResponse(response, status_code=200)
359
367
368
+
desc=f"""
369
+
A compatibility endpoint to maintain hastbin compatibility. Depreciated in favour of /paste
370
+
This endpoint does not allow for syntax highlighting, multi-file, password protection, expiry, etc. Use the /paste endpoint for these features
371
+
372
+
This endpoint falls under the `postpastes` ratelimit bucket.
373
+
The `postpastes` bucket has a default ratelimit of {__config['ratelimits']['postpastes']}, and a ratelimit of {__config['ratelimits']['authed_postpastes']} when signed in
374
+
"""
360
375
361
376
@router.post(
362
377
"/documents",
363
378
tags=["pastes"],
364
379
deprecated=True,
365
380
response_description='{"key": "string"}',
381
+
name="Hastebin create paste",
382
+
description=desc
366
383
)
367
384
@limit("postpastes")
368
385
asyncdefcompat_create_paste(request: Request):
369
-
f"""
370
-
A compatibility endpoint to maintain hastbin compatibility. Depreciated in favour of /paste
371
-
This endpoint does not allow for syntax highlighting, multi-file, password protection, expiry, etc. Use the /paste endpoint for these features
372
-
373
-
This endpoint falls under the `postpastes` ratelimit bucket.
374
-
The `postpastes` bucket has a default ratelimit of {__config['ratelimits']['postpastes']}, and a ratelimit of {__config['ratelimits']['authed_postpastes']} when signed in
0 commit comments