Files
documentdb/pg_documentdb/sql/udfs/auth/auth_scram--latest.sql
T
Shuai Tian 664afb487f Merged PR 1552984: [OSS] add auth scram functions back to oss and use internal schema
### Does this PR have any customer impact?

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

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

### Are you introducing any new config? If yes, do you have tests with and without them being set?

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

### Description

----
#### AI description  (iteration 1)
#### PR Classification
Code cleanup

#### PR Summary
This pull request moves the `auth_scram` functions back to the OSS directory and updates the relevant SQL files to reflect this change.
- Moved `auth_scram--1.14-0.sql` and `auth_scram--latest.sql` from `helio_api/pg_helio_api/sql/udfs/auth` to `oss/pg_documentdb/sql/udfs/auth`.
- Updated `pg_helio_api--1.12-0--1.13-0.sql` to include the new path for `auth_scram--1.14-0.sql`.
- Updated `pgmongo--1.13-2--1.14-0.sql` to include the new path for `auth_scram--1.14-0.sql`.
- Updated `documentdb--0.24-0.sql` to include the new path for `auth_scram--1.14-0.sql`.
2025-01-20 14:47:03 +08:00

22 lines
1.1 KiB
SQL

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