Skip to content

Commit

Permalink
Added sensitive annotations (apache#3866)
Browse files Browse the repository at this point in the history
  • Loading branch information
srkukarni authored Mar 26, 2019
1 parent 41d5af7 commit 8db0f86
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ public class CanalSourceConfig implements Serializable{
@FieldDoc(
required = true,
defaultValue = "",
sensitive = true,
help = "Username to connect to mysql database")
private String username;
@FieldDoc(
required = true,
defaultValue = "",
sensitive = true,
help = "Password to connect to mysql database")
private String password;
@FieldDoc(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
*/
String defaultValue();

/**
* Return if the field is a sensitive type or not.
* usernames/password/accesstokensm etc are some example of sensitive fields
* @return true if the field is sensitive, otherwise false
*/
boolean sensitive() default false;

/**
* Return the description of this field.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ public class ElasticSearchConfig implements Serializable {
@FieldDoc(
required = false,
defaultValue = "",
sensitive = true,
help = "The username used by the connector to connect to the elastic search cluster. If username is set, a password should also be provided."
)
private String username;

@FieldDoc(
required = false,
defaultValue = "",
sensitive = true,
help = "The password used by the connector to connect to the elastic search cluster. If password is set, a username should also be provided"
)
private String password;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ public class JdbcSinkConfig implements Serializable {
@FieldDoc(
required = false,
defaultValue = "",
sensitive = true,
help = "Username used to connect to the database specified by `jdbcUrl`"
)
private String userName;
@FieldDoc(
required = false,
defaultValue = "",
sensitive = true,
help = "Password used to connect to the database specified by `jdbcUrl`"
)
private String password;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class RedisAbstractConfig implements Serializable {
@FieldDoc(
required = false,
defaultValue = "",
sensitive = true,
help = "The password used to connect to Redis")
private String redisPassword;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class TwitterFireHoseConfig implements Serializable {
@FieldDoc(
required = true,
defaultValue = "",
sensitive = true,
help = "Your twitter app consumer key. See "
+ "https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens for details"
)
Expand All @@ -67,6 +68,7 @@ public class TwitterFireHoseConfig implements Serializable {
@FieldDoc(
required = true,
defaultValue = "",
sensitive = true,
help = "Your twitter app consumer secret. "
+ "See https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens for details"
)
Expand All @@ -75,6 +77,7 @@ public class TwitterFireHoseConfig implements Serializable {
@FieldDoc(
required = true,
defaultValue = "",
sensitive = true,
help = "Your twitter app token. "
+ "See https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens for details"
)
Expand All @@ -83,6 +86,7 @@ public class TwitterFireHoseConfig implements Serializable {
@FieldDoc(
required = true,
defaultValue = "",
sensitive = true,
help = "Your twitter app token secret. "
+ "See https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens for details"
)
Expand Down

0 comments on commit 8db0f86

Please sign in to comment.