This commit introduces V2 authentication mechanisms for various admin and client-side APIs :
- [x] Added V2AdminApiAuth and modified AdminApiAuthWithMerchantIdFromRoute for V2
- [x] Added V2ApiKeyAuth , V2AdminApiAuth and V2ClientAuth to the endpoints
- [x] Refactored functions to support V2 Auth as well as V1 Auth
To implement this **search_filter** feature, you'll need to modify these architectural layers:


**1. Core Business Logic**
   - `crates/router/src/core/errors.rs`

**2. Other**
   - `crates/router/src/routes/admin.rs`
   - `crates/router/src/routes/api_keys.rs`
   - `crates/router/src/routes/customers.rs`
   - ... and 5 more files

**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (9 changes)
- Extend existing types with new fields (42 changes)
- Add conditional logic for feature flags or filtering (2 changes)

**Detailed Identifier Changes:**


Commit 3667a7ff:
Files to modify:


**crates/router/src/core/errors.rs**
  Modify existing code

**crates/router/src/routes/admin.rs**
  Modify existing code

**crates/router/src/routes/api_keys.rs**
  Modify existing code

**crates/router/src/routes/customers.rs**
  Modify existing code

**crates/router/src/routes/ephemeral_key.rs**
  Modify existing code

**crates/router/src/routes/payment_methods.rs**
  Modify existing code

**crates/router/src/routes/payments.rs**
  Modify existing code

**crates/router/src/routes/routing.rs**
  Modify existing code

**crates/router/src/services/authentication.rs**
  Modify existing code
{"pr_number": 7487, "pr_title": "feat(core): Add V2 Authentication to all available endpoints", "merged_at": "2025-03-12T20:19:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "session"]}, "hierarchy": {"core_business": ["crates/router/src/core/errors.rs"], "other": ["crates/router/src/routes/admin.rs", "crates/router/src/routes/api_keys.rs", "crates/router/src/routes/customers.rs", "crates/router/src/routes/ephemeral_key.rs", "crates/router/src/routes/payment_methods.rs", "crates/router/src/routes/payments.rs", "crates/router/src/routes/routing.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"structs_added": 1, "functions_added": 9, "fields_added": 42, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}