diff --git a/cli/actions.go b/cli/actions.go index e5f3a6c..48c4ecf 100644 --- a/cli/actions.go +++ b/cli/actions.go @@ -13,7 +13,6 @@ import ( "strings" "time" - "github.com/davecgh/go-spew/spew" "github.com/howeyc/gopass" "github.com/immesys/wave/eapi" "github.com/immesys/wave/eapi/pb" @@ -145,7 +144,6 @@ func actionRTGrant(c *cli.Context) error { fmt.Printf("bad expiry\n") os.Exit(1) } - fmt.Printf("expires is %s\n", expires) attesterder := loadEntitySecretDER(c.String("attester")) subject, err := base64.URLEncoding.DecodeString(c.String("subject")) if err != nil { @@ -225,7 +223,6 @@ func actionRTGrant(c *cli.Context) error { fmt.Printf("attester file is not an entity secret\n") os.Exit(1) } - fmt.Printf("inspect hash was: %s\n", base64.URLEncoding.EncodeToString(inspectresponse.Entity.Hash)) //Get the attester location attesterresp, err := conn.ResolveHash(context.Background(), &pb.ResolveHashParams{ Hash: inspectresponse.Entity.Hash, @@ -694,7 +691,6 @@ func actionRTProve(c *cli.Context) error { if err == io.EOF { break } - spew.Dump(rv) fmt.Printf("Synchronized %d/%d entities\n", rv.CompletedSyncs, rv.TotalSyncRequests) } fmt.Printf("Perspective graph sync complete\n") diff --git a/cli/main.go b/cli/main.go index c17e5b7..38f78a4 100644 --- a/cli/main.go +++ b/cli/main.go @@ -6,7 +6,7 @@ import ( "github.com/urfave/cli" ) -const CLIVersion = "0.1.0" +const VersionFlag = "Prerelease 0.1.0" func main() { app := cli.NewApp() @@ -18,7 +18,7 @@ func main() { Value: "/etc/wave/wave.toml", }, } - app.Version = CLIVersion + app.Version = VersionFlag app.Flags = []cli.Flag{ cli.StringFlag{ Name: "agent", @@ -103,6 +103,10 @@ func main() { Usage: "the granting entity secrets", EnvVar: "WAVE_DEFAULT_ENTITY", }, + cli.StringFlag{ + Name: "indirections, indir", + Usage: "set how many redelegations is permitted", + }, cli.StringFlag{ Name: "subject", Usage: "the recipient entity hash", diff --git a/engine/states.go b/engine/states.go index 628b9be..3c71902 100644 --- a/engine/states.go +++ b/engine/states.go @@ -54,21 +54,29 @@ nextlocation: //There is nothing more in this queue on this location yet continue nextlocation } - //The object is probably an attestation - attestation, err := e.st.GetAttestation(e.ctx, loc, object) + //Check if we already know about this attestation + found, err := e.ws.GetAttestationP(e.ctx, object) if err != nil { return 0, err } - if attestation == nil { - //object was not an attestation, that is fine - } else { - //do not trigger a resync of dst, we are already syncing dst - err = e.insertPendingAttestationSync(attestation, false) + if found == nil { + //The object is probably an attestation + attestation, err := e.st.GetAttestation(e.ctx, loc, object) if err != nil { return 0, err } - changes++ + if attestation == nil { + //object was not an attestation, that is fine + } else { + //do not trigger a resync of dst, we are already syncing dst + err = e.insertPendingAttestationSync(attestation, false) + if err != nil { + return 0, err + } + changes++ + } } + err = e.ws.SetEntityQueueTokenP(sctx, loc, dest.Keccak256HI(), nextToken) if err != nil { panic(err) diff --git a/waved/waved.go b/waved/waved.go index 9f5c411..871cbe7 100644 --- a/waved/waved.go +++ b/waved/waved.go @@ -13,11 +13,14 @@ import ( "github.com/urfave/cli" ) +const VersionFlag = "Prerelease 0.1.0" + func Main(args []string) { app := cli.NewApp() app.Name = "waved" app.Usage = "Run a WAVE daemon" app.Action = action + app.Version = VersionFlag app.Flags = []cli.Flag{ cli.StringFlag{ Name: "config",