-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Move credential checks to Connector interface (#3)
- Loading branch information
1 parent
2ec9f35
commit 2ec2361
Showing
10 changed files
with
56 additions
and
38 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ func main() { | |
server := gluon.New(filepath.Join(dir, "server")) | ||
|
||
connector := connector.NewDummy( | ||
"[email protected]", | ||
"password", | ||
time.Second, | ||
imap.NewFlagSet(), | ||
imap.NewFlagSet(), | ||
|
@@ -37,18 +39,18 @@ func main() { | |
logrus.WithError(err).Fatal("Failed to create store") | ||
} | ||
|
||
if err := server.AddUser( | ||
"userID", | ||
"username", | ||
"password", | ||
userID, err := server.AddUser( | ||
connector, | ||
store, | ||
dialect.SQLite, | ||
fmt.Sprintf("file:%v?cache=shared&_fk=1", filepath.Join(dir, fmt.Sprintf("%v.db", "userID"))), | ||
); err != nil { | ||
) | ||
if err != nil { | ||
logrus.WithError(err).Fatal("Failed to add user") | ||
} | ||
|
||
logrus.WithField("userID", userID).Info("User added to server") | ||
|
||
listener, err := net.Listen("tcp", ":1143") | ||
if err != nil { | ||
logrus.WithError(err).Fatal("Failed to listen") | ||
|
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
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