✨ Auth stuff
This commit is contained in:
10
pkg/main.go
10
pkg/main.go
@@ -2,9 +2,11 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/internal/auth"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/internal/database"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/internal/http"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/internal/kv"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex/sec"
|
||||
"github.com/fatih/color"
|
||||
"os"
|
||||
"os/signal"
|
||||
@@ -70,6 +72,14 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
// Read the public key for jwt
|
||||
if reader, err := sec.NewJwtReader(viper.GetString("security.public_key")); err != nil {
|
||||
log.Error().Err(err).Msg("An error occurred when reading public key for jwt. Authentication related features will be disabled.")
|
||||
} else {
|
||||
auth.JReader = reader
|
||||
log.Info().Msg("Jwt public key loaded.")
|
||||
}
|
||||
|
||||
// Server
|
||||
go server.NewServer().Listen()
|
||||
|
||||
|
Reference in New Issue
Block a user