jihoonson commented on issue #9351: Adding CredentialsProvider, deprecating 
PasswordProvider
URL: https://github.com/apache/druid/issues/9351#issuecomment-585332595
 
 
   Hi @a2l007, I think the internal usage would be pretty much same. But, the 
user-facing configurations would be changed which I expect to achieve in this 
proposal. For example, let say we changed `AWSCredentialsConfig` to use the 
`CredentialsProvider` as below.
   
   ```java
   public class AWSCredentialsConfig
   {
     @JsonProperty
     @Deprecated
     private PasswordProvider accessKey = new DefaultPasswordProvider("");
   
     @JsonProperty
     @Deprecated
     private PasswordProvider secretKey = new DefaultPasswordProvider("");
   
     @JsonProperty
     private CredentialsProvider credentials = new DefaultCredentialsProvider();
   ...
   }
   ```
   
   Then, the s3 credentials configurations would be changed from 
`druid.s3.accessKey` and `druid.s3.secretKey` to 
`druid.s3.credentials.accessKey` and `druid.s3.credentials.secretKey`, 
respectively.
   
   `HttpInputSource` is another example on the ingestion spec side.
   
   ```java
     @JsonCreator
     public HttpInputSource(
         @JsonProperty("uris") List<URI> uris,
         @JsonProperty("httpAuthenticationUsername") @Deprecated @Nullable 
String httpAuthenticationUsername,
         @JsonProperty("httpAuthenticationPassword") @Deprecated @Nullable 
PasswordProvider httpAuthenticationPasswordProvider,
         @JsonProperty("httpAuthentication") @Nullable CredentialsProvider 
httpAuthentication
     )
   ```
   
   The new `httpAuthentication` will be a JSON object that has two fields of 
`userName` and `password`. As a result, the ingestion spec would be changed from
   
   ```json
         "inputSource": {
           "type": "http",
           "uris": ["http://example.com/uri1";, "http://example2.com/uri2";],
           "httpAuthenticationUsername": "username",
           "httpAuthenticationPassword": {
             "type": "environment",
             "variable": "MY_PASSWORD_VAR"
           }
         }
   ```
   
   to
   
   ```json
         "inputSource": {
           "type": "http",
           "uris": ["http://example.com/uri1";, "http://example2.com/uri2";],
           "httpAuthentication": {
             "type": "environment",
             "userNameVariable": "MY_USER_NAME_VAR",
             "passwordVariable": "MY_PASSWORD_VAR"
           }
         }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to