How to test custom auth policy?

I am writing a custom auth scheme
CREATE POLICY "asf i5g8hi_1" 
ON storage.objects FOR 
SELECT TO public USING 
(((bucket_id = 'results'::text) AND ((storage.foldername(name))[1] = 'results'::text)
AND (
    ((current_setting('request.headers'::text, true))::json ->> 'blah'::text) = 'bleep'
    )
) );


with some Python
url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_ANON_KEY")
supabase: Client = create_client(
    url, key, ClientOptions(headers={"blah": "bleep"}))
storage = supabase.storage()
buckets = storage.list_buckets()
results = storage.get_bucket("results")


but i am having trouble testing/debugging this.

Is there anyway to view the auth checking logs? Or to debug this at all?
Was this page helpful?