https://supabase.com/ logo
Join Discord
Powered by
# python
  • b

    Brandon Braner

    09/15/2021, 11:36 PM
    Sounds good, if you don't come up with anything I'm putting together a pullrequest for gotrue-py with an idea
  • j

    jonhelge

    09/16/2021, 12:14 PM
    This is of interest in an application we are working on as well with fastapi towards a supabase backend
  • d

    dreinon

    09/16/2021, 10:27 PM
    I work everyday with FastAPI, anything I can help, just tell me 🙂
  • b

    Brandon Braner

    09/16/2021, 11:00 PM
    Hey @dreinon have you setup fastapi with supabase?
  • d

    dreinon

    09/16/2021, 11:00 PM
    yes
  • d

    dreinon

    09/16/2021, 11:00 PM
    Currently are haha
  • d

    dreinon

    09/16/2021, 11:01 PM
    But just a simple rest api
  • d

    dreinon

    09/16/2021, 11:01 PM
    although working fine 🙂
  • b

    Brandon Braner

    09/16/2021, 11:05 PM
    You may still be my hero. I have authentication setup with the FastApi OAuth2PasswordRequestForm. So I send a form data request with username and password and pass that to supabase, which returns my access token. I return the access token from the login endpoint. Now lets say I have an update to create something like an article. I pass the access token as a bearer token. However I cant seem to find away to setup the supbase client with the access token so I can access supabase as that user.
  • d

    dreinon

    09/16/2021, 11:07 PM
    Hmm, interesting question
  • d

    dreinon

    09/16/2021, 11:07 PM
    I'm not currently working with auth. Can't you just use the bearer token as the supabase-api-key?
  • d

    dreinon

    09/16/2021, 11:08 PM
    db: Client = create_client(supabase_url=db_url, supabase_key=db_api_key)
  • d

    dreinon

    09/16/2021, 11:08 PM
    the supabase_key here
  • b

    Brandon Braner

    09/16/2021, 11:10 PM
    I though so but it doesn't seem to respect row level security
  • b

    Brandon Braner

    09/16/2021, 11:16 PM
    actually I am getting invalid authentication credientals
  • d

    dreinon

    09/16/2021, 11:40 PM
    Oh 😦
  • b

    Brandon Braner

    09/16/2021, 11:41 PM
    I am also probably just dumb 🙂
  • j

    jason-lynx

    09/17/2021, 6:43 AM
    just saw and commented on your gist with a question
  • b

    Brandon Braner

    09/18/2021, 2:16 AM
    Hey Jason thank you. I responded. I should have been more explicit like 13 and forward is suppose to represent making an api call and trying to authenticate with the access token
  • d

    dreinon

    09/18/2021, 12:41 PM
    Hi!
  • d

    dreinon

    09/18/2021, 12:42 PM
    I would like to use storage. Is there a way to upload a text file directly from a string with Python client?
  • d

    dreinon

    09/18/2021, 12:42 PM
    It's an xml
  • d

    dreinon

    09/18/2021, 1:03 PM
    I'm not used to it
  • j

    J0

    09/18/2021, 6:25 PM
    oh! so just to clarify you have a file
    some_file.txt
    which contains XML and you'd like to upload the file to storage using a method which looks like
    .upload('some_file.txt')
    ?
  • j

    jcald

    09/19/2021, 6:16 PM
    Storage Overview# Supabase Storage makes it simple to store and serve large files. Files# Files can be any sort of media file. This includes images, GIFs, and videos. It is best practice to store files outside of your database because of their sizes. Folders# Folders are a way to organize your files (just like on your own computer). There is no right or wrong way to organize your files. You can store them in whichever folder structure suits your project. https://supabase.io/docs/guides/storage
  • d

    dreinon

    09/19/2021, 8:35 PM
    Sorry
  • d

    dreinon

    09/19/2021, 8:35 PM
    Didn't see your messages guys
  • d

    dreinon

    09/19/2021, 8:37 PM
    What I'm exactly doing is generating an xml content in a string which is meant to be saved in a local file, but since I want to upload it to a bucket, to avoid saving it to a temp file and uploading that file and then deleting it, I was thinking that maybe I could directly upload the string specifiying the path in the bucket
  • d

    dreinon

    09/19/2021, 8:38 PM
    Like: Upload string x into file folder1/file.xml
  • d

    dreinon

    09/20/2021, 9:43 PM
    Hey, did you guys understand what I wanted to say?
12345...19Latest