I think nip42 is FINALLY working.
This commit is contained in:
@@ -176,32 +176,15 @@ int authenticate_admin_request(const char* auth_header) {
|
||||
return 0; // No auth header
|
||||
}
|
||||
|
||||
// Use unified request validation system for admin operations
|
||||
nostr_request_t request = {
|
||||
.operation = "admin",
|
||||
.auth_header = auth_header,
|
||||
.event = NULL,
|
||||
.resource_hash = NULL,
|
||||
.mime_type = NULL,
|
||||
.file_size = 0,
|
||||
.client_ip = getenv("REMOTE_ADDR"),
|
||||
.app_context = NULL
|
||||
};
|
||||
// NOTE: Authentication now handled by centralized validation system in main.c
|
||||
// This function is kept for compatibility but should receive validation results
|
||||
// from the centralized system rather than performing duplicate validation
|
||||
|
||||
nostr_request_result_t result;
|
||||
int auth_result = nostr_validate_request(&request, &result);
|
||||
// TODO: Modify to accept validation results from centralized system
|
||||
// For now, assume validation was successful if we reach here
|
||||
// and extract pubkey from global context or parameters
|
||||
|
||||
if (auth_result != NOSTR_SUCCESS || !result.valid) {
|
||||
return 0; // Authentication failed
|
||||
}
|
||||
|
||||
// Extract pubkey from validation result and verify admin status
|
||||
const char* event_pubkey = result.pubkey[0] ? result.pubkey : NULL;
|
||||
if (!event_pubkey) {
|
||||
return 0; // No pubkey available
|
||||
}
|
||||
|
||||
return verify_admin_pubkey(event_pubkey);
|
||||
return 0; // Temporarily disabled - needs integration with centralized system
|
||||
}
|
||||
|
||||
int verify_admin_pubkey(const char* event_pubkey) {
|
||||
|
||||
Reference in New Issue
Block a user