Skip to content

Commit

Permalink
Make SCRAM-SHA-256/512 SASL Mechanisms available. (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
forsberg authored Nov 13, 2020
1 parent 40237be commit 8c225a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions faust/types/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class AuthProtocol(Enum):
class SASLMechanism(Enum):
PLAIN = "PLAIN"
GSSAPI = "GSSAPI"
SCRAM_SHA_256 = "SCRAM-SHA-256"
SCRAM_SHA_512 = "SCRAM-SHA-512"


AUTH_PROTOCOLS_SSL = {AuthProtocol.SSL, AuthProtocol.SASL_SSL}
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ class test_SASLCredentials:
"protocol": AuthProtocol.SASL_SSL,
},
),
pytest.param(
"SCRAM-SHA-512 supported",
SASLCredentials(
username="george",
password="pw1",
mechanism=SASLMechanism.SCRAM_SHA_512,
),
{"mechanism": SASLMechanism.SCRAM_SHA_512},
),
],
)
def test_constructor(self, credentials, expected_fields, reason):
Expand Down

0 comments on commit 8c225a8

Please sign in to comment.