You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Ji-Xinyou (via GitHub)" <gi...@apache.org> on 2023/04/25 14:07:31 UTC

[GitHub] [incubator-opendal] Ji-Xinyou commented on a diff in pull request #2119: feat(services/supabase): Add read/write/stat support for supabase

Ji-Xinyou commented on code in PR #2119:
URL: https://github.com/apache/incubator-opendal/pull/2119#discussion_r1176573665


##########
core/src/services/supabase/backend.rs:
##########
@@ -0,0 +1,342 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::fmt::Debug;
+use std::sync::Arc;
+
+use async_trait::async_trait;
+use http::HeaderValue;
+use http::StatusCode;
+use log::debug;
+
+use super::core::*;
+use super::error::parse_error;
+use super::writer::*;
+use crate::ops::*;
+use crate::raw::*;
+use crate::*;
+
+/// Supabase service
+///
+/// # Capabilities
+///
+/// - [x] read
+/// - [x] write
+/// - [ ] copy
+/// - [ ] list
+/// - [ ] scan
+/// - [ ] presign
+/// - [ ] blocking
+///
+/// # Configuration
+///
+/// - `root`: Set the work dir for backend.
+/// - `bucket`: Set the container name for backend.
+/// - `endpoint`: Set the endpoint for backend.
+/// - `service_key`: Set the secret key for the backend, this is prioritized over the client key

Review Comment:
   > Hi, supabase doesn't allow calling `write` without `authorization`. Please try `read` a public bucket.
   
   Oops, I got your point. You are right.
   
   Another case, suppose we are calling read() on a path, the underlying operation would send a get request to a url.
   The authorized url and the public url is different, to be more specific, `/authenticated/bucket/wildcard` and /`public/bucket/wildcard`.
   Which function should we call? Since we are not bookeeping the key is anon_key or service_key.
   
   IMO, we should call the `public` one first, if failed, then call the `authenticated` one.
   
   What do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org