Adding attachment to identity

This commit is contained in:
2026-04-04 00:26:00 -04:00
parent 12fc1bc76d
commit 586dc12836
2 changed files with 7 additions and 3 deletions

4
go.mod
View File

@@ -3,16 +3,14 @@ module identity-manager
go 1.25.0 go 1.25.0
require ( require (
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/jackc/pgx/v5 v5.8.0 github.com/jackc/pgx/v5 v5.8.0
golang.org/x/crypto v0.49.0 golang.org/x/crypto v0.49.0
) )
require ( require (
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.42.0 // indirect golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.35.0 // indirect golang.org/x/text v0.35.0 // indirect
) )

View File

@@ -28,7 +28,13 @@ func main() {
log.Fatal("Failed to load private key:", err) log.Fatal("Failed to load private key:", err)
} }
publicKey, err = libshared.LoadPublicKey("keys/public.pem")
if err != nil {
log.Fatal("Failed to load public key:", err)
}
http.HandleFunc("/identity/create-local-identity", createLocalHandler) http.HandleFunc("/identity/create-local-identity", createLocalHandler)
http.HandleFunc("/identity/allow-role-to-identity", allowRoleToIdentityHandler)
http.HandleFunc("/identity/authenticate", authenticateHandler) http.HandleFunc("/identity/authenticate", authenticateHandler)
log.Println("server running on :8080") log.Println("server running on :8080")