-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
48 lines (44 loc) · 1.25 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"fmt"
"github.com/Ink-33/authn/api"
"github.com/Ink-33/authn/api/raw"
"github.com/Ink-33/authn/cmd"
"github.com/Ink-33/authn/interact"
)
func main() {
fmt.Printf("Cli tool version: %v\n", cmd.Version)
fmt.Printf("WebAuthN API Version: %v\n", raw.GetAPIVersionNumber())
fmt.Printf("Is User Verifying Platform Authenticator Available: %v\n\n", raw.IsUserVerifyingPlatformAuthenticatorAvailable())
c := api.NewClient("go.webauthn.demo.app", "WebAuthN From Golang", "")
choices := interact.Choose{
Title: "Select operation:",
Choices: []interact.Choice{
interact.NewChoice(
"Make Credential",
func() (func(), error) { return cmd.MakeCred(c) },
),
interact.NewChoice(
"Show Authenticator Attestation Certificate",
func() (func(), error) { return cmd.ShowCertInfo(c) },
),
interact.NewChoice(
"Get Assertion",
func() (func(), error) { return cmd.GetAssertion(c) },
),
interact.NewChoice(
"Get Platform Credential List",
func() (func(), error) { return cmd.GetPlatformCredList(c) },
),
interact.NewChoice(
"Delete Platform Credential",
func() (func(), error) { return cmd.DeletePlatformCred(c) },
),
},
Loop: true,
}
_, err := choices.Do()
if err != nil {
panic(err)
}
}