-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added password generator. Finished and tested files, postgres and jwt…
… backends.
- Loading branch information
Ignacio Gómez
committed
Nov 30, 2017
1 parent
6d779bc
commit f495575
Showing
9 changed files
with
77 additions
and
25 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,3 @@ | ||
all: | ||
go build -buildmode=c-shared -o go-auth.so | ||
go build pw-gen/pw.go |
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,8 @@ | ||
# mosquitto-go-auth-plugin | ||
Go auth methods plugin for mosquitto using golang | ||
|
||
Build with: go build -buildmode=c-shared -o go-auth.so | ||
Build with: go build -buildmode=c-shared -o go-auth.so | ||
|
||
or simply: | ||
|
||
make |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
|
||
"github.com/iegomez/mosquitto-go-auth-plugin/common" | ||
) | ||
|
||
// saltSize defines the salt size | ||
const saltSize = 16 | ||
|
||
func main() { | ||
|
||
var algorithm = flag.String("a", "sha512", "algorithm (sha256 or default: sha512)") | ||
var HashIterations = flag.Int("i", 100000, "hash iterations (default: 100000)") | ||
var password = flag.String("p", "", "password") | ||
|
||
flag.Parse() | ||
|
||
pwHash, err := common.Hash(*password, saltSize, *HashIterations, *algorithm) | ||
if err != nil { | ||
fmt.Errorf("error: %s\n", err) | ||
} else { | ||
fmt.Println(pwHash) | ||
} | ||
|
||
} |