You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pgcrypto is loaded into a schema then pgjwt fails to find pgcrypto functions:
postgres=# create schema pgcrypto;
CREATE SCHEMA
postgres=# create extension pgcrypto with schema pgcrypto;
CREATE EXTENSION
postgres=# create schema pgjwt;
CREATE SCHEMA
postgres=# create extension pgjwt with schema pgjwt;
CREATE EXTENSION
postgres=# select pgjwt.sign('{}', 'foo');
ERROR: function hmac(text, text, text) does not exist
LINE 9: SELECT pgjwt.url_encode(hmac(signables, secret, alg.id)) FRO...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:
WITH
alg AS (
SELECT CASE
WHEN algorithm = 'HS256' THEN 'sha256'
WHEN algorithm = 'HS384' THEN 'sha384'
WHEN algorithm = 'HS512' THEN 'sha512'
ELSE '' END AS id) -- hmac throws error
SELECT pgjwt.url_encode(hmac(signables, secret, alg.id)) FROM alg;
CONTEXT: SQL function "algorithm_sign" during inlining
SQL function "sign" during startup
The text was updated successfully, but these errors were encountered:
This is likely due to a recent change made to postgrest that sets the search path for a request to only the api schema PostgREST/postgrest#1125
I'll release a fix for this that puts public back into the function paths, and add a note to the readme warning about having pgcrypto in another schema requires altering the functions.
When pgcrypto is loaded into a schema then pgjwt fails to find pgcrypto functions:
The text was updated successfully, but these errors were encountered: