Adds TLS support to Cassandra State Store (#3230)
Adds TLS support to Cassandra State Store
This commit is contained in:
parent
1f12557241
commit
ba5831b1ce
|
|
@ -62,15 +62,16 @@ type Cassandra struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type cassandraMetadata struct {
|
type cassandraMetadata struct {
|
||||||
Hosts []string
|
Hosts []string
|
||||||
Port int
|
Port int
|
||||||
ProtoVersion int
|
ProtoVersion int
|
||||||
ReplicationFactor int
|
ReplicationFactor int
|
||||||
Username string
|
Username string
|
||||||
Password string
|
Password string
|
||||||
Consistency string
|
Consistency string
|
||||||
Table string
|
Table string
|
||||||
Keyspace string
|
Keyspace string
|
||||||
|
EnableHostVerification bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCassandraStateStore returns a new cassandra state store.
|
// NewCassandraStateStore returns a new cassandra state store.
|
||||||
|
|
@ -136,6 +137,11 @@ func (c *Cassandra) createClusterConfig(metadata *cassandraMetadata) (*gocql.Clu
|
||||||
if metadata.Username != "" && metadata.Password != "" {
|
if metadata.Username != "" && metadata.Password != "" {
|
||||||
clusterConfig.Authenticator = gocql.PasswordAuthenticator{Username: metadata.Username, Password: metadata.Password}
|
clusterConfig.Authenticator = gocql.PasswordAuthenticator{Username: metadata.Username, Password: metadata.Password}
|
||||||
}
|
}
|
||||||
|
if metadata.EnableHostVerification {
|
||||||
|
clusterConfig.SslOpts = &gocql.SslOptions{
|
||||||
|
EnableHostVerification: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
clusterConfig.Port = metadata.Port
|
clusterConfig.Port = metadata.Port
|
||||||
clusterConfig.ProtoVersion = metadata.ProtoVersion
|
clusterConfig.ProtoVersion = metadata.ProtoVersion
|
||||||
cons, err := c.getConsistency(metadata.Consistency)
|
cons, err := c.getConsistency(metadata.Consistency)
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,11 @@ metadata:
|
||||||
description: "Port for communication."
|
description: "Port for communication."
|
||||||
default: "9042"
|
default: "9042"
|
||||||
example: "8080"
|
example: "8080"
|
||||||
|
- name: enableHostVerification
|
||||||
|
type: bool
|
||||||
|
description: "Enables host verification. Secures the traffic between client server with TLS."
|
||||||
|
default: "false"
|
||||||
|
example: "true"
|
||||||
- name: table
|
- name: table
|
||||||
type: string
|
type: string
|
||||||
description: "The name of the table to use."
|
description: "The name of the table to use."
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue