Skip to content

Commit

Permalink
Add support for AstraAuthenticator
Browse files Browse the repository at this point in the history
  • Loading branch information
absurdfarce committed Jan 19, 2024
1 parent 769499e commit 96d23e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions proxycore/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ type passwordAuth struct {
password string
}

const dseAuthenticator = "com.datastax.bdp.cassandra.auth.DseAuthenticator"
const passwordAuthenticator = "org.apache.cassandra.auth.PasswordAuthenticator"
const astraAuthenticator = "org.apache.cassandra.auth.AstraAuthenticator"

func (d *passwordAuth) InitialResponse(authenticator string) ([]byte, error) {
switch authenticator {
case "com.datastax.bdp.cassandra.auth.DseAuthenticator":
case dseAuthenticator:
return []byte("PLAIN"), nil
case "org.apache.cassandra.auth.PasswordAuthenticator":
case passwordAuthenticator, astraAuthenticator:
return d.makeToken(), nil
}
return nil, fmt.Errorf("unknown authenticator: %v", authenticator)
Expand Down

0 comments on commit 96d23e4

Please sign in to comment.