Azure / azure-sdk-for-sap-odata

This repository serves as foundation to power SAP OData SDK development for .NET
MIT License
7 stars 2 forks source link

Add-apikey #26

Closed MartinPankraz closed 1 year ago

MartinPankraz commented 1 year ago

Purpose

Introduces API Key handling and solves #21

Does this solve an existing issue?

[x] Yes - Please add the reference: 
[ ] No

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
Use API Key protected OData service
maintain API Key and respective header name in appsettings.json
verify additional header gets added for instance checking azure-sdk-for-sap-odata\Dependencies\DataOperations.OData\Client\ODataHttpClientContext.cs

What to Check

WillEastbury commented 1 year ago

The API key looks a little unorthodox in terms of the interface usage, but it's ok enough to get out of the door for me, feels like in time we should split the API and Auth Headers or change the design into an IAuthHeaderAddingHandler that takes a set of parameters to inject to the request and / or a lambda or delegate to perform the fetch