Skip to content

Commit 974ec90

Browse files
author
imtbkcat
committed
add string method
1 parent e307dad commit 974ec90

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

auth/auth.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ func (role *RoleIdentity) Restore(ctx *RestoreCtx) error {
7676
return nil
7777
}
7878

79+
// String converts UserIdentity to the format user@host.
80+
func (role *RoleIdentity) String() string {
81+
// TODO: Escape username and hostname.
82+
return fmt.Sprintf("%s@%s", role.Username, role.Hostname)
83+
}
84+
7985
// CheckScrambledPassword check scrambled password received from client.
8086
// The new authentication is performed in following manner:
8187
// SERVER: public_seed=create_random_string()

0 commit comments

Comments
 (0)