This repository was archived by the owner on Feb 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at making the sftp-server into a module to be imported
- Loading branch information
1 parent
1e2ab56
commit f4f0cd6
Showing
8 changed files
with
110 additions
and
298 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,25 @@ | ||
package sftp_server | ||
|
||
type AuthenticationRequest struct { | ||
User string `json:"username"` | ||
Pass string `json:"password"` | ||
} | ||
|
||
type AuthenticationResponse struct { | ||
Server string `json:"server"` | ||
Token string `json:"token"` | ||
Permissions []string `json:"permissions"` | ||
} | ||
|
||
type InvalidCredentialsError struct { | ||
} | ||
|
||
func (ice InvalidCredentialsError) Error() string { | ||
return "the credentials provided were invalid" | ||
} | ||
|
||
func IsInvalidCredentialsError(err error) bool { | ||
_, ok := err.(*InvalidCredentialsError) | ||
|
||
return ok | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package server | ||
package sftp_server | ||
|
||
import ( | ||
"io" | ||
|
Oops, something went wrong.