mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-06 12:46:31 +00:00
Update security in utoipa
This commit is contained in:
@ -89,7 +89,7 @@ pub(super) struct WebhookResults {
|
|||||||
get,
|
get,
|
||||||
path = "",
|
path = "",
|
||||||
tag = "Webhooks",
|
tag = "Webhooks",
|
||||||
security(("Bearer" = ["webhooks.get", "*.get", "*"])),
|
security(("Bearer" = ["webhooks.get", "webhooks.*", "*.get", "*"])),
|
||||||
responses(
|
responses(
|
||||||
(status = OK, description = "Webhooks are returned", body = WebhookResults, content_type = "application/json", example = json!({
|
(status = OK, description = "Webhooks are returned", body = WebhookResults, content_type = "application/json", example = json!({
|
||||||
"results": [
|
"results": [
|
||||||
@ -243,7 +243,7 @@ fn patch_webhook_inner(
|
|||||||
get,
|
get,
|
||||||
path = "/{uuid}",
|
path = "/{uuid}",
|
||||||
tag = "Webhooks",
|
tag = "Webhooks",
|
||||||
security(("Bearer" = ["webhooks.get", "*.get", "*"])),
|
security(("Bearer" = ["webhooks.get", "webhooks.*", "*.get", "*"])),
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Webhook found", body = WebhookWithMetadata, content_type = "application/json", example = json!({
|
(status = 200, description = "Webhook found", body = WebhookWithMetadata, content_type = "application/json", example = json!({
|
||||||
"uuid": "550e8400-e29b-41d4-a716-446655440000",
|
"uuid": "550e8400-e29b-41d4-a716-446655440000",
|
||||||
@ -279,7 +279,7 @@ async fn get_webhook(
|
|||||||
path = "",
|
path = "",
|
||||||
tag = "Webhooks",
|
tag = "Webhooks",
|
||||||
request_body = WebhookSettings,
|
request_body = WebhookSettings,
|
||||||
security(("Bearer" = ["webhooks.update", "*"])),
|
security(("Bearer" = ["webhooks.create", "webhooks.*", "*"])),
|
||||||
responses(
|
responses(
|
||||||
(status = 201, description = "Webhook created successfully", body = WebhookWithMetadata, content_type = "application/json", example = json!({
|
(status = 201, description = "Webhook created successfully", body = WebhookWithMetadata, content_type = "application/json", example = json!({
|
||||||
"uuid": "550e8400-e29b-41d4-a716-446655440000",
|
"uuid": "550e8400-e29b-41d4-a716-446655440000",
|
||||||
@ -335,7 +335,7 @@ async fn post_webhook(
|
|||||||
path = "/{uuid}",
|
path = "/{uuid}",
|
||||||
tag = "Webhooks",
|
tag = "Webhooks",
|
||||||
request_body = WebhookSettings,
|
request_body = WebhookSettings,
|
||||||
security(("Bearer" = ["webhooks.update", "*"])),
|
security(("Bearer" = ["webhooks.update", "webhooks.*", "*"])),
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Webhook updated successfully", body = WebhookWithMetadata, content_type = "application/json", example = json!({
|
(status = 200, description = "Webhook updated successfully", body = WebhookWithMetadata, content_type = "application/json", example = json!({
|
||||||
"uuid": "550e8400-e29b-41d4-a716-446655440000",
|
"uuid": "550e8400-e29b-41d4-a716-446655440000",
|
||||||
@ -389,7 +389,7 @@ async fn patch_webhook(
|
|||||||
delete,
|
delete,
|
||||||
path = "/{uuid}",
|
path = "/{uuid}",
|
||||||
tag = "Webhooks",
|
tag = "Webhooks",
|
||||||
security(("Bearer" = ["webhooks.update", "*"])),
|
security(("Bearer" = ["webhooks.delete", "webhooks.*", "*"])),
|
||||||
responses(
|
responses(
|
||||||
(status = 204, description = "Webhook deleted successfully"),
|
(status = 204, description = "Webhook deleted successfully"),
|
||||||
(status = 404, description = "Webhook not found", body = ResponseError, content_type = "application/json"),
|
(status = 404, description = "Webhook not found", body = ResponseError, content_type = "application/json"),
|
||||||
|
Reference in New Issue
Block a user