getindata / flink-http-connector

Http Connector for Apache Flink. Provides sources and sinks for Datastream , Table and SQL APIs.
Apache License 2.0
136 stars 39 forks source link

HTTP-76 Allow enforcing the use of raw Authorization header #77

Closed AdrianVasiliu closed 3 months ago

AdrianVasiliu commented 3 months ago

Description

Introduce configuration parameter allowing to use the Authorization header without b64 and prefixing for Basic Authentication.

Context:

As documented, the connector currently processes the value set for the Authorization header as follows: it encodes it to Base64 and it prefixes it with "Basic ". The only case when this is not done is if the value is already prefixed with "Basic ". This is convenient for Basic Authentication, as it allows writing

'gid.connector.http.source.lookup.header.Authorization' = 'username:password'

without taking care of b64 and prefixing.

However, there is currently no way to enforce the use of the raw value of the Authorization header. This is necessary for use-cases where the called API needs the header to be set for other purposes than Basic Authentication, such as API key authentication.

Testing status:

Resolves #76

PR Checklist
kristoffSC commented 3 months ago

Thanks a lot for this PR @AdrianVasiliu This looks like a nice feature.

Give me some time and I will take a look.

kristoffSC commented 3 months ago

the build failed on adding jacoco report to PR. This is caused by fact that this PR comes from Forked repo. We would need to take a look at some point.

AdrianVasiliu commented 3 months ago

@kristoffSC Thanks a lot for the quick feedback!

the build failed on adding jacoco report to PR. This is caused by fact that this PR comes from Forked repo. We would need to take a look at some point.

Just tell if I can do something about it. I don't have permissions to push the branch to the repo.

kristoffSC commented 3 months ago

No, its all good. This was just a general info.

Seems that this is some repo setup issue not related with your pr.

I will leave the pr open for some time, maybe some one else will comment and I will merge it.