Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
penghuo committed Sep 27, 2023
1 parent c1febb6 commit 9f3a47b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
12 changes: 11 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ In the index mapping, the `_meta` and `properties`field stores meta and schema i
- `spark.datasource.flint.host`: default is localhost.
- `spark.datasource.flint.port`: default is 9200.
- `spark.datasource.flint.scheme`: default is http. valid values [http, https]
- `spark.datasource.flint.auth`: default is false. valid values [false, sigv4]
- `spark.datasource.flint.auth`: default is false. valid values [false, sigv4, basic]
- `spark.datasource.flint.auth.username`: basic auth username.
- `spark.datasource.flint.auth.password`: basic auth password.
- `spark.datasource.flint.region`: default is us-west-2. only been used when auth=sigv4
- `spark.datasource.flint.customAWSCredentialsProvider`: default is empty.
- `spark.datasource.flint.write.id_name`: no default value.
Expand Down Expand Up @@ -455,3 +457,11 @@ Flint use [DefaultAWSCredentialsProviderChain](https://docs.aws.amazon.com/AWSJa
--conf spark.emr-serverless.driverEnv.ASSUME_ROLE_CREDENTIALS_ROLE_ARN=arn:aws:iam::AccountB:role/CrossAccountRoleB \
--conf spark.executorEnv.ASSUME_ROLE_CREDENTIALS_ROLE_ARN=arn:aws:iam::AccountBB:role/CrossAccountRoleB
```

### Basic Auth
Add Basic Auth configuration when submit Spark Job. Replace username and password with correct one.
```
--conf spark.datasource.flint.auth=basic
--conf spark.datasource.flint.auth.username=username
--conf spark.datasource.flint.auth.password=password
```
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class FlintOptions implements Serializable {

public static final String BASIC_AUTH = "basic";

public static final String USERNAME = "username";
public static final String USERNAME = "auth.username";

public static final String PASSWORD = "password";
public static final String PASSWORD = "auth.password";

public static final String CUSTOM_AWS_CREDENTIALS_PROVIDER = "customAWSCredentialsProvider";

Expand Down Expand Up @@ -94,7 +94,11 @@ public String getCustomAwsCredentialsProvider() {
return options.getOrDefault(CUSTOM_AWS_CREDENTIALS_PROVIDER, "");
}

public String getUsername() {return options.getOrDefault(USERNAME, "flint");}
public String getUsername() {
return options.getOrDefault(USERNAME, "flint");
}

public String getPassword() {return options.getOrDefault(PASSWORD, "flint");}
public String getPassword() {
return options.getOrDefault(PASSWORD, "flint");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ object FlintSparkConf {
.doc("authentication type. supported value: NONE_AUTH(false), SIGV4_AUTH(sigv4), BASIC_AUTH")
.createWithDefault(FlintOptions.NONE_AUTH)

val USERNAME = FlintConfig("spark.datasource.flint.username")
val USERNAME = FlintConfig("spark.datasource.flint.auth.username")
.datasourceOption()
.doc("basic auth username")
.createWithDefault("flint")

val PASSWORD = FlintConfig("spark.datasource.flint.password")
val PASSWORD = FlintConfig("spark.datasource.flint.auth.password")
.datasourceOption()
.doc("basic auth password")
.createWithDefault("flint")
Expand Down

0 comments on commit 9f3a47b

Please sign in to comment.