Issue:
feat(auth): Add support for partial-auth, by facilitating injection of authentication parameters in headers

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description


Adding a wrapper over `ApiKeyAuth` and `PublishableKeyAuth` that provides an alternative to allow authentication being done outside the application. This is done by allowing the external entity (most likely a reverse proxy) to send the parameters necessary for the authentication of the request, there by reducing the need to perform db calls and improving the performance of the service.


<!-- Describe your changes in detail -->


### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?


<img width="1728" alt="image" src="https://github.com/juspay/hyperswitch/assets/51093026/ddb3cccf-c6e8-4870-99e9-dc225e6f4194">

Using a dummy service to generate a request and header parameters, and sending this parameter to the hyperswitch application without `api-key` and getting authenticated for the request.

![image](https://github.com/juspay/hyperswitch/assets/51093026/e14abd04-af29-487c-b33a-d6dac5c139e9)

```bash
curl --location 'https://sandbox.hyperswitch.io/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: bye123' \
--header 'x-key-id: dev_CCCCCCCCCCCCCCCCCCCC' \
--header 'x-auth-type: api_key' \
--header 'x-checksum: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef' \
--data-raw '{
  "amount": 6540,
  "currency": "USD",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 6540,
  "customer_id": "StripeCustomer",
  "email": "guest@example.com",
  "name": "John Doe",
  "phone": "999999999",
  "phone_country_code": "+1",
  "description": "Its my first payment request",
  "authentication_type": "no_three_ds",
  "return_url": "https://google.com",
  "payment_method": "card",
  "payment_method_type": "credit",
  "payment_method_data": {
    "card": {
      "card_number": "4242424242424242",
      "card_exp_month": "10",
      "card_exp_year": "25",
      "card_holder_name": "joseph Doe",
      "card_cvc": "123"
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}'
```

Here, you can see that the request was successful, but the payment failed. There by showcasing that the request was authenticated successfully.


<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible


Resolution:
<think>
PR Context:
- Title: feat(decision): add support to register api keys to proxy
- Merged: 2024-07-09T07:55:13Z
- Files changed: 7 files
- Commits: 8 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description

This PR adds support for exporting hashed api keys to the incoming proxy allowing for authentication outside the application facilitating detached authentication and ratelimiting 


### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the data
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(decision): add support to register api keys to proxy (#5168)
Files to modify:


**crates/router/src/configs/secrets_transformers.rs**
  Modify existing code

**crates/router/src/configs/settings.rs**
  Add:
    - struct: pub::DecisionConfig

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

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

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

**crates/router/src/services/authentication.rs**
  Add:
    - mod: pub::decision

**crates/router/src/services/authentication/decision.rs**
  Add:
    - function: pub::add_api_key
    - function: pub::add_publishable_key
    - function: private::call_decision_service
    - function: pub::revoke_api_key
    - function: pub::convert_expiry
    - function: pub::spawn_tracked_job
    - struct: pub::RuleRequest
    - struct: pub::RuleDeleteRequest
    - enum: pub::AuthType
    - enum: pub::AuthRuleType
    - enum: pub::Identifiers