[
https://issues.apache.org/jira/browse/HADOOP-19805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18063815#comment-18063815
]
ASF GitHub Bot commented on HADOOP-19805:
-----------------------------------------
deepujain opened a new pull request, #8305:
URL: https://github.com/apache/hadoop/pull/8305
### Summary
In `SignerFactory.createHttpSigner`, the HTTP signer instance was created
via reflection but `Configuration` was never passed to it. If the signer
implements Hadoop's `Configurable` interface, it should receive the
configuration via `setConf(conf)` so it can use config keys (e.g. custom
signing options). This aligns `createHttpSigner` with the existing behavior in
`createSigner`, which already calls `setConf` when the signer is `Configurable`.
### Change
- **File:**
`hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/SignerFactory.java`
- In `createHttpSigner`: after instantiating the HTTP signer, if the
instance is `Configurable`, call `setConf(conf)` before wrapping it in the auth
scheme.
- Use `getDeclaredConstructor().newInstance()` instead of deprecated
`clazz.newInstance()`; catch `ReflectiveOperationException` for reflection
failures.
### JIRA
Fixes HADOOP-19805
> When creating a signer, if it is Configurable, set its config
> -------------------------------------------------------------
>
> Key: HADOOP-19805
> URL: https://issues.apache.org/jira/browse/HADOOP-19805
> Project: Hadoop Common
> Issue Type: Sub-task
> Affects Versions: 3.4.3
> Reporter: Steve Loughran
> Assignee: Steve Loughran
> Priority: Trivial
> Labels: pull-request-available
> Fix For: 3.5.0, 3.4.3
>
>
> When creating a signer for s3 (or another service), if it is Configurable,
> call setConf() on it.
> This comes from me wiring s3a up to iceberg RestCatalog; it's pretty
> convoluted to connect a signer in the sdk to its owner fs otherwise, and so
> get the configuration for that bucket. Trivial change.
> (w.r.t the old convolutedness: a v1 issue). For v2 we can create and
> configure the signer then attach it: nothing else needed!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]