Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions integration/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ async def get_user(self, username):
password = user.get("password")
return User(
name=username,
auth_string=NativePasswordAuthPlugin.create_auth_string(password)
if password
else None,
auth_string=(
NativePasswordAuthPlugin.create_auth_string(password)
if password
else None
),
auth_plugin=NativePasswordAuthPlugin.name,
)
elif auth_plugin == "authentication_kerberos":
Expand Down
1 change: 1 addition & 0 deletions mysql_mimic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of the mysql server wire protocol"""

from mysql_mimic.auth import (
User,
IdentityProvider,
Expand Down
14 changes: 14 additions & 0 deletions mysql_mimic/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,20 @@ async def auth(self, auth_info: Optional[AuthInfo] = None) -> AuthState:
yield Success(username)


class GSSAPIAuthPlugin(KerberosAuthPlugin):
"""
This plugin implements the Generic Security Service Application Program
Interface (GSS-API) by way of the Kerberos mechanism as described in
RFC1964(https://www.rfc-editor.org/rfc/rfc1964.html).

It uses the name of the GSSAPI plugin that the MariaDB client uses, but is
otherwise identical to KerberosAuthPlugin.
"""

name = "auth_gssapi"
client_plugin_name = "auth_gssapi_client"


class NoLoginAuthPlugin(AuthPlugin):
"""
Standard plugin that prevents all clients from direct login.
Expand Down
8 changes: 5 additions & 3 deletions mysql_mimic/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,11 @@ async def handle_stmt_fetch(self, data: bytes) -> None:

await self.stream.write(
self.ok_or_eof(
flags=types.ServerStatus.SERVER_STATUS_LAST_ROW_SENT
if done
else types.ServerStatus.SERVER_STATUS_CURSOR_EXISTS
flags=(
types.ServerStatus.SERVER_STATUS_LAST_ROW_SENT
if done
else types.ServerStatus.SERVER_STATUS_CURSOR_EXISTS
)
)
)

Expand Down
3 changes: 1 addition & 2 deletions mysql_mimic/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ class BaseInfoSchema:
Base InfoSchema interface used by the `Session` class.
"""

async def query(self, expression: exp.Expression) -> AllowedResult:
...
async def query(self, expression: exp.Expression) -> AllowedResult: ...


class InfoSchema(BaseInfoSchema):
Expand Down
7 changes: 3 additions & 4 deletions mysql_mimic/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from mysql_mimic.errors import MysqlError, ErrorCode


class Default:
...
# pylint: disable=multiple-statements
class Default: ...


VariableType = Callable[[Any], Any]
Expand Down Expand Up @@ -102,8 +102,7 @@ def list(self) -> list[tuple[str, str]]:

@property
@abc.abstractmethod
def schema(self) -> dict[str, VariableSchema]:
...
def schema(self) -> dict[str, VariableSchema]: ...


class GlobalVariables(Variables):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"pytest",
"pytest-asyncio",
"sphinx",
"sqlalchemy",
"sqlalchemy[asyncio]",
"twine",
"wheel",
],
Expand Down