s4o @ 478a43f5aac26860669d16be34c712f05a747141

 1package main
 2
 3import (
 4	"fmt"
 5	"strings"
 6
 7	flag "github.com/spf13/pflag"
 8
 9	"git.sr.ht/~gabrielgio/s4o/server"
10)
11
12func main() {
13	var (
14		clientID     = flag.String("client-id", "", "Client ID")
15		clientSecret = flag.String("client-secret", "", "Client Secret")
16		issuer       = flag.String("issuer", "", "Issuer")
17		callback     = flag.String("callback", "http://localhost:3000/callback", "Callback")
18		addr         = flag.String("addr", ":3000", "serves HTTP requests from the given TCP addr")
19		scopes       = flag.String("scopes", "openid", "Scopes")
20		rootPath     = flag.String("rootPath", "./public", "Roo path")
21	)
22
23	flag.Parse()
24
25	scopeSlice := strings.Split(*scopes, " ")
26
27	fastServer, _ := server.NewS4OServer(
28		*clientID,
29		*clientSecret,
30		*issuer,
31		*callback,
32		*rootPath,
33		scopeSlice,
34	)
35
36	fmt.Println("Running server")
37	fastServer.ListenAndServe(*addr)
38}