https://discord.cloudflare.com logo
Join Discord
Powered by
# r2
  • l

    Loski

    03/31/2022, 12:28 AM
    Hope that makes sense
  • l

    Loski

    03/31/2022, 12:31 AM
    If needed I can share some more details via DM
  • v

    Vitali

    03/31/2022, 12:34 AM
    Ok. That's a bit different than what I was referring to which is cross account access for Cloudflare accounts. In this case it sounds like you have your own customers and they have accounts with you. What you would do is write a Worker to authorize the request (using whatever authorization mechanism you are using) to figure out which bucket the request has access to and then use the S3 API to upload to the right bucket. Or you could make your life even easier and use a single bucket that's bound into your worker and your authorization is at the prefix level. Unlike S3 and other providers, buckets are organizational boundaries only. Each key will have roughly independent performance of any other key (within the bucket or in a different bucket). Same kind of thing will eventually apply to things like object lifecycles. Of course you don't strictly need Workers. You could access R2 using the S3 endpoint from any server technology you want, just Workers will have the best performance and cost I think. Is that helpful?
  • l

    Loski

    03/31/2022, 12:39 AM
    We are still designing this component of the new website so we got plenty of room for changes; the main challenge we have is that some customers might not want us to have full control over the storage so, we have to safely store their credentials in our system; the recommended approach aws gave to us was setting up cross account access and storing the arn of the bucket and then giving the customer the identity to grant access to. Turns out that this approach works in azure and gcp but I'm unsure if it would work on cf as well
  • v

    Vitali

    03/31/2022, 12:47 AM
    Gotcha. It sounds like you're looking for to build a SaaS product that provides a solution for each platform (ie. existing Azure Blobs, S3, and GCS customers use your product but manage buckets on the platform of their choice),. We don't yet have a good story for that use-case. I can't recall if that's on the roadmap for GA later this year. I think you'll find out more once we announce Open Beta.
  • l

    Loski

    03/31/2022, 12:51 AM
    > It sounds like you're looking for to build a SaaS product that provides a solution for each platform Yeah, it's a SaaS platform; normally we have always managed the storage ourselves but we have seen some "bigger" customers prefer to have control of how their files are stored. > I think you'll find out more once we announce Open Beta. Amazing :D. We only started brainstorming features so maybe we have enough room to implement r2 by the time a beta is announced
  • v

    Vitali

    03/31/2022, 12:59 AM
    Are you also needing requester pays billing on requests?
  • v

    Vitali

    03/31/2022, 1:00 AM
    And what kind of access are you needing to the other account?
  • v

    Vitali

    03/31/2022, 1:01 AM
    ie. read + write restricted to one bucket, read to one bucket, or is read+write to all buckets/read to all buckets sufficient?
  • v

    Vitali

    03/31/2022, 1:02 AM
    For some reason I can't DM you.
  • l

    Loski

    03/31/2022, 1:03 AM
    I have it limited to only friends, just sent you a friend request
  • l

    Loski

    03/31/2022, 1:03 AM
    Just access to one bucket, read and write
  • e

    Erwin

    03/31/2022, 1:11 AM
    If you want those customers to give you access to one of their S3 buckets (or Azure/GCP equivalent), you can do that with regular API requests in a Worker..
  • v

    Vitali

    04/01/2022, 9:40 PM
    Happy Friday everyone. As we're starting to head towards Open Beta, I just wanted to give you guys a sneak peek at the bindings we'll be publishing next week: https://gist.github.com/vlovich/9620194cd3e42a41e79d4cacbf1856ab For users already onboarded in the private beta, you'll need to publish
    r2_public_beta_bindings
    sometime late next week (I'm not 100% sure when we'll allow such scripts - I'll keep you updated). Please provide feedback. There's a few spots I've spotted:
    R2Error
    stack
    is
    any
    instead of string (& in fact `name`/`message`/`stack` can probably be elided because of inheritance? not sure).
    R2Error
    code
    needs a documentation note. This code is the same code that the Cloudflare V4 API that will be documented.
    onlyIf
    needs a documentation note. The
    Headers
    it accepts require HTTP header names (`IfModifiedSince`/`IfNotModifiedSince` etc).
    R2Object
    writeHttpMetadata
    is missing a note. It writes out the headers from
    httpMetadata
    as you would expect (content-type, cache-control, etc) Same goes for
    httpMetadata
    on put (i.e.
    cache-control
    ->
    cacheControl
    ,
    expires
    ->
    cacheExpiry
    ). Note that S3 uses the HTTP "Expires" name but I think that confuses people into thinking that has something to do with lifecycle. It does not. It's simply the cache expiry metadata you associate with an object.
    R2PutOptions
    has
    md5
    and
    sha1
    as optionals to specify the digest of the body, but those are mutually exclusive and the type needs to be reified to reflect that (the runtime enforces this, it's just not reflected in the type system). Enjoy everyone!
  • v

    Vitali

    04/01/2022, 9:44 PM
    We've focused on a tight core set of functionality. The S3 API has some extra features currently (e.g. copy object, multipart uploads) but we wanted to keep the canvas a bit cleaner and make sure we kept good ergonomics for the API.
  • j

    James

    04/01/2022, 9:53 PM
    This is awesome! Content length is no longer a separate required argument to
    put
    it seems then - woot!
  • w

    Walshy | Pages

    04/01/2022, 10:11 PM
    No length anymore whooo
  • r

    raeesbhatti

    04/01/2022, 10:13 PM
    I'm building something that needs AWS S3, I'd love to try out R2, can I get access to the beta please!
  • i

    Isaac McFadyen | YYZ01

    04/01/2022, 10:25 PM
    ?r2
  • h

    Helpflare

    04/01/2022, 10:25 PM
    R2 is still in very early access, please do not ask to be added. There is no ETA for a public beta but watch out on the blog () or follow the #892058508097388544 channel!
  • i

    Isaac McFadyen | YYZ01

    04/01/2022, 10:25 PM
    @User ^
  • v

    Vitali

    04/01/2022, 11:57 PM
    You need to be careful though. The length of the
    ReadableStream
    must be known. For example, incoming request with a
    content-length
    and you're forwarding along the body. Or the response body of a fetch that has a
    content-length
    . Or the readable half of a
    FixedLengthStream
    transform stream.
  • v

    Vitali

    04/01/2022, 11:58 PM
    That is not a helpful bot. We're going to start opening things up for our loyal Discord users in advance of Open Beta. We're just trying to smooth out some rough edges right now that aren't fun.
  • j

    James

    04/02/2022, 12:00 AM
    Makes sense! We'll stand by for the update next week about updating our test scripts 🙂
  • w

    Walshy | Pages

    04/02/2022, 12:00 AM
    Will the API change be breaking or be in line with compat date? (For Worker binding)
  • w

    Walshy | Pages

    04/02/2022, 12:03 AM
    Oh I just read internally that the
    r2_public_beta_bindings
    is a compat flag right ok, makes sense
  • j

    James

    04/02/2022, 12:04 AM
    oh it's just a compat flag? Cool okay that's easy enough to update then 😄
  • v

    Vitali

    04/02/2022, 12:04 AM
    The public beta API and internal beta APIs are not source compatible. You will need to modify things (although hopefully simplifying at the same time). I've arbitrarily picked 4/18 as the time that
    r2_public_beta_bindings
    is on by default but for those that need to upgrade the compat date but keep the old bindings, you can opt to the old bindings via
    r2_internal_beta_bindings
    . Anyone starting should use the public beta bindings. The old ones are not as complete and have edges.
  • w

    Walshy | Pages

    04/02/2022, 12:04 AM
    Yep seems so, makes this nice and easy
  • v

    Vitali

    04/02/2022, 12:05 AM
    There's no "world broke please change". We learned our lesson 😉
1...141516...1050Latest