fix(provision): harden batch scoping and remote43 import validation
This commit is contained in:
@@ -34,6 +34,24 @@ WHERE key = $(sql_literal "$api_key");
|
||||
SQL
|
||||
}
|
||||
|
||||
build_api_key_auth_cache_key() {
|
||||
local api_key="$1"
|
||||
local digest
|
||||
digest="$(printf '%s' "$api_key" | sha256sum | awk '{print $1}')"
|
||||
printf 'apikey:auth:%s' "$digest"
|
||||
}
|
||||
|
||||
build_user_balance_cache_key() {
|
||||
local user_id="$1"
|
||||
printf 'billing:balance:%s' "$user_id"
|
||||
}
|
||||
|
||||
build_subscription_billing_cache_key() {
|
||||
local user_id="$1"
|
||||
local group_id="$2"
|
||||
printf 'billing:sub:%s:%s' "$user_id" "$group_id"
|
||||
}
|
||||
|
||||
build_upsert_subscription_sql() {
|
||||
local user_id="$1"
|
||||
local group_id="$2"
|
||||
|
||||
Reference in New Issue
Block a user