func (w *Worklog) List(ctx context.Context, orgID *identity.ID) ([]apitypes.WorklogItem, error) {
	var items []apitypes.WorklogItem

	org, err := w.engine.client.Orgs.Get(ctx, orgID)
	if err != nil {
		return nil, err
	}

	projects, err := w.engine.client.Projects.List(ctx, orgID)
	if err != nil {
		return nil, err
	}

	cgs := newCredentialGraphSet()
	orgName := org.Body.(*primitive.Org).Name
	for _, project := range projects {
		projName := project.Body.(*primitive.Project).Name
		graphs, err := w.engine.client.CredentialGraph.Search(ctx,
			"/"+orgName+"/"+projName+"/*/*/*/*", w.engine.session.AuthID())
		if err != nil {
			return nil, err
		}

		err = cgs.Add(graphs...)
		if err != nil {
			return nil, err
		}
	}

	needRotation, err := cgs.NeedRotation()
	if err != nil {
		return nil, err
	}

	for _, cred := range needRotation {
		base, err := baseCredential(&cred)
		if err != nil {
			return nil, err
		}

		item := apitypes.WorklogItem{
			Subject: base.PathExp.String() + "/" + base.Name,
			Summary: "A user's access was revoked. This secret's value should be changed.",
		}
		item.CreateID(apitypes.SecretRotateWorklogType)

		items = append(items, item)
	}

	return items, nil
}
// List returns the list of all outstanding worklog items for the given org
List returns the list of all outstanding worklog items for the given org
// List returns the list of all outstanding worklog items for the given org
func (w *Worklog) List(ctx context.Context, orgID *identity.ID) ([]apitypes.WorklogItem, error) {
	var items []apitypes.WorklogItem
	org, err := w.engine.client.Orgs.Get(ctx, orgID)
	if err != nil {
		return nil, err
	}
	projects, err := w.engine.client.Projects.List(ctx, orgID)
	if err != nil {
		return nil, err
	}
	cgs := newCredentialGraphSet()
	orgName := org.Body.(*primitive.Org).Name
	for _, project := range projects {
		projName := project.Body.(*primitive.Project).Name
		graphs, err := w.engine.client.CredentialGraph.Search(ctx,
			"/"+orgName+"/"+projName+"/*/*/*/*", w.engine.session.AuthID())
		if err != nil {
			return nil, err
		}
		err = cgs.Add(graphs...)
		if err != nil {
			return nil, err
		}
	}
	needRotation, err := cgs.NeedRotation()
	if err != nil {
		return nil, err
	}
	for _, cred := range needRotation {
		base, err := baseCredential(&cred)
		if err != nil {
			return nil, err
		}
		item := apitypes.WorklogItem{
			Subject: base.PathExp.String() + "/" + base.Name,
			Summary: "A user's access was revoked. This secret's value should be changed.",
		}
		item.CreateID(apitypes.SecretRotateWorklogType)
		items = append(items, item)
	}
	return items, nil
}
func ( w * Worklog ) List ( ctx context . Context , orgID * identity . ID ) ( [ ] apitypes . WorklogItem , error ) { var items [ ] apitypes . WorklogItem org , err := w . engine . client . Orgs . Get ( ctx , orgID ) if err != nil { return nil , err } projects , err := w . engine . client . Projects . List ( ctx , orgID ) if err != nil { return nil , err } cgs := newCredentialGraphSet ( ) orgName := org . Body . ( * primitive . Org ) . Name for _ , project := range projects { projName := project . Body . ( * primitive . Project ) . Name graphs , err := w . engine . client . CredentialGraph . Search ( ctx , " " + orgName + " " + projName + " " , w . engine . session . AuthID ( ) ) if err != nil { return nil , err } err = cgs . Add ( graphs ... ) if err != nil { return nil , err } } needRotation , err := cgs . NeedRotation ( ) if err != nil { return nil , err } for _ , cred := range needRotation { base , err := baseCredential ( & cred ) if err != nil { return nil , err } item := apitypes . WorklogItem { Subject : base . PathExp . String ( ) + " " + base . Name , Summary : " " , } item . CreateID ( apitypes . SecretRotateWorklogType ) items = append ( items , item ) } return items , nil }
List returns the list of all outstanding worklog items for the given org
List returns the list of all outstanding worklog items for the given org