37 lines
779 B
Go
37 lines
779 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"libshared"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
type argonParams struct {
|
|
memory uint32
|
|
iterations uint32
|
|
parallelism uint8
|
|
keyLength uint32
|
|
}
|
|
|
|
func decodeHash(encoded string) (*argonParams, []byte, []byte, error) {
|
|
// Placeholder for PHC parsing implementation
|
|
return nil, nil, nil, errors.New("decodeHash not implemented")
|
|
}
|
|
|
|
func main() {
|
|
var err error
|
|
|
|
libshared.Pool = libshared.GetDbPool()
|
|
privateKey, err = libshared.LoadPrivateKey("keys/private.pem")
|
|
if err != nil {
|
|
log.Fatal("Failed to load private key:", err)
|
|
}
|
|
|
|
http.HandleFunc("/identity/create-local-identity", createLocalHandler)
|
|
http.HandleFunc("/identity/authenticate", authenticateHandler)
|
|
|
|
log.Println("server running on :8080")
|
|
http.ListenAndServe(":8080", nil)
|
|
}
|