Files
documentdb/pg_helio_api/sql/udfs/auth/auth_scram--latest.sql
T
Mehmet Yilmaz 1224a287d6 Merged PR 1269280: [OSS] Move auth_scram functions to OSS
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactoring

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Move auth_scram functions to OSS
2024-02-23 14:49:18 +03:00

22 lines
1006 B
SQL

/* Authenticate using SCRAM SHA256 with postgresql db for a specific user name */
CREATE OR REPLACE FUNCTION helio_api.authenticate_with_scram_sha256(
p_user_name text, p_auth_msg text, p_client_proof text)
RETURNS helio_core.bson
LANGUAGE C
PARALLEL SAFE STABLE
AS 'MODULE_PATHNAME', $$command_authenticate_with_scram_sha256$$;
COMMENT ON FUNCTION helio_api.authenticate_with_scram_sha256(text, text, text)
IS 'Used to authenticate the user with Postgresql DB using SCRAM SHA-256';
/*
* helio_api.scram_sha256_get_salt_and_iterations() gets SALT and Iteration
* count for the given user from the Postgresql DB
*/
CREATE OR REPLACE FUNCTION helio_api.scram_sha256_get_salt_and_iterations(
p_user_name text)
RETURNS helio_core.bson
LANGUAGE C
PARALLEL SAFE STABLE
AS 'MODULE_PATHNAME', $$command_scram_sha256_get_salt_and_iterations$$;
COMMENT ON FUNCTION helio_api.scram_sha256_get_salt_and_iterations(text)
IS 'Gets SALT and Iteration count for the given user from the backend';