Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Jan 16, 2025
1 parent 9a40deb commit 336ebf3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions catalyst-gateway/bin/src/service/api/documents/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use put_document::{bad_put_request::PutDocumentBadRequest, MAXIMUM_DOCUMENT_SIZE

use crate::service::{
common::{
auth::none_or_rbac::NoneOrRBAC,
auth::{none_or_rbac::NoneOrRBAC, rbac::scheme::CatalystRBACSecurityScheme},
tags::ApiTags,
types::{
generic::{
Expand Down Expand Up @@ -51,7 +51,7 @@ impl DocumentApi {
/// version.
version: Query<Option<UUIDv7>>,
/// No Authorization required, but Token permitted.
_auth: NoneOrRBAC,
_auth: CatalystRBACSecurityScheme,
) -> get_document::AllResponses {
let Ok(doc_id) = document_id.0.try_into() else {
let err = anyhow!("Invalid UUIDv7"); // Should not happen as UUIDv7 is validating.
Expand All @@ -78,7 +78,7 @@ impl DocumentApi {
&self, /// The document to PUT
document: Cbor<Body>,
/// Authorization required.
_auth: NoneOrRBAC,
_auth: CatalystRBACSecurityScheme,
) -> put_document::AllResponses {
match document.0.into_bytes_limit(MAXIMUM_DOCUMENT_SIZE).await {
Ok(doc_bytes) => put_document::endpoint(doc_bytes.to_vec()).await,
Expand Down Expand Up @@ -110,7 +110,7 @@ impl DocumentApi {
query: Json<DocumentIndexQueryFilterBody>,
page: Query<Option<Page>>, limit: Query<Option<Limit>>,
/// Authorization required.
_auth: NoneOrRBAC,
_auth: CatalystRBACSecurityScheme,
) -> post_document_index_query::AllResponses {
post_document_index_query::endpoint(query.0 .0, page.0, limit.0).await
}
Expand Down
8 changes: 7 additions & 1 deletion catalyst-gateway/tests/api_tests/api_tests/put_document.hurl
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
PUT http://localhost:3030/api/draft/document
Content-Type: application/cbor
hex, 845861A6012703183270636F6E74656E7420656E636F64696E676262726474797065D825500CE8AB3892584FBCA62E7FAA6E58318F626964D9800C500193929C1D227F1977FED19443841F0B63766572D9800C500193929C1D227F1977FED19443841F0BA0584E1B6D00209C05762C9B4E1EAC3DCA9286B50888CBDE8E99A2EB532C3A0D83D6F6462707ECDFF7F9B74B8904098479CA4221337F7DB97FDA25AFCC10ECB75722C91A485AAC1158BA6F90619221066C828347A104446B696431A0584090DF51433D97728ACF3851C5D3CA2908F76589EA925AF434C5619234E4B1BA7B12A124EA79503562B33214EBC730C9837E1CA909BB8163D7904B09C3FD6A5B0B8347A104446B696432A05840AB318FEF3FF46E69E760540B0B44E9E8A51A84F23EC8A870ECDEBF9AD98EBB8212EBE5EA5FDBA87C98DF8DF259BE7873FE8B9EB54CC6558337B5C95D90CC3504;
hex, 84585da503183270436f6e74656e742d456e636f64696e676262726474797065d82550913c9265f9f944fcb3cf9d9516ae9baf626964d8255001946ea1818a7e0eb6b16169f02ffd4e63766572d82550913c9265f9f944fcb3cf9d9516ae9bafa0581c8b0b807b22616765223a32392c226e616d65223a22416c6578227d0380;
HTTP 201

PUT http://localhost:3030/api/draft/document
Content-Type: application/cbor
hex, 84585da503183270436f6e74656e742d456e636f64696e676262726474797065d82550913c9265f9f944fcb3cf9d9516ae9baf626964d8255001946ea1818a7e0eb6b16169f02ffd4e63766572d82550913c9265f9f944fcb3cf9d9516ae9bafa0581c8b0b807b22616765223a32392c226e616d65223a22416c6578227d0380;
HTTP 204

0 comments on commit 336ebf3

Please sign in to comment.