-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: authentication success for password
- Loading branch information
Showing
6 changed files
with
85 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const std = @import("std"); | ||
|
||
pub const AuthPlugin = enum { | ||
unspecified, | ||
mysql_native_password, | ||
sha256_password, | ||
caching_sha2_password, | ||
mysql_clear_password, | ||
unknown, | ||
|
||
pub fn fromName(name: []const u8) AuthPlugin { | ||
if (std.mem.eql(u8, name, "mysql_native_password")) { | ||
return .mysql_native_password; | ||
} else if (std.mem.eql(u8, name, "sha256_password")) { | ||
return .sha256_password; | ||
} else if (std.mem.eql(u8, name, "caching_sha2_password")) { | ||
return .caching_sha2_password; | ||
} else if (std.mem.eql(u8, name, "mysql_clear_password")) { | ||
return .mysql_clear_password; | ||
} else { | ||
return .unknown; | ||
} | ||
} | ||
}; | ||
|
||
pub const caching_sha2_password_public_key_request = 0x01; | ||
pub const caching_sha2_password_public_key_response = 0x02; | ||
pub const caching_sha2_password_scramble_success = 0x03; | ||
pub const caching_sha2_password_scramble_failure = 0x04; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters