mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 06:11:11 -05:00
Fix hash_session_ip function
This commit is contained in:
@@ -63,6 +63,7 @@ export type Database = {
|
|||||||
Row: {
|
Row: {
|
||||||
action: string
|
action: string
|
||||||
admin_user_id: string
|
admin_user_id: string
|
||||||
|
auth0_event_type: string | null
|
||||||
created_at: string
|
created_at: string
|
||||||
details: Json | null
|
details: Json | null
|
||||||
id: string
|
id: string
|
||||||
@@ -71,6 +72,7 @@ export type Database = {
|
|||||||
Insert: {
|
Insert: {
|
||||||
action: string
|
action: string
|
||||||
admin_user_id: string
|
admin_user_id: string
|
||||||
|
auth0_event_type?: string | null
|
||||||
created_at?: string
|
created_at?: string
|
||||||
details?: Json | null
|
details?: Json | null
|
||||||
id?: string
|
id?: string
|
||||||
@@ -79,6 +81,7 @@ export type Database = {
|
|||||||
Update: {
|
Update: {
|
||||||
action?: string
|
action?: string
|
||||||
admin_user_id?: string
|
admin_user_id?: string
|
||||||
|
auth0_event_type?: string | null
|
||||||
created_at?: string
|
created_at?: string
|
||||||
details?: Json | null
|
details?: Json | null
|
||||||
id?: string
|
id?: string
|
||||||
@@ -1968,6 +1971,7 @@ export type Database = {
|
|||||||
}
|
}
|
||||||
profiles: {
|
profiles: {
|
||||||
Row: {
|
Row: {
|
||||||
|
auth0_sub: string | null
|
||||||
avatar_image_id: string | null
|
avatar_image_id: string | null
|
||||||
avatar_url: string | null
|
avatar_url: string | null
|
||||||
ban_expires_at: string | null
|
ban_expires_at: string | null
|
||||||
@@ -2001,6 +2005,7 @@ export type Database = {
|
|||||||
username: string
|
username: string
|
||||||
}
|
}
|
||||||
Insert: {
|
Insert: {
|
||||||
|
auth0_sub?: string | null
|
||||||
avatar_image_id?: string | null
|
avatar_image_id?: string | null
|
||||||
avatar_url?: string | null
|
avatar_url?: string | null
|
||||||
ban_expires_at?: string | null
|
ban_expires_at?: string | null
|
||||||
@@ -2034,6 +2039,7 @@ export type Database = {
|
|||||||
username: string
|
username: string
|
||||||
}
|
}
|
||||||
Update: {
|
Update: {
|
||||||
|
auth0_sub?: string | null
|
||||||
avatar_image_id?: string | null
|
avatar_image_id?: string | null
|
||||||
avatar_url?: string | null
|
avatar_url?: string | null
|
||||||
ban_expires_at?: string | null
|
ban_expires_at?: string | null
|
||||||
@@ -4530,6 +4536,7 @@ export type Database = {
|
|||||||
Returns: undefined
|
Returns: undefined
|
||||||
}
|
}
|
||||||
backfill_sort_orders: { Args: never; Returns: undefined }
|
backfill_sort_orders: { Args: never; Returns: undefined }
|
||||||
|
block_aal1_with_mfa: { Args: never; Returns: boolean }
|
||||||
can_approve_submission_item: {
|
can_approve_submission_item: {
|
||||||
Args: { item_id: string }
|
Args: { item_id: string }
|
||||||
Returns: boolean
|
Returns: boolean
|
||||||
@@ -4601,6 +4608,8 @@ export type Database = {
|
|||||||
extract_cf_image_id: { Args: { url: string }; Returns: string }
|
extract_cf_image_id: { Args: { url: string }; Returns: string }
|
||||||
generate_deletion_confirmation_code: { Args: never; Returns: string }
|
generate_deletion_confirmation_code: { Args: never; Returns: string }
|
||||||
generate_ticket_number: { Args: never; Returns: string }
|
generate_ticket_number: { Args: never; Returns: string }
|
||||||
|
get_auth0_sub_from_jwt: { Args: never; Returns: string }
|
||||||
|
get_current_user_id: { Args: never; Returns: string }
|
||||||
get_email_change_status: { Args: never; Returns: Json }
|
get_email_change_status: { Args: never; Returns: Json }
|
||||||
get_filtered_profile: {
|
get_filtered_profile: {
|
||||||
Args: { _profile_user_id: string; _viewer_id?: string }
|
Args: { _profile_user_id: string; _viewer_id?: string }
|
||||||
@@ -4669,6 +4678,7 @@ export type Database = {
|
|||||||
Returns: Json
|
Returns: Json
|
||||||
}
|
}
|
||||||
has_aal2: { Args: never; Returns: boolean }
|
has_aal2: { Args: never; Returns: boolean }
|
||||||
|
has_auth0_mfa: { Args: never; Returns: boolean }
|
||||||
has_mfa_enabled: { Args: { _user_id: string }; Returns: boolean }
|
has_mfa_enabled: { Args: { _user_id: string }; Returns: boolean }
|
||||||
has_pending_dependents: { Args: { item_id: string }; Returns: boolean }
|
has_pending_dependents: { Args: { item_id: string }; Returns: boolean }
|
||||||
has_role: {
|
has_role: {
|
||||||
@@ -4684,6 +4694,7 @@ export type Database = {
|
|||||||
Args: { post_slug: string }
|
Args: { post_slug: string }
|
||||||
Returns: undefined
|
Returns: undefined
|
||||||
}
|
}
|
||||||
|
is_auth0_user: { Args: never; Returns: boolean }
|
||||||
is_moderator: { Args: { _user_id: string }; Returns: boolean }
|
is_moderator: { Args: { _user_id: string }; Returns: boolean }
|
||||||
is_superuser: { Args: { _user_id: string }; Returns: boolean }
|
is_superuser: { Args: { _user_id: string }; Returns: boolean }
|
||||||
is_user_banned: { Args: { _user_id: string }; Returns: boolean }
|
is_user_banned: { Args: { _user_id: string }; Returns: boolean }
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
-- Fix hash_session_ip to use pgcrypto from extensions schema
|
||||||
|
CREATE OR REPLACE FUNCTION public.hash_session_ip(session_ip inet)
|
||||||
|
RETURNS text
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
IMMUTABLE
|
||||||
|
SET search_path = 'public', 'extensions'
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
-- Return last 8 chars of SHA256 hash with asterisks prefix for privacy
|
||||||
|
RETURN '****' || RIGHT(encode(digest(session_ip::text || 'session_salt_2025', 'sha256'), 'hex'), 8);
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
Reference in New Issue
Block a user