func (cgs *credentialGraphSet) NeedRotation() ([]envelope.Signed, error) {
	var needRotation []envelope.Signed

	for _, graphs := range cgs.graphs {
		var parents []identity.ID

		sort.Sort(graphSorter(graphs))
		for _, graph := range graphs {
			var activeCreds []envelope.Signed
			var err error
			activeCreds, parents, err = cgs.activeCreds(parents, graph)
			if err != nil {
				return nil, err
			}

			if len(activeCreds) > 0 && graph.HasRevocations() {
				needRotation = append(needRotation, activeCreds...)
			}
		}
	}

	return needRotation, nil
}
// NeedRotation returns a slice of Credentials that need to be rotated.
//
// A Credential needs to be rotated if its most recent set version is in a
// CredentialGraph version that contains a revocation of a user's share to
// that Keyring.
NeedRotation returns a slice of Credentials that need to be rotated.

A Credential needs to be rotated if its most recent set version is in a
CredentialGraph version that contains a revocation of a user's share to
that Keyring.
// NeedRotation returns a slice of Credentials that need to be rotated . // // A Credential needs to be rotated if its most recent set version is in a // CredentialGraph version that contains a revocation of a user ' s share to // that Keyring .
func (cgs *credentialGraphSet) NeedRotation() ([]envelope.Signed, error) {
	var needRotation []envelope.Signed
	for _, graphs := range cgs.graphs {
		var parents []identity.ID
		sort.Sort(graphSorter(graphs))
		for _, graph := range graphs {
			var activeCreds []envelope.Signed
			var err error
			activeCreds, parents, err = cgs.activeCreds(parents, graph)
			if err != nil {
				return nil, err
			}
			if len(activeCreds) > 0 && graph.HasRevocations() {
				needRotation = append(needRotation, activeCreds...)
			}
		}
	}
	return needRotation, nil
}
func ( cgs * credentialGraphSet ) NeedRotation ( ) ( [ ] envelope . Signed , error ) { var needRotation [ ] envelope . Signed for _ , graphs := range cgs . graphs { var parents [ ] identity . ID sort . Sort ( graphSorter ( graphs ) ) for _ , graph := range graphs { var activeCreds [ ] envelope . Signed var err error activeCreds , parents , err = cgs . activeCreds ( parents , graph ) if err != nil { return nil , err } if len ( activeCreds ) > 0 && graph . HasRevocations ( ) { needRotation = append ( needRotation , activeCreds ... ) } } } return needRotation , nil }
NeedRotation returns a slice of Credentials that need to be rotated.
NeedRotation returns a slice of Credentials that need to be rotated .