diff --git a/token/delegation/delegationtest/data/TokenCarolDan_InvalidExpired.dagcbor b/token/delegation/delegationtest/data/TokenCarolDan_InvalidExpired.dagcbor index e6777d3..37f437e 100644 Binary files a/token/delegation/delegationtest/data/TokenCarolDan_InvalidExpired.dagcbor and b/token/delegation/delegationtest/data/TokenCarolDan_InvalidExpired.dagcbor differ diff --git a/token/delegation/delegationtest/data/TokenDanErin_InvalidExpired.dagcbor b/token/delegation/delegationtest/data/TokenDanErin_InvalidExpired.dagcbor index b74feda..ace6298 100644 Binary files a/token/delegation/delegationtest/data/TokenDanErin_InvalidExpired.dagcbor and b/token/delegation/delegationtest/data/TokenDanErin_InvalidExpired.dagcbor differ diff --git a/token/delegation/delegationtest/data/TokenErinFrank_InvalidExpired.dagcbor b/token/delegation/delegationtest/data/TokenErinFrank_InvalidExpired.dagcbor index 64b9328..d4aa37d 100644 Binary files a/token/delegation/delegationtest/data/TokenErinFrank_InvalidExpired.dagcbor and b/token/delegation/delegationtest/data/TokenErinFrank_InvalidExpired.dagcbor differ diff --git a/token/delegation/delegationtest/generator/generator.go b/token/delegation/delegationtest/generator/generator.go index 771346f..1f4a4ef 100644 --- a/token/delegation/delegationtest/generator/generator.go +++ b/token/delegation/delegationtest/generator/generator.go @@ -30,10 +30,11 @@ const ( var constantNonce = []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b} type newDelegationParams struct { - privKey crypto.PrivKey + privKey crypto.PrivKey // iss aud did.DID cmd command.Command pol policy.Policy + sub did.DID opts []delegation.Option } @@ -89,8 +90,8 @@ func (g *generator) chainPersonas(personas []didtest.Persona, acc acc, vari vari aud: personas[1].DID(), cmd: delegationtest.NominalCommand, pol: policytest.EmptyPolicy, + sub: didtest.PersonaAlice.DID(), opts: []delegation.Option{ - delegation.WithSubject(didtest.PersonaAlice.DID()), delegation.WithNonce(constantNonce), }, } @@ -117,7 +118,7 @@ func (g *generator) chainPersonas(personas []didtest.Persona, acc acc, vari vari p.cmd = delegationtest.AttenuatedCommand }}, {name: "InvalidSubject", variant: func(p *newDelegationParams) { - p.opts = append(p.opts, delegation.WithSubject(didtest.PersonaBob.DID())) + p.sub = didtest.PersonaBob.DID() }}, {name: "InvalidExpired", variant: func(p *newDelegationParams) { // Note: this makes the generator not deterministic @@ -161,7 +162,7 @@ func (g *generator) createDelegation(params newDelegationParams, name string, va return cid.Undef, err } - tkn, err := delegation.New(issDID, params.aud, params.cmd, params.pol, params.opts...) + tkn, err := delegation.New(issDID, params.aud, params.cmd, params.pol, params.sub, params.opts...) if err != nil { return cid.Undef, err } diff --git a/token/delegation/delegationtest/token_gen.go b/token/delegation/delegationtest/token_gen.go index 5983c6a..e5a924e 100644 --- a/token/delegation/delegationtest/token_gen.go +++ b/token/delegation/delegationtest/token_gen.go @@ -107,21 +107,21 @@ var ( ) var ( - TokenCarolDan_InvalidExpiredCID = cid.MustParse("bafyreigvdcarp6426e5aenal3q3c4uyhncwfbmt3fsmb4qzspkpjy57gti") + TokenCarolDan_InvalidExpiredCID = cid.MustParse("bafyreifyzm5jkx2sfu5awyndg3dn5zlg7sq5hssgfatafk62kiiilapnqe") TokenCarolDan_InvalidExpiredSealed = mustGetBundle(TokenCarolDan_InvalidExpiredCID).Sealed TokenCarolDan_InvalidExpiredBundle = mustGetBundle(TokenCarolDan_InvalidExpiredCID) TokenCarolDan_InvalidExpired = mustGetBundle(TokenCarolDan_InvalidExpiredCID).Decoded ) var ( - TokenDanErin_InvalidExpiredCID = cid.MustParse("bafyreifa265mung4nfpjjuiir5nytzgbrhfl66ye2dqmbq4p6dm7bzp4he") + TokenDanErin_InvalidExpiredCID = cid.MustParse("bafyreihhnisabmkofuk3qaw37leijxqjaz5or6v2cufjxwzdkvuvv2dzbq") TokenDanErin_InvalidExpiredSealed = mustGetBundle(TokenDanErin_InvalidExpiredCID).Sealed TokenDanErin_InvalidExpiredBundle = mustGetBundle(TokenDanErin_InvalidExpiredCID) TokenDanErin_InvalidExpired = mustGetBundle(TokenDanErin_InvalidExpiredCID).Decoded ) var ( - TokenErinFrank_InvalidExpiredCID = cid.MustParse("bafyreicde2per7ynjruvstuae67dxzdg2iepid3nonrmgr6tvodzpbqomu") + TokenErinFrank_InvalidExpiredCID = cid.MustParse("bafyreigeokaziviwm5kzmkpwesj3gta5k7zrd62x4a746fnrnkhvatwbna") TokenErinFrank_InvalidExpiredSealed = mustGetBundle(TokenErinFrank_InvalidExpiredCID).Sealed TokenErinFrank_InvalidExpiredBundle = mustGetBundle(TokenErinFrank_InvalidExpiredCID) TokenErinFrank_InvalidExpired = mustGetBundle(TokenErinFrank_InvalidExpiredCID).Decoded